]> granicus.if.org Git - handbrake/commitdiff
Allow vorbis quality to go down to -0.2
authorjstebbins <jstebbins.hb@gmail.com>
Mon, 31 Oct 2011 14:59:32 +0000 (14:59 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Mon, 31 Oct 2011 14:59:32 +0000 (14:59 +0000)
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

gtk/src/hb-backend.c
libhb/common.c
libhb/encvorbis.c
libhb/work.c

index 00c6e875234024580d4624b60ebb91865fe1765d..d3f85a9c89ffba3ef71f778d6e2b37c16f3946b3 100644 (file)
@@ -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;
index 09a82b112ec8955aeb519cb50e861351dc002576..2000c366afe21e221c0b5af4ebb6a7769524a04e 100644 (file)
@@ -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;
 
index 8ac2e1a585a28ffff805a49e9aee15dd967f3a04..5507fac47d8972f23489dda7ee3a5565947a699d 100644 (file)
@@ -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 */
index ea05c098f9c1aa05a9b973acb6f3d856d2457aba..39dcc4d28da8a7611a7454db18389c5043d526d0 100644 (file)
@@ -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 )
             {