diff options
author | van <[email protected]> | 2009-05-06 06:42:21 +0000 |
---|---|---|
committer | van <[email protected]> | 2009-05-06 06:42:21 +0000 |
commit | 6c18f1b2bb0d939bd76a958907b2848db98ba380 (patch) | |
tree | ee00b579cd2d2c109cf9bcb8e5adde4a9e7257cd /libhb | |
parent | 79e3ce78a5d733d559820949e0d43e9769b7dc75 (diff) |
Fix several boneheaded mistakes in fifo ready logic.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2391 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/muxcommon.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index b64ebff85..813afc863 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -265,7 +265,7 @@ static void MuxerFunc( void * _mux ) while( !*job->die ) { MoveToInternalFifos( mux ); - if ( mux->rdy != mux->allRdy ) + if ( ( mux->rdy & mux->allRdy ) != mux->allRdy ) { hb_snooze( thread_sleep_interval ); continue; @@ -273,22 +273,25 @@ static void MuxerFunc( void * _mux ) // all tracks have at least 'interleave' ticks of data. Output // all that we can in 'interleave' size chunks. - while ( mux->rdy == mux->allRdy ) + while ( ( mux->rdy & mux->allRdy ) == mux->allRdy ) { for ( i = 0; i < mux->ntracks; ++i ) { - track = mux->track[i]; - OutputTrackChunk( mux, track, m ); - - // if the track is at eof or still has data that's past - // our next interleave point then leave it marked as rdy. - // Otherwise clear rdy. - if ( ( mux->eof & (1 << i) ) == 0 && - ( track->mf.out == track->mf.in || - track->mf.fifo[(track->mf.in-1) & (track->mf.flen-1)]->stop - < mux->pts + mux->interleave ) ) + if ( mux->rdy & (1 << i) ) { - mux->rdy &=~ ( 1 << i ); + track = mux->track[i]; + OutputTrackChunk( mux, track, m ); + + // if the track is at eof or still has data that's past + // our next interleave point then leave it marked as rdy. + // Otherwise clear rdy. + if ( ( mux->eof & (1 << i) ) == 0 && + ( track->mf.out == track->mf.in || + track->mf.fifo[(track->mf.in-1) & (track->mf.flen-1)]->stop + < mux->pts + mux->interleave ) ) + { + mux->rdy &=~ ( 1 << i ); + } } } |