summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2009-05-07 04:37:47 +0000
committereddyg <[email protected]>2009-05-07 04:37:47 +0000
commit5a583fb1d543fd6336dcadd8f653654debba2f74 (patch)
tree7d0697232f4c713f741b21546cca1f2465b36193 /libhb/sync.c
parent080a7aef7af9107730d6d0ca9ffcfca6abe32df8 (diff)
Change CC608 decoder to be its own thread
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2396 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 67093d1e6..c5842148c 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -293,6 +293,19 @@ static void SyncVideo( hb_work_object_t * w )
{
/* we got an end-of-stream. Feed it downstream & signal that we're done. */
hb_fifo_push( job->fifo_sync, hb_buffer_init( 0 ) );
+
+ /*
+ * Push through any subtitle EOFs in case they were not synced through.
+ */
+ for( i = 0; i < hb_list_count( job->list_subtitle ); i++)
+ {
+ subtitle = hb_list_item( job->list_subtitle, i );
+ if( subtitle->dest == PASSTHRUSUB )
+ {
+ hb_fifo_push( subtitle->fifo_out, hb_buffer_init( 0 ) );
+ }
+ }
+
pv->busy &=~ 1;
return;
}
@@ -313,6 +326,18 @@ static void SyncVideo( hb_work_object_t * w )
* video (we don't know its duration). On DVDs the final frame
* is often strange and dropping it seems to be a good idea. */
hb_fifo_push( job->fifo_sync, hb_buffer_init( 0 ) );
+
+ /*
+ * Push through any subtitle EOFs in case they were not synced through.
+ */
+ for( i = 0; i < hb_list_count( job->list_subtitle ); i++)
+ {
+ subtitle = hb_list_item( job->list_subtitle, i );
+ if( subtitle->dest == PASSTHRUSUB )
+ {
+ hb_fifo_push( subtitle->fifo_out, hb_buffer_init( 0 ) );
+ }
+ }
pv->busy &=~ 1;
return;
}
@@ -398,7 +423,8 @@ static void SyncVideo( hb_work_object_t * w )
/*
* Rewrite timestamps on subtitles that need it (on raw queue).
*/
- if( subtitle->source == CCSUB )
+ if( subtitle->source == CC608SUB ||
+ subtitle->source == CC708SUB )
{
/*
* Rewrite timestamps on subtitles that came from Closed Captions
@@ -416,7 +442,7 @@ static void SyncVideo( hb_work_object_t * w )
*
* Bypass the sync fifo altogether.
*/
- if( sub->size == 0 )
+ if( sub->size <= 0 )
{
sub = hb_fifo_get( subtitle->fifo_raw );
hb_fifo_push( subtitle->fifo_out, sub );