diff options
author | Zhong Li <zhong.li@intel.com> | 2018-01-19 13:05:55 +0800 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-02-02 16:40:40 -0300 |
commit | 19b1d905b88d32a86511219585eae6afda23dfbd (patch) | |
tree | e56fcabd64c82a583a6252568afce8ce99811651 | |
parent | 108958e43df075967217d4c81cb4cea5164b2b5f (diff) | |
download | ffmpeg-19b1d905b88d32a86511219585eae6afda23dfbd.tar.gz |
ffprobe: Initialize coded_width/height
coded_width/height are unnitialized and will be overwritten by
dec_ctx->width/height in avcodec_open2()
This fixes tiket #6958.
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | fftools/ffprobe.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index acb403e3b1..fc3a14a807 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2512,10 +2512,12 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id case AVMEDIA_TYPE_VIDEO: print_int("width", par->width); print_int("height", par->height); +#if FF_API_LAVF_AVCTX if (dec_ctx) { print_int("coded_width", dec_ctx->coded_width); print_int("coded_height", dec_ctx->coded_height); } +#endif print_int("has_b_frames", par->video_delay); sar = av_guess_sample_aspect_ratio(fmt_ctx, stream, NULL); if (sar.den) { @@ -2912,6 +2914,12 @@ static int open_input_file(InputFile *ifile, const char *filename) ist->dec_ctx->pkt_timebase = stream->time_base; ist->dec_ctx->framerate = stream->avg_frame_rate; +#if FF_API_LAVF_AVCTX +FF_DISABLE_DEPRECATION_WARNINGS + ist->dec_ctx->coded_width = stream->codec->coded_width; + ist->dec_ctx->coded_height = stream->codec->coded_height; +FF_ENABLE_DEPRECATION_WARNINGS +#endif if (avcodec_open2(ist->dec_ctx, codec, &opts) < 0) { av_log(NULL, AV_LOG_WARNING, "Could not open codec for input stream %d\n", |