]> granicus.if.org Git - handbrake/commitdiff
saintdev's fix to correctly allocate bitrate for non-stereo audio
authordynaflash <dynaflashtech@gmail.com>
Sat, 24 Mar 2007 15:04:29 +0000 (15:04 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Sat, 24 Mar 2007 15:04:29 +0000 (15:04 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@447 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/encfaac.c
test/test.c

index 3cbe48f247af84ff08e62e0dba549e1224771727..84e1fcbaf24a10e0b7a83401a40853b2a165d529 100644 (file)
@@ -74,7 +74,7 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
        }
 
     cfg->useTns        = 0;
-    cfg->bitRate       = job->abitrate * 500; /* Per channel */
+    cfg->bitRate       = job->abitrate * 1000 / w->config->aac.channelsused; /* Per channel */
     cfg->bandWidth     = 0;
     cfg->outputFormat  = 0;
     cfg->inputFormat   =  FAAC_INPUT_FLOAT;
index 38e58a23dfd348e5f6f8ea65e270e374eb13fc01..bc6b51ab04cc5180216be2280fdf37c40bc7d966 100644 (file)
@@ -963,7 +963,14 @@ static int CheckOptions( int argc, char ** argv )
                {
                        /* only attempt 5.1 export if exporting to AAC */
                        surround = 0;
-               }
+               } else {
+                   if (!abitrate && surround)
+                   {
+                       /* If we don't get a audio bitrate on the command line, and
+                          surround is being used, default to 384 */
+                       abitrate = 384;
+               }
+        }
                
     }