summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-04-24 16:48:42 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-05-18 17:27:06 -0400
commitbc778a0cea3027941afa1ff6bbb424b3159a0b27 (patch)
tree0a65284095508e83a60149b62ba7d2cbe6a673c0 /ffplay.c
parent00e5da893dc8f67cbc9ed940c4da9423a01e4f8c (diff)
downloadffmpeg-bc778a0cea3027941afa1ff6bbb424b3159a0b27.tar.gz
Add support for request_sample_format in ffmpeg and ffplay.
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index a5dc358f72..c3dc970a1e 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -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);