faac: improve faac configuration
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 12 Jan 2010 18:33:37 +0000 (19:33 +0100)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 12 Jan 2010 18:46:01 +0000 (19:46 +0100)
In particular, align configuration some more with reference binary faac.

Fixes #606726.

ext/faac/gstfaac.c

index 85b8513..40b5256 100644 (file)
@@ -491,9 +491,19 @@ gst_faac_configure_source_pad (GstFaac * faac)
     conf->bitRate = maxbitrate;
   }
 
+  /* default 0 to start with, libfaac chooses based on bitrate */
+  conf->bandWidth = 0;
+
   if (!faacEncSetConfiguration (faac->handle, conf))
     goto set_failed;
 
+  /* let's see what really happened,
+   * note that this may not really match desired rate */
+  GST_DEBUG_OBJECT (faac, "average bitrate: %d kbps",
+      (conf->bitRate + 500) / 1000 * faac->channels);
+  GST_DEBUG_OBJECT (faac, "quantization quality: %ld", conf->quantqual);
+  GST_DEBUG_OBJECT (faac, "bandwidth: %d Hz", conf->bandWidth);
+
   /* now create a caps for it all */
   srccaps = gst_caps_new_simple ("audio/mpeg",
       "mpegversion", G_TYPE_INT, mpegversion,