diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-10-16 13:30:52 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-10-24 00:29:37 +0200 |
commit | 5ffadec30aaa428a2c015268e80a2fb9811e47c3 (patch) | |
tree | 3cc5cc9dfb68079074d46704093dc75cd220dfaf /libavcodec | |
parent | 2fdc6f355cfc462029aff14e2dcf015ac0ecef3d (diff) | |
download | ffmpeg-5ffadec30aaa428a2c015268e80a2fb9811e47c3.tar.gz |
lavc/utils: propagate or return meaningful error codes in avcodec_open2()
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2ec28a729d..3980f46a3f 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; } |