OSDN Git Service

Fixes for different number of frames between pass 1 & 2, missing frames at end, and...
authorvan <van@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 13 Apr 2008 23:31:37 +0000 (23:31 +0000)
committervan <van@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 13 Apr 2008 23:31:37 +0000 (23:31 +0000)
commita6ecdb87d945458af1f5bff7b4fb0557c411bd95
tree56f6c5ba9b69726d925e7c13f0e2e0245a134c3f
parentaee60ed8c2883d467f326f5cb531b8a339e0ac1b
Fixes for different number of frames between pass 1 & 2, missing frames at end, and an deadlock with pcm audio.
 - since the SCR clock recovery is done in reader.c we can't currently skip audio frames during pass 1 or we miss clock changes signaled by those frames & end up dropping more video frames in pass 1 than pass 2.
 - since many modules buffer frames we can't tell if we're done just by looking for empty fifos. Send an empty buffer to mark end-of-stream all the way along the processing pipeline & use it to flush internally buffered data.
 - in a processing pipeline you're done when the end of the pipe says your done. add a thread status variable so we can tell when individual threads are finished then make do_job wait until the encoder thread is done so that we're sure all the frames have been processed and sent to the muxer.
 - since the muxer alternates between reading video & audio packets we have to have enough buffer in the audio pipeline to handle a video-frame's worth of audio packets (33ms). Since pcm packets are <1ms we need >60 slots in the audio fifos or we'll deadlock.

git-svn-id: svn://localhost/HandBrake/trunk@1412 b64f7644-9d1e-0410-96f1-a4d463321fa5
libhb/common.h
libhb/decmpeg2.c
libhb/hb.c
libhb/reader.c
libhb/sync.c
libhb/work.c