Bug 144192 - k3b uses 128kbps instead of selected preset while ripping to mp3
Summary: k3b uses 128kbps instead of selected preset while ripping to mp3
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Slackware Packages Linux
: NOR normal with 20 votes (vote)
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-13 21:11 UTC by Klotz
Modified: 2007-04-14 09:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klotz 2007-04-13 21:11:49 UTC
Version:           1.0 (using KDE KDE 3.5.4)
Installed from:    Slackware Packages
Compiler:          gcc 3.4.6 
OS:                Linux

when I want to rip a song to mp3, k3b always encodes it to 128kbps instead to preset selected in the MPEG1 Layer III (mp3) dialog
Comment 1 Sebastian Trueg 2007-04-14 09:58:46 UTC
SVN commit 653778 by trueg:

Set the lame encoding to VBR/ABR when choosing a quality level.

BUG: 144192


 M  +16 -8     k3blameencoder.cpp  


--- trunk/extragear/multimedia/k3b/plugins/encoder/lame/k3blameencoder.cpp #653777:653778
@@ -1,4 +1,4 @@
-/* 
+/*
  *
  * $Id$
  * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
@@ -240,13 +240,13 @@
     if( c->readBoolEntry( "VBR", false ) ) {
       // we use the default algorithm here
       lame_set_VBR( d->flags, vbr_default );
-      
+
       if( c->readBoolEntry( "Use Maximum Bitrate", false ) ) {
 	lame_set_VBR_max_bitrate_kbps( d->flags, c->readNumEntry( "Maximum Bitrate", 224 ) );
       }
       if( c->readBoolEntry( "Use Minimum Bitrate", false ) ) {
 	lame_set_VBR_min_bitrate_kbps( d->flags, c->readNumEntry( "Minimum Bitrate", 32 ) );
-	
+
 	// TODO: lame_set_hard_min
       }
       if( c->readBoolEntry( "Use Average Bitrate", true ) ) {
@@ -272,7 +272,15 @@
     int q = c->readNumEntry( "Quality Level", 5 );
     if( q < 0 ) q = 0;
     if( q > 9 ) q = 9;
-    
+
+    kdDebug() << "(K3bLameEncoder) setting preset encoding value to " << q << endl;
+
+    if ( q < 2 || q > 8 ) {
+        lame_set_VBR( d->flags, vbr_abr );
+    }
+    else {
+        lame_set_VBR( d->flags, vbr_default );
+    }
     lame_set_preset( d->flags, s_lame_presets[q] );
 
     if( q < 2 )
@@ -282,7 +290,7 @@
 
   //
   // file options
-  //  
+  //
   lame_set_copyright( d->flags, c->readBoolEntry( "Copyright", false ) );
   lame_set_original( d->flags, c->readBoolEntry( "Original", true ) );
   lame_set_strict_ISO( d->flags, c->readBoolEntry( "ISO compliance", false ) );
@@ -588,8 +596,8 @@
       if( c->readBoolEntry( "Use Maximum Bitrate", false ) )
 	bitrate = c->readNumEntry( "Maximum Bitrate", 224 );
       if( c->readBoolEntry( "Use Minimum Bitrate", false ) )
-	bitrate = ( bitrate > 0 
-		    ? (bitrate - c->readNumEntry( "Minimum Bitrate", 32 )) / 2 
+	bitrate = ( bitrate > 0
+		    ? (bitrate - c->readNumEntry( "Minimum Bitrate", 32 )) / 2
 		    : c->readNumEntry( "Minimum Bitrate", 32 ) );
       if( c->readBoolEntry( "Use Average Bitrate", true ) )
 	bitrate = c->readNumEntry( "Average Bitrate", 128 );
@@ -609,7 +617,7 @@
 }
 
 
-K3bPluginConfigWidget* K3bLameEncoder::createConfigWidget( QWidget* parent, 
+K3bPluginConfigWidget* K3bLameEncoder::createConfigWidget( QWidget* parent,
 							   const char* name ) const
 {
   return new K3bLameEncoderSettingsWidget( parent, name );