diff options
author | jstebbins <[email protected]> | 2010-09-13 20:30:02 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-09-13 20:30:02 +0000 |
commit | c1a82127fc2d99293cf27d3821d5ab85c93cc4ec (patch) | |
tree | 10f901bd683c4d58212d89cde17714c877bb6016 | |
parent | 427a2a77a298a9d5800f32bd8acaba63c33c3f9c (diff) |
fix a rare hang in the muxer.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3525 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/muxcommon.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index 05f49d40f..cb61739ac 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -244,10 +244,12 @@ static int muxWork( hb_work_object_t * w, hb_buffer_t ** buf_in, return HB_WORK_OK; } + int more = mux->rdy; // all tracks have at least 'interleave' ticks of data. Output // all that we can in 'interleave' size chunks. - while ( ( mux->rdy & mux->allRdy ) == mux->allRdy ) + while ( ( mux->rdy & mux->allRdy ) == mux->allRdy && more ) { + more = 0; for ( i = 0; i < mux->ntracks; ++i ) { track = mux->track[i]; @@ -270,6 +272,10 @@ static int muxWork( hb_work_object_t * w, hb_buffer_t ** buf_in, { mux->rdy &=~ ( 1 << i ); } + if ( track->mf.out != track->mf.in ) + { + more |= ( 1 << i ); + } } // if all the tracks are at eof we're just purging their |