diff options
author | jstebbins <[email protected]> | 2012-09-13 20:13:59 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-09-13 20:13:59 +0000 |
commit | 8329bf01460521587889fd4133f76b32ccf13217 (patch) | |
tree | c0758b2c843c05b03ab1ad93857c6045ad7c0a91 /libhb/sync.c | |
parent | ae8dee43bbcd12b5a4a532c7f4f65bf912479428 (diff) |
libhb: fix a collection of small memory leaks
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4963 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index 9c202c250..f5ef07776 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -234,7 +234,9 @@ void syncVideoClose( hb_work_object_t * w ) if ( --pv->common->ref == 0 ) { hb_unlock( pv->common->mutex ); + hb_cond_close( &pv->common->next_frame ); hb_lock_close( &pv->common->mutex ); + free( pv->common->first_pts ); free( pv->common ); } else @@ -360,12 +362,12 @@ int syncVideoWork( hb_work_object_t * w, hb_buffer_t ** buf_in, if( !sync->cur ) { sync->cur = next; - if( sync->cur->size == 0 ) + if (next->size == 0) { /* we got an end-of-stream as our first video packet? * Feed it downstream & signal that we're done. */ - *buf_out = hb_buffer_init( 0 ); + *buf_out = next; pv->common->start_found = 1; pv->common->first_pts[0] = INT64_MAX - 1; @@ -666,7 +668,9 @@ void syncAudioClose( hb_work_object_t * w ) if ( --pv->common->ref == 0 ) { hb_unlock( pv->common->mutex ); + hb_cond_close( &pv->common->next_frame ); hb_lock_close( &pv->common->mutex ); + free( pv->common->first_pts ); free( pv->common ); } else @@ -940,6 +944,7 @@ static void InitAudio( hb_job_t * job, hb_sync_common_t * common, int i ) default: { // Never gets here + codec = NULL; // Silence compiler warning } break; } @@ -1292,7 +1297,7 @@ static void UpdateSearchState( hb_work_object_t * w, int64_t start ) } if (now > sync->st_first) { - int eta; + int eta = 0; if ( pv->job->frame_to_start ) { |