diff options
author | jstebbins <[email protected]> | 2011-10-31 14:59:32 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-10-31 14:59:32 +0000 |
commit | 2eae9be4713838c9eb4a111246f2e8d63a62fd7a (patch) | |
tree | 8d85fa4e770912ee755fc58ef48f3a0ebe680e24 | |
parent | ee03feea6ff45d159bd4060e5f7492ac727ec600 (diff) |
Allow vorbis quality to go down to -0.2
Bizzaro vorbis allows negative quality factors. They go to 11 in the
wrong direction.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4332 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/hb-backend.c | 2 | ||||
-rw-r--r-- | libhb/common.c | 2 | ||||
-rw-r--r-- | libhb/encvorbis.c | 8 | ||||
-rw-r--r-- | libhb/work.c | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 00c6e8752..d3f85a9c8 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -4969,7 +4969,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) audio.out.samplerate = srate; double quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && - quality >= 0) + quality != -1) { audio.out.quality = quality; audio.out.bitrate = -1; diff --git a/libhb/common.c b/libhb/common.c index 09a82b112..2000c366a 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -519,7 +519,7 @@ void hb_get_audio_quality_limits(uint32_t codec, float *low, float *high, float case HB_ACODEC_VORBIS: *direction = 0; *granularity = 0.05; - *low = 0.; + *low = -0.2; *high = 1.0; break; diff --git a/libhb/encvorbis.c b/libhb/encvorbis.c index 8ac2e1a58..5507fac47 100644 --- a/libhb/encvorbis.c +++ b/libhb/encvorbis.c @@ -82,17 +82,17 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job ) { hb_error( "encvorbis: vorbis_encode_setup_managed failed.\n" ); *job->die = 1; - return 0; + return -1; } } - else if( audio->config.out.quality >= 0 ) + else if( audio->config.out.quality != -1 ) { if( vorbis_encode_setup_vbr( &pv->vi, pv->out_discrete_channels, audio->config.out.samplerate, audio->config.out.quality ) ) { hb_error( "encvorbis: vorbis_encode_setup_vbr failed.\n" ); *job->die = 1; - return 0; + return -1; } } @@ -101,7 +101,7 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job ) { hb_error( "encvorbis: vorbis_encode_ctl( ratemanage2_set ) OR vorbis_encode_setup_init failed.\n" ); *job->die = 1; - return 0; + return -1; } /* add a comment */ diff --git a/libhb/work.c b/libhb/work.c index ea05c098f..39dcc4d28 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -407,7 +407,7 @@ void hb_display_job_info( hb_job_t * job ) hb_log( " + encoder: %s", hb_audio_encoders[j].human_readable_name ); if( audio->config.out.bitrate > 0 ) hb_log( " + bitrate: %d kbps, samplerate: %d Hz", audio->config.out.bitrate, audio->config.out.samplerate ); - else if( audio->config.out.quality >= 0 ) + else if( audio->config.out.quality != -1 ) hb_log( " + quality: %.2f, samplerate: %d Hz", audio->config.out.quality, audio->config.out.samplerate ); else if( audio->config.out.samplerate > 0 ) hb_log( " + samplerate: %d Hz", audio->config.out.samplerate ); @@ -706,7 +706,7 @@ static void do_job( hb_job_t * job ) } /* sense-check the requested quality */ - if( audio->config.out.quality >= 0 ) + if( audio->config.out.quality != -1 ) { float best_quality = hb_get_best_audio_quality( audio->config.out.codec, audio->config.out.quality ); @@ -728,7 +728,7 @@ static void do_job( hb_job_t * job ) } /* sense-check the requested bitrate */ - if( audio->config.out.quality < 0 ) + if( audio->config.out.quality == -1 ) { if( audio->config.out.bitrate <= 0 ) { |