]> git.sesse.net Git - ffmpeg/commitdiff
libx264: Return more meaningful error codes
authorHimangi Saraogi <himangi774@gmail.com>
Thu, 12 Mar 2015 16:20:13 +0000 (21:50 +0530)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 12 Mar 2015 18:09:22 +0000 (19:09 +0100)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/libx264.c

index 6388b6ce6c992fb4e4139827f01fa0bac3ec7aa5..6e707a867a850190677c9c778404c91a1d4e9390 100644 (file)
@@ -235,11 +235,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
     }
     do {
         if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
-            return -1;
+            return AVERROR_UNKNOWN;
 
         ret = encode_nals(ctx, pkt, nal, nnal);
         if (ret < 0)
-            return -1;
+            return ret;
     } while (!ret && !frame && x264_encoder_delayed_frames(x4->enc));
 
     pkt->pts = pic_out.i_pts;
@@ -518,7 +518,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
 
     x4->enc = x264_encoder_open(&x4->params);
     if (!x4->enc)
-        return -1;
+        return AVERROR_UNKNOWN;
 
     avctx->coded_frame = av_frame_alloc();
     if (!avctx->coded_frame)