summaryrefslogtreecommitdiffstats
path: root/libhb/muxcommon.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2009-05-04 04:56:19 +0000
committereddyg <[email protected]>2009-05-04 04:56:19 +0000
commitb2661d006f5b972e8599903b4909a8633ea5d5b3 (patch)
tree64b569cfd77a8c38495962ac340b6b8da30625d3 /libhb/muxcommon.c
parent5a1a257865a3156151ca16670f27c2d2f8a3ef56 (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/muxcommon.c')
-rw-r--r--libhb/muxcommon.c52
1 files changed, 32 insertions, 20 deletions
diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c
index b6008dc3c..30536dd00 100644
--- a/libhb/muxcommon.c
+++ b/libhb/muxcommon.c
@@ -223,22 +223,28 @@ static void MuxerFunc( void * _mux )
{
switch( job->mux )
{
- case HB_MUX_MP4:
- case HB_MUX_PSP:
- case HB_MUX_IPOD:
- m = hb_mux_mp4_init( job );
- break;
- case HB_MUX_AVI:
- m = hb_mux_avi_init( job );
- break;
- case HB_MUX_OGM:
- m = hb_mux_ogm_init( job );
- break;
- case HB_MUX_MKV:
- m = hb_mux_mkv_init( job );
+ case HB_MUX_MP4:
+ case HB_MUX_PSP:
+ case HB_MUX_IPOD:
+ m = hb_mux_mp4_init( job );
+ break;
+ case HB_MUX_AVI:
+ m = hb_mux_avi_init( job );
+ break;
+ case HB_MUX_OGM:
+ m = hb_mux_ogm_init( job );
+ break;
+ case HB_MUX_MKV:
+ m = hb_mux_mkv_init( job );
+ default:
+ hb_error( "No muxer selected, exiting" );
+ *job->die = 1;
}
/* Create file, write headers */
- m->init( m );
+ if( m )
+ {
+ m->init( m );
+ }
}
/* Build list of fifos we're interested in */
@@ -254,8 +260,8 @@ static void MuxerFunc( void * _mux )
// The following 'while' is the main muxing loop.
- int thread_sleep_interval = 50;
- while( !*job->die )
+ int thread_sleep_interval = 50;
+ while( !*job->die )
{
MoveToInternalFifos( mux );
if ( mux->rdy != mux->allRdy )
@@ -316,10 +322,13 @@ finished:
/* Update the UI */
hb_state_t state;
state.state = HB_STATE_MUXING;
- p.progress = 0;
+ p.progress = 0;
hb_set_state( job->h, &state );
#undef p
- m->end( m );
+ if( m )
+ {
+ m->end( m );
+ }
if( !stat( job->file, &sb ) )
{
@@ -353,8 +362,11 @@ finished:
}
}
}
-
- free( m );
+
+ if( m )
+ {
+ free( m );
+ }
for( i = 0; i < mux->ntracks; ++i )
{