[FFmpeg-devel] [PATCH v4 05/14] avcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are produced

Michael Niedermayer michael at niedermayer.cc
Sat Nov 11 13:54:17 EET 2017


On Fri, Nov 10, 2017 at 01:40:50PM -0800, Aman Gupta wrote:
> From: Aman Gupta <aman at tmm1.net>
> 
> The only reason videotoolbox wouldn't produce frames is if the data fed
> to it was invalid, so returning AVERROR_INVALIDDATA makes sense here.
> 
> Further, it means AVERROR_EXTERNAL can be used in further commits to signal
> fatal VideoToolbox errors, letting the user know that they need to fallback to
> another decoder.
> ---
>  libavcodec/h264dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
> index aed23c4fba..517f6acc13 100644
> --- a/libavcodec/h264dec.c
> +++ b/libavcodec/h264dec.c
> @@ -824,7 +824,7 @@ static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
>      int ret;
>  
>      if (src->format == AV_PIX_FMT_VIDEOTOOLBOX && src->buf[0]->size == 1)
> -        return AVERROR_EXTERNAL;
> +        return AVERROR_INVALIDDATA;

should be ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171111/64886c4b/attachment.sig>


More information about the ffmpeg-devel mailing list