diff mbox series

[FFmpeg-devel,2/3] tools/decode_simple: initialize decoder parameters with container info

Message ID 20221018115159.17780-2-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/3] tools/decode_simple: always call process_frame(NULL) at the end | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Oct. 18, 2022, 11:51 a.m. UTC
---
 tools/decode_simple.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/tools/decode_simple.c b/tools/decode_simple.c
index 8dc3bd2054..cd81d53168 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: