diff options
author | Rodeo <[email protected]> | 2013-06-03 15:37:38 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2013-06-03 15:37:38 +0000 |
commit | 16deb214281cd72ffaf2a11d3a5556c5b950a966 (patch) | |
tree | f673787fe7a92a894ec2ccace325af298831ef92 /test | |
parent | 812134ffba931aa603e67f541e7a2f0f03215fbb (diff) |
libhb/common: improve fallback mechanism.
API changes:
- added hb_global_init(), must be called before any other libhb function
- removed (somewhat pointless) hb_mixdown_t.internal_name
- some hb_*_get_from_name() functions now return 0 instead of -1.
Instead of hardcoded fallbacks, list items now have a specific fallback, and a generic ID for when the specific fallback is unavailable.
Encoder availability is checked at runtime (hb_global_init calling hb_common_global_init) and the item's value/fallback is sanity-checked and updated if necessary.
See https://reviews.handbrake.fr/r/506/ for more detailed information.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5547 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r-- | test/test.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/test/test.c b/test/test.c index 05b415043..6716c318e 100644 --- a/test/test.c +++ b/test/test.c @@ -184,13 +184,7 @@ int main( int argc, char ** argv ) int build; char * version; -/* win32 _IOLBF (line-buffering) is the same as _IOFBF (full-buffering). - * force it to unbuffered otherwise informative output is not easily parsed. - */ -#if defined( _WIN32 ) || defined( __MINGW32__ ) - setvbuf( stdout, NULL, _IONBF, 0 ); - setvbuf( stderr, NULL, _IONBF, 0 ); -#endif + hb_global_init(); audios = hb_list_init(); @@ -1961,7 +1955,7 @@ static int HandleEvents( hb_handle_t * h ) token = acodecs; while ( token != NULL ) { - if ((acodec = hb_audio_encoder_get_from_name(token)) == -1) + if ((acodec = hb_audio_encoder_get_from_name(token)) <= 0) { fprintf(stderr, "Invalid codec %s, using default for container.\n", token); acodec = hb_audio_encoder_get_default(job->mux); @@ -2034,7 +2028,7 @@ static int HandleEvents( hb_handle_t * h ) { arate = hb_audio_samplerate_get_from_name(token); } - if (arate == -1) + if (arate <= 0) { fprintf(stderr, "Invalid sample rate %s, using input rate %d\n", @@ -2413,9 +2407,6 @@ static int HandleEvents( hb_handle_t * h ) // Auto Passthru job->acodec_copy_mask = allowed_audio_copy == -1 ? HB_ACODEC_PASS_MASK : allowed_audio_copy; job->acodec_fallback = hb_audio_encoder_get_from_name(acodec_fallback); - // sanitize the fallback; -1 isn't a valid HB_ACODEC_* value - if (job->acodec_fallback == -1) - job->acodec_fallback = 0; } else if( ( audio->out.codec & HB_ACODEC_PASS_FLAG ) && !( audio->out.codec & audio->in.codec & HB_ACODEC_PASS_MASK ) ) |