summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-05-08 17:49:17 +0000
committerRodeo <[email protected]>2013-05-08 17:49:17 +0000
commit2a9ec102706226a3b84f6e01ac0152a432d77332 (patch)
treec665e5a089a8a100c5a189fda8b34a70ab0ae1fa /test
parent71e9fb2a70d30f3de8154a165063243301d5091d (diff)
CLI: fix broken code for preserving libhb's default muxer.
It was checking if (job->mux) instead of if (mux)… Also move setting the muxer and muxer options earlier, as we need to know the final muxer when e.g. setting audio settings. Also, don't set the default audio codec before we have all relevant information. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5445 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r--test/test.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/test/test.c b/test/test.c
index e65110161..771682280 100644
--- a/test/test.c
+++ b/test/test.c
@@ -78,7 +78,6 @@ static char ** acompressions = NULL;
static char * acodec_fallback = NULL;
static char * acodecs = NULL;
static char ** anames = NULL;
-static int default_acodec = 0;
static int audio_explicit = 0;
static char ** subtracks = NULL;
static char ** subforce = NULL;
@@ -1773,6 +1772,27 @@ static int HandleEvents( hb_handle_t * h )
hb_add_filter( job, filter, filter_str );
free( filter_str );
+ // hb_job_init() will set a default muxer for us
+ // only override it if a specific muxer has been set
+ // note: the muxer must be set after presets, but before encoders
+ if (mux)
+ {
+ job->mux = mux;
+ }
+ // then, muxer options
+ if (largeFileSize)
+ {
+ job->largeFileSize = 1;
+ }
+ if (mp4_optimize)
+ {
+ job->mp4_optimize = 1;
+ }
+ if (ipod_atom)
+ {
+ job->ipod_atom = 1;
+ }
+
if( vquality >= 0.0 )
{
job->vquality = vquality;
@@ -1945,7 +1965,7 @@ static int HandleEvents( hb_handle_t * h )
if ((acodec = get_acodec_for_string(token)) == -1)
{
fprintf(stderr, "Invalid codec %s, using default for container.\n", token);
- acodec = default_acodec;
+ acodec = hb_get_default_audio_encoder(job->mux);
}
if( i < num_audio_tracks )
{
@@ -1983,7 +2003,7 @@ static int HandleEvents( hb_handle_t * h )
* then use that codec instead.
*/
if (i != 1)
- acodec = default_acodec;
+ acodec = hb_get_default_audio_encoder(job->mux);
for ( ; i < num_audio_tracks; i++)
{
audio = hb_list_audio_config_item(job->list_audio, i);
@@ -2662,24 +2682,6 @@ static int HandleEvents( hb_handle_t * h )
}
}
- if( job->mux )
- {
- job->mux = mux;
- }
-
- if ( largeFileSize )
- {
- job->largeFileSize = 1;
- }
- if ( mp4_optimize )
- {
- job->mp4_optimize = 1;
- }
- if ( ipod_atom )
- {
- job->ipod_atom = 1;
- }
-
hb_job_set_file( job, output );
if( color_matrix_code )
@@ -4169,7 +4171,6 @@ static int CheckOptions( int argc, char ** argv )
"choices are mp4, m4v and mkv\n.", format );
return 1;
}
- default_acodec = hb_get_default_audio_encoder(mux);
}
return 0;