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

Thomas Guillem thomas at gllm.fr
Tue Jan 2 14:29:58 CET 2018


Hello,

dec->fmt_in should not be written from decoder modules.

I already merged your VP9 vaapi patch. Was I too fast ?

On Tue, Jan 2, 2018, at 14:26, Mathieu Velten wrote:
> 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


More information about the vlc-devel mailing list