diff options
author | eddyg <[email protected]> | 2009-05-04 04:56:19 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2009-05-04 04:56:19 +0000 |
commit | b2661d006f5b972e8599903b4909a8633ea5d5b3 (patch) | |
tree | 64b569cfd77a8c38495962ac340b6b8da30625d3 /libhb/muxmp4.c | |
parent | 5a1a257865a3156151ca16670f27c2d2f8a3ef56 (diff) |
Soft Subs Part 2: Auto-detect CC during scan, add CC to subtitle list in title, if selected then CC's are extracted, MP4 Muxer will dump the subs to the log at the end of encoding. TODO: Translate PTS for buf->start to HB format, add MP4 subtitle track and subs during muxing.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2375 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmp4.c')
-rw-r--r-- | libhb/muxmp4.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index 29d08ca88..81ee2f8ad 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -590,6 +590,7 @@ static int MP4End( hb_mux_object_t * m ) { hb_job_t * job = m->job; hb_title_t * title = job->title; + int i; /* Write our final chapter marker */ if( m->job->chapter_markers ) @@ -666,6 +667,37 @@ static int MP4End( hb_mux_object_t * m ) MP4TagsFree( tags ); } + /* + * Display any text subs. + * + * This is placeholder code, what needs to happen is that we need to + * convert these PTS (which are pre-sync ones) into HB timestamps, + * I guess sync should do that? + * + * And then this needs to move into the Mux code above and insert + * subtitle samples into the MP4 at the correct times. + */ + for( i = 0; i < hb_list_count( job->list_subtitle ); i++ ) + { + hb_subtitle_t *subtitle = hb_list_item( job->list_subtitle, i ); + + if( subtitle && subtitle->format == TEXTSUB && + subtitle->dest == PASSTHRUSUB ) + { + /* + * Should be adding this one if the timestamp is right. + */ + hb_buffer_t *buffer; + + while( (buffer = hb_fifo_get( subtitle->fifo_raw )) != NULL ) + { + hb_log("MuxMP4: Text Sub: %s", buffer->data); + + hb_buffer_close( &buffer ); + } + } + } + MP4Close( m->file ); if ( job->mp4_optimize ) |