diff options
author | jstebbins <[email protected]> | 2010-10-02 19:11:09 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-10-02 19:11:09 +0000 |
commit | 2234c261324989a56bb7401088e45384578b91d2 (patch) | |
tree | af4d132f918504d306f0308c4abc73f42051ede5 /libhb/hb.c | |
parent | ce5592b18dfe78c3e46a2816b541ad9a1d0c429e (diff) |
fix ffmpeg locking issue
ffmpeg complained "insufficient thread locking around avcodec_open/close()".
This was caused by encavcodec.c calling avcodec_open at the same time as
stream.c called av_find_stream_info. av_find_stream_info has a side effect
of calling avcodec_open, so we must lock around this call as well.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3563 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index 36fcd75c9..fcb4a55df 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -82,6 +82,15 @@ int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec) return ret; } +int hb_av_find_stream_info(AVFormatContext *ic) +{ + int ret; + hb_lock( hb_avcodec_lock ); + ret = av_find_stream_info( ic ); + hb_unlock( hb_avcodec_lock ); + return ret; +} + int hb_avcodec_close(AVCodecContext *avctx) { int ret; |