FFmpeg decoder should only do audio if we're using source audio.
authorCarl Hetherington <cth@carlh.net>
Wed, 7 Nov 2012 14:02:24 +0000 (14:02 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 7 Nov 2012 14:02:24 +0000 (14:02 +0000)
src/lib/ffmpeg_decoder.cc

index e765d296a923e4b14223eba8ccd4e1f45bd9eb62..e26de4adab1d75442510be1d51721e6b71de19bd 100644 (file)
@@ -243,7 +243,7 @@ FFmpegDecoder::pass ()
                        process_video (_frame);
                }
 
-               if (_audio_stream >= 0 && _opt->decode_audio) {
+               if (_audio_stream >= 0 && _opt->decode_audio && _film->use_source_audio()) {
                        while (avcodec_decode_audio4 (_audio_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {
                                int const data_size = av_samples_get_buffer_size (
                                        0, _audio_codec_context->channels, _frame->nb_samples, audio_sample_format (), 1
@@ -307,7 +307,7 @@ FFmpegDecoder::pass ()
                        }
                }
 
-       } else if (_audio_stream >= 0 && _packet.stream_index == _audio_stream && _opt->decode_audio) {
+       } else if (_audio_stream >= 0 && _packet.stream_index == _audio_stream && _opt->decode_audio && _film->use_source_audio()) {
 
                int frame_finished;
                if (avcodec_decode_audio4 (_audio_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) {