diff options
author | jstebbins <[email protected]> | 2008-12-12 18:54:36 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-12-12 18:54:36 +0000 |
commit | 47b9304671876792e9a2364e867c9601d0432076 (patch) | |
tree | 7db84f17a253b6767552495b92ed6341000af62c /libhb/sync.c | |
parent | cec83b5d831f2c988e5544ddc16602bda903a225 (diff) |
fix a threading issue with avcodec_open/close
these functions can not be called from 2 threads simultaneosly.
made a wrapper function that holds a lock while making the call
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2023 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index e81095907..411c65610 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -238,7 +238,7 @@ static void InitAudio( hb_work_object_t * w, int i ) c->sample_rate = sync->audio->config.in.samplerate; c->channels = HB_INPUT_CH_LAYOUT_GET_DISCRETE_COUNT( sync->audio->config.in.channel_layout ); - if( avcodec_open( c, codec ) < 0 ) + if( hb_avcodec_open( c, codec ) < 0 ) { hb_log( "sync: avcodec_open failed" ); return; @@ -257,7 +257,7 @@ static void InitAudio( hb_work_object_t * w, int i ) } free( zeros ); - avcodec_close( c ); + hb_avcodec_close( c ); av_free( c ); } else |