[vlc-devel] [PATCH] avcodec: set profile in the ES descriptor if not already defined

Mathieu Velten matmaul at gmail.com
Tue Jan 2 14:26:25 CET 2018


Sometimes the profile is not available through the container metadatas
and not provided by the packetizer either (VP9 in WebM).
---
 modules/codec/avcodec/video.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index b056c1b..e16db7e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1495,6 +1495,11 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
     decoder_sys_t *p_sys = p_dec->p_sys;
     video_format_t fmt;
 
+    /* Sometimes the profile is not available through the container metadatas
+     * and not provided by the packetizer either (VP9 in WebM) */
+    if (p_dec->fmt_in.i_profile < 0 && p_context->profile > 0)
+        p_dec->fmt_in.i_profile = p_context->profile;
+
     /* Enumerate available formats */
     enum PixelFormat swfmt = avcodec_default_get_format(p_context, pi_fmt);
     bool can_hwaccel = false;
-- 
2.14.3



More information about the vlc-devel mailing list