[FFmpeg-cvslog] tools/decode_simple: initialize decoder parameters with container info

Anton Khirnov git at videolan.org
Tue Mar 28 14:07:53 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Oct 18 13:37:25 2022 +0200| [554c6d7cb1aa529f8189af3f4655283d39291809] | committer: Anton Khirnov

tools/decode_simple: initialize decoder parameters with container info

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=554c6d7cb1aa529f8189af3f4655283d39291809
---

 tools/decode_simple.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/decode_simple.c b/tools/decode_simple.c
index 8a9e7c5f71..6532e368d4 100644
--- a/tools/decode_simple.c
+++ b/tools/decode_simple.c
@@ -149,6 +149,10 @@ int ds_open(DecodeContext *dc, const char *url, int stream_idx)
     if (!dc->decoder)
         return AVERROR(ENOMEM);
 
+    ret = avcodec_parameters_to_context(dc->decoder, dc->stream->codecpar);
+    if (ret < 0)
+        goto fail;
+
     return 0;
 
 fail:



More information about the ffmpeg-cvslog mailing list