[FFmpeg-devel] [PATCH 1/2] avcodec/mlp_parser: don't try to combine frames when full frames are provided

Rostislav Pehlivanov atomnuker at gmail.com
Fri Jan 19 22:02:15 EET 2018


On 19 January 2018 at 19:51, James Almer <jamrial at gmail.com> wrote:

> Attempting full frame reconstruction is unnecessary for containers
> like Matroska, so just skip it altogether.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/mlp_parser.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
> index 3c0330f777..4827354f18 100644
> --- a/libavcodec/mlp_parser.c
> +++ b/libavcodec/mlp_parser.c
> @@ -256,6 +256,9 @@ static int mlp_parse(AVCodecParserContext *s,
>      if (buf_size == 0)
>          return 0;
>
> +    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
> +        next = buf_size;
> +    } else {
>      if (!mp->in_sync) {
>          // Not in sync - find a major sync header
>
> @@ -315,6 +318,7 @@ static int mlp_parse(AVCodecParserContext *s,
>      }
>
>      mp->bytes_left = 0;
> +    }
>
>      sync_present = (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;
>
> --
> 2.15.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Makes sense to me, both commits look fine


More information about the ffmpeg-devel mailing list