• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

githubのコードからのfolk


Commit MetaInfo

Revision8e1255d542133cf6b378190d947254ca9df3347d (tree)
Time2010-10-03 04:11:09
Authorjstebbins <jstebbins@b64f...>
Commiterjstebbins

Log Message

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://localhost/HandBrake/trunk@3563 b64f7644-9d1e-0410-96f1-a4d463321fa5

Change Summary

Incremental Difference

--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -82,6 +82,15 @@ int hb_avcodec_open(AVCodecContext *avctx, AVCodec *codec)
8282 return ret;
8383 }
8484
85+int hb_av_find_stream_info(AVFormatContext *ic)
86+{
87+ int ret;
88+ hb_lock( hb_avcodec_lock );
89+ ret = av_find_stream_info( ic );
90+ hb_unlock( hb_avcodec_lock );
91+ return ret;
92+}
93+
8594 int hb_avcodec_close(AVCodecContext *avctx)
8695 {
8796 int ret;
--- a/libhb/hbffmpeg.h
+++ b/libhb/hbffmpeg.h
@@ -9,4 +9,5 @@
99 void hb_avcodec_init(void);
1010 int hb_avcodec_open( AVCodecContext *, struct AVCodec * );
1111 int hb_avcodec_close( AVCodecContext * );
12+int hb_av_find_stream_info(AVFormatContext *ic);
1213 int hb_ff_layout_xlat(int64_t ff_layout, int channels);
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -2909,7 +2909,7 @@ static int ffmpeg_open( hb_stream_t *stream, hb_title_t *title )
29092909 {
29102910 return 0;
29112911 }
2912- if ( av_find_stream_info( ic ) < 0 )
2912+ if ( hb_av_find_stream_info( ic ) < 0 )
29132913 goto fail;
29142914
29152915 stream->ffmpeg_ic = ic;