Browse Source

tools/decode_simple: initialize decoder parameters with container info

Anton Khirnov 2 years ago
parent
commit
554c6d7cb1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tools/decode_simple.c

+ 4 - 0
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: