History

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

Stefano Sabatini committed 14 years ago

Commit 5ffadec1 parent 2fdc6f31 file · +3 −3Browse files

Unified · Split

libavcodec/utils.c+3−3
@@ -849,14 +849,14 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code · 848 unmodified lines
849849
850850 /* If there is a user-supplied mutex locking routine, call it. */
851851 if (ff_lockmgr_cb) {
852− if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
853− return -1;
852+ if ((ret = (*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN)) < 0)
853+ return ret;
854854 }
855855
856856 entangled_thread_counter++;
857857 if (entangled_thread_counter != 1) {
858858 av_log(avctx, AV_LOG_ERROR, "Insufficient thread locking around avcodec_open/close()\n");
859− ret = -1;
859+ ret = AVERROR(EINVAL);
860860 goto end;
861861 }
862862

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t