diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-04-24 16:48:42 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-05-18 17:27:06 -0400 |
commit | bc778a0cea3027941afa1ff6bbb424b3159a0b27 (patch) | |
tree | 0a65284095508e83a60149b62ba7d2cbe6a673c0 /ffplay.c | |
parent | 00e5da893dc8f67cbc9ed940c4da9423a01e4f8c (diff) | |
download | ffmpeg-streaming-bc778a0cea3027941afa1ff6bbb424b3159a0b27.zip ffmpeg-streaming-bc778a0cea3027941afa1ff6bbb424b3159a0b27.tar.gz |
Add support for request_sample_format in ffmpeg and ffplay.
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -2412,6 +2412,23 @@ static int decode_thread(void *arg) if(genpts) ic->flags |= AVFMT_FLAG_GENPTS; + /* Set AVCodecContext options so they will be seen by av_find_stream_info() */ + for (i = 0; i < ic->nb_streams; i++) { + AVCodecContext *dec = ic->streams[i]->codec; + switch (dec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_AUDIO], + AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM, + NULL); + break; + case AVMEDIA_TYPE_VIDEO: + set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_VIDEO], + AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM, + NULL); + break; + } + } + err = av_find_stream_info(ic); if (err < 0) { fprintf(stderr, "%s: could not find codec parameters\n", is->filename); |