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

Rémi Denis-Courmont remi at remlab.net
Tue Jan 2 17:34:43 CET 2018


Le 2 janvier 2018 14:26:25 GMT+01:00, Mathieu Velten <matmaul at gmail.com> a écrit :
>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
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

I doubt that this is valid by the memory model.
-- 
Remi Denis-Courmont


More information about the vlc-devel mailing list