ext/faac/gstfaac.c: Warn and clamp to max bitrate for samplerate.
Original commit message from CVS: * ext/faac/gstfaac.c: (gst_faac_configure_source_pad): Warn and clamp to max bitrate for samplerate. Fixes #550486.
This commit is contained in:
parent
67030c152b
commit
db433443c9
@ -1,3 +1,9 @@
|
|||||||
|
2008-10-03 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* ext/faac/gstfaac.c: (gst_faac_configure_source_pad):
|
||||||
|
Warn and clamp to max bitrate for samplerate.
|
||||||
|
Fixes #550486.
|
||||||
|
|
||||||
2008-10-03 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
2008-10-03 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||||
|
|
||||||
* gst/mpegtsparse/mpegtsparse.c:
|
* gst/mpegtsparse/mpegtsparse.c:
|
||||||
|
@ -356,6 +356,7 @@ gst_faac_configure_source_pad (GstFaac * faac)
|
|||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
gint n, ver, mpegversion;
|
gint n, ver, mpegversion;
|
||||||
faacEncConfiguration *conf;
|
faacEncConfiguration *conf;
|
||||||
|
guint maxbitrate;
|
||||||
|
|
||||||
mpegversion = FAAC_DEFAULT_MPEGVERSION;
|
mpegversion = FAAC_DEFAULT_MPEGVERSION;
|
||||||
|
|
||||||
@ -392,6 +393,20 @@ gst_faac_configure_source_pad (GstFaac * faac)
|
|||||||
conf->inputFormat = faac->format;
|
conf->inputFormat = faac->format;
|
||||||
conf->outputFormat = faac->outputformat;
|
conf->outputFormat = faac->outputformat;
|
||||||
conf->shortctl = faac->shortctl;
|
conf->shortctl = faac->shortctl;
|
||||||
|
|
||||||
|
/* check, warn and correct if the max bitrate for the given samplerate is
|
||||||
|
* exceeded. Maximum of 6144 bit for a channel */
|
||||||
|
maxbitrate =
|
||||||
|
(unsigned int) (6144.0 * (double) faac->samplerate / (double) 1024.0 +
|
||||||
|
.5);
|
||||||
|
if (conf->bitRate > maxbitrate) {
|
||||||
|
GST_ELEMENT_WARNING (faac, RESOURCE, SETTINGS, (NULL),
|
||||||
|
("bitrate %u exceeds maximum allowed bitrate of %u for samplerate %d. "
|
||||||
|
"Setting bitrate to %u", conf->bitRate, maxbitrate,
|
||||||
|
faac->samplerate, maxbitrate));
|
||||||
|
conf->bitRate = maxbitrate;
|
||||||
|
}
|
||||||
|
|
||||||
if (!faacEncSetConfiguration (faac->handle, conf))
|
if (!faacEncSetConfiguration (faac->handle, conf))
|
||||||
goto set_failed;
|
goto set_failed;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user