[FFmpeg-cvslog] lavc/utils: propagate or return meaningful error codes in avcodec_open2()

Stefano Sabatini git at videolan.org
Wed Oct 24 00:34:14 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Oct 16 13:30:52 2012 +0200| [5ffadec30aaa428a2c015268e80a2fb9811e47c3] | committer: Stefano Sabatini

lavc/utils: propagate or return meaningful error codes in avcodec_open2()

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

 libavcodec/utils.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2ec28a7..3980f46 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -849,14 +849,14 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
 
     /* If there is a user-supplied mutex locking routine, call it. */
     if (ff_lockmgr_cb) {
-        if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
-            return -1;
+        if ((ret = (*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN)) < 0)
+            return ret;
     }
 
     entangled_thread_counter++;
     if (entangled_thread_counter != 1) {
         av_log(avctx, AV_LOG_ERROR, "Insufficient thread locking around avcodec_open/close()\n");
-        ret = -1;
+        ret = AVERROR(EINVAL);
         goto end;
     }
 



More information about the ffmpeg-cvslog mailing list