[FFmpeg-cvslog] avcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are produced

Aman Gupta git at videolan.org
Tue Nov 14 00:36:49 EET 2017


ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Mon Sep 25 16:45:53 2017 -0700| [dad42bc5a134f60164eab2dfb0892b761603e1e1] | committer: Aman Gupta

avcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are produced

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.

Signed-off-by: Aman Gupta <aman at tmm1.net>
Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dad42bc5a134f60164eab2dfb0892b761603e1e1
---

 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;
 
     ret = av_frame_ref(dst, src);
     if (ret < 0)



More information about the ffmpeg-cvslog mailing list