[FFmpeg-devel] [PATCH v3] avcodec/mediacodecdec: Do not abort when H264/HEVC extradata extraction fails

Jan Ekström jeebjp at gmail.com
Sun Feb 14 13:52:09 EET 2021


On Sat, Feb 13, 2021 at 4:31 PM Jan Ekström <jeebjp at gmail.com> wrote:
>
> On Sat, Feb 13, 2021 at 12:48 AM sfan5 <sfan5 at live.de> wrote:
> >
> > 12.02.21 - 21:43 - Andreas Rheinhardt:
> > > sfan5:
> > >> Hi,
> > >>
> > >>
> > >> attached v2 patch after discussion on IRC with JEEB (as he already
> > >> mentioned).
> > >>
> > >> Only change is that the log level turns to debug when missing parameter
> > >> sets are within spec (cf. 14496-15).
> > >>
> > >>
> > >> -        av_log(avctx, AV_LOG_ERROR, "Could not extract PPS/SPS from extradata");
> > >> -        ret = AVERROR_INVALIDDATA;
> > >> +        const int warn = is_avc && avctx->codec_tag != MKTAG('a','v','c','1') &&
> > >> +            avctx->codec_tag != MKTAG('a','v','c','2');
> > >> +        av_log(avctx, warn ? AV_LOG_WARNING : AV_LOG_DEBUG,
> > >> +            "Could not extract PPS/SPS from extradata\n");
> > >> +        ret = 0;
> > >>       }
> > > warn = is_avc && (avctx->codec_tag == MKTAG('a','v','c','1') ||
> > >                    avctx->codec_tag == MKTAG('a','v','c','2')
> > > is what you (should) want.
> > >
> > > - Andreas
> >
> > Thanks for pointing that out, you're correct.
> >
> > here's v3:
>
> After some brief discussion on IRC, this looks good to me :) .
>

Applied as 6f80953554b07635d3b52f76b03807d198a5e9d0 with the
indentation of the log message and the initial capital letter of the
commit message fixed.

Jan


More information about the ffmpeg-devel mailing list