summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authoreddyg <[email protected]>2009-05-06 04:16:40 +0000
committereddyg <[email protected]>2009-05-06 04:16:40 +0000
commitf79870292926127a3be70c072eca37f653957fc5 (patch)
treea3b7e466a846b1946b3c8fc0989e81b8f8939cba /libhb
parent6add7d899f49abbe2b6cc0702296941e948f5ef5 (diff)
VOBSUB encoder skeleton for use with mkv VOBSUB pass-through
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2389 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/common.h2
-rw-r--r--libhb/decvobsub.c2
-rw-r--r--libhb/hb.c1
-rw-r--r--libhb/hb.h2
-rw-r--r--libhb/internal.h1
-rw-r--r--libhb/sync.c6
-rw-r--r--libhb/work.c22
7 files changed, 30 insertions, 6 deletions
diff --git a/libhb/common.h b/libhb/common.h
index 81877d6d2..dfa1dcabd 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -456,6 +456,7 @@ struct hb_subtitle_s
/* Internal data */
hb_fifo_t * fifo_in; /* SPU ES */
hb_fifo_t * fifo_raw; /* Decoded SPU */
+ hb_fifo_t * fifo_sync;/* Synced */
hb_fifo_t * fifo_out; /* Correct Timestamps, ready to be muxed */
#endif
};
@@ -653,6 +654,7 @@ struct hb_work_object_s
extern hb_work_object_t hb_sync;
extern hb_work_object_t hb_decmpeg2;
extern hb_work_object_t hb_decsub;
+extern hb_work_object_t hb_encsub;
extern hb_work_object_t hb_render;
extern hb_work_object_t hb_encavcodec;
extern hb_work_object_t hb_encxvid;
diff --git a/libhb/decvobsub.c b/libhb/decvobsub.c
index 98ffa1a0d..102d18fe7 100644
--- a/libhb/decvobsub.c
+++ b/libhb/decvobsub.c
@@ -125,7 +125,7 @@ void decsubClose( hb_work_object_t * w )
hb_work_object_t hb_decsub =
{
WORK_DECSUB,
- "Subtitle decoder",
+ "VOBSUB decoder",
decsubInit,
decsubWork,
decsubClose
diff --git a/libhb/hb.c b/libhb/hb.c
index 2ffa16976..cdde54f4f 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -230,6 +230,7 @@ hb_handle_t * hb_init_dl( int verbose, int update_check )
hb_register( &hb_sync );
hb_register( &hb_decmpeg2 );
hb_register( &hb_decsub );
+ hb_register( &hb_encsub );
hb_register( &hb_render );
hb_register( &hb_encavcodec );
hb_register( &hb_encxvid );
diff --git a/libhb/hb.h b/libhb/hb.h
index 0c96656d6..860f441e0 100644
--- a/libhb/hb.h
+++ b/libhb/hb.h
@@ -22,6 +22,7 @@ hb_init_real( v, u ); \
hb_register( &hb_sync ); \
hb_register( &hb_decmpeg2 ); \
hb_register( &hb_decsub ); \
+hb_register( &hb_encsub ); \
hb_register( &hb_render ); \
hb_register( &hb_encavcodec ); \
hb_register( &hb_encxvid ); \
@@ -43,6 +44,7 @@ hb_init_real( v, u ); \
hb_register( &hb_sync ); \
hb_register( &hb_decmpeg2 ); \
hb_register( &hb_decsub ); \
+hb_register( &hb_encsub ); \
hb_register( &hb_render ); \
hb_register( &hb_encavcodec ); \
hb_register( &hb_encx264 ); \
diff --git a/libhb/internal.h b/libhb/internal.h
index 7d7594802..f5df6cec9 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -255,6 +255,7 @@ enum
WORK_SYNC = 1,
WORK_DECMPEG2,
WORK_DECSUB,
+ WORK_ENCSUB,
WORK_RENDER,
WORK_ENCAVCODEC,
WORK_ENCXVID,
diff --git a/libhb/sync.c b/libhb/sync.c
index 39be41310..fb02b1387 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -413,6 +413,8 @@ static void SyncVideo( hb_work_object_t * w )
*
* What about discontinuity boundaries - not delt
* with here - Van?
+ *
+ * Bypass the sync fifo altogether.
*/
if( sub->size == 0 || sub->start < cur->start )
{
@@ -638,14 +640,14 @@ static void SyncVideo( hb_work_object_t * w )
} else {
/*
* Pass-Through, pop it off of the raw queue, rewrite times and
- * make it available to be muxed.
+ * make it available to be reencoded.
*/
uint64_t sub_duration;
sub = hb_fifo_get( subtitle->fifo_raw );
sub_duration = sub->stop - sub->start;
sub->start = buf_tmp->start;
sub->stop = sub->start + duration;
- hb_fifo_push( subtitle->fifo_out, sub );
+ hb_fifo_push( subtitle->fifo_sync, sub );
}
} else {
/*
diff --git a/libhb/work.c b/libhb/work.c
index 0f7c13154..323f4cf4a 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -488,9 +488,10 @@ static void do_job( hb_job_t * job, int cpu_count )
if( subtitle )
{
- subtitle->fifo_in = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- subtitle->fifo_raw = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- subtitle->fifo_out = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
+ subtitle->fifo_in = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
+ subtitle->fifo_raw = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
+ subtitle->fifo_sync = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
+ subtitle->fifo_out = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
/*
* Disable forced subtitles if we didn't find any in the scan
@@ -517,6 +518,20 @@ static void do_job( hb_job_t * job, int cpu_count )
w->fifo_out = subtitle->fifo_raw;
hb_list_add( job->list_work, w );
}
+
+ if( !job->indepth_scan &&
+ subtitle->format == PICTURESUB
+ && subtitle->dest == PASSTHRUSUB )
+ {
+ /*
+ * Passing through a subtitle picture, this will have to
+ * be rle encoded before muxing.
+ */
+ w = hb_get_work( WORK_ENCSUB );
+ w->fifo_in = subtitle->fifo_sync;
+ w->fifo_out = subtitle->fifo_out;
+ hb_list_add( job->list_work, w );
+ }
}
}
@@ -861,6 +876,7 @@ cleanup:
{
hb_fifo_close( &subtitle->fifo_in );
hb_fifo_close( &subtitle->fifo_raw );
+ hb_fifo_close( &subtitle->fifo_sync );
hb_fifo_close( &subtitle->fifo_out );
}
}