OSDN Git Service

libhb: Disable managed mode for Vorbis ABR.
authorsaintdev <saintdev@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 26 Jan 2011 09:50:05 +0000 (09:50 +0000)
committersaintdev <saintdev@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 26 Jan 2011 09:50:05 +0000 (09:50 +0000)
Disable managed mode for Vorbis encoding. According to libvorbis docs this means
that although the bitrate is specified explicitly (instead of setting a quality
level), we get VBR encoding and the bitrate is only taken as a loose target.

Patch by Hagen

git-svn-id: svn://localhost/HandBrake/trunk@3768 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/encvorbis.c

index f483a09..609e45f 100644 (file)
@@ -47,7 +47,6 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job )
     hb_audio_t * audio = w->audio;
     int i;
     ogg_packet header[3];
-    struct ovectl_ratemanage2_arg  ctl_rate_arg;
 
     hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) );
     w->private_data = pv;
@@ -83,15 +82,7 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job )
         return 0;
     }
 
-    if( vorbis_encode_ctl( &pv->vi, OV_ECTL_RATEMANAGE2_GET, &ctl_rate_arg) )
-    {
-        hb_log( "encvorbis: vorbis_encode_ctl( ratemanage2_get ) failed" );
-    }
-
-    ctl_rate_arg.bitrate_average_kbps = audio->config.out.bitrate;
-    ctl_rate_arg.management_active = 1;
-
-    if( vorbis_encode_ctl( &pv->vi, OV_ECTL_RATEMANAGE2_SET, &ctl_rate_arg ) ||
+    if( vorbis_encode_ctl( &pv->vi, OV_ECTL_RATEMANAGE2_SET, NULL ) ||
           vorbis_encode_setup_init( &pv->vi ) )
     {
         hb_error( "encvorbis: vorbis_encode_ctl( ratemanage2_set ) OR vorbis_encode_setup_init failed.\n" );