summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-09-09 20:58:13 +0000
committerMartin Storsjö <martin@martin.st>2010-09-09 20:58:13 +0000
commit2dfa7c72cede04f95c4989099bcebfeeed68455b (patch)
tree239847acb163937a7c04703a82fcf6c3711feb02 /ffmpeg.c
parent23e05db79cf02a4fa1ef6e2f1158d11b4bf406b6 (diff)
Update the audio sample rate when doing lowres audio decoding, before opening the decoder
Originally committed as revision 25090 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f2f106714d..da92581af0 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3241,6 +3241,11 @@ static void opt_input_file(const char *filename)
input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(audio_codec_name);
if(audio_disable)
st->discard= AVDISCARD_ALL;
+ /* Note that av_find_stream_info can add more streams, and we
+ * currently have no chance of setting up lowres decoding
+ * early enough for them. */
+ if (dec->lowres)
+ audio_sample_rate >>= dec->lowres;
break;
case AVMEDIA_TYPE_VIDEO:
set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);