Don't create resamplers with no channels.
authorCarl Hetherington <cth@carlh.net>
Sun, 6 Sep 2015 13:36:09 +0000 (14:36 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 6 Sep 2015 13:36:09 +0000 (14:36 +0100)
src/lib/audio_decoder_stream.cc

index 365be336fdc896f2ca925f33af49d12b7857d6d8..267c542cdba60d5393361ae965aeed86a4f58558 100644 (file)
@@ -44,7 +44,7 @@ AudioDecoderStream::AudioDecoderStream (shared_ptr<const AudioContent> content,
        , _stream (stream)
        , _decoder (decoder)
 {
-       if (content->resampled_audio_frame_rate() != _stream->frame_rate()) {
+       if (content->resampled_audio_frame_rate() != _stream->frame_rate() && _stream->channels() > 0) {
                _resampler.reset (new Resampler (_stream->frame_rate(), content->resampled_audio_frame_rate(), _stream->channels ()));
        }