+2004-06-24 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * ext/vorbis/vorbisenc.c: (raw_caps_factory),
+ (gst_vorbisenc_setup), (gst_vorbisenc_set_property):
+ respect minimum bitrate; same could be done for max bitrate
+
2004-06-24 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/vorbis/vorbisenc.c: (raw_caps_factory),
#define BITRATE_DEFAULT -1
#define MIN_BITRATE_DEFAULT -1
#define QUALITY_DEFAULT 0.3
+#define LOWEST_BITRATE 8000 /* lowest allowed for a 8 kHz stream */
static void gst_vorbisenc_base_init (gpointer g_class);
static void gst_vorbisenc_class_init (VorbisEncClass * klass);
gboolean old_value = vorbisenc->managed;
vorbisenc->max_bitrate = g_value_get_int (value);
+ if (vorbisenc->max_bitrate >= 0
+ && vorbisenc->max_bitrate < LOWEST_BITRATE) {
+ g_warning ("Lowest allowed bitrate is %d", LOWEST_BITRATE);
+ vorbisenc->max_bitrate = LOWEST_BITRATE;
+ }
if (vorbisenc->min_bitrate > 0 && vorbisenc->max_bitrate > 0)
vorbisenc->managed = TRUE;
else
}
case ARG_BITRATE:
vorbisenc->bitrate = g_value_get_int (value);
+ if (vorbisenc->bitrate >= 0 && vorbisenc->bitrate < LOWEST_BITRATE) {
+ g_warning ("Lowest allowed bitrate is %d", LOWEST_BITRATE);
+ vorbisenc->bitrate = LOWEST_BITRATE;
+ }
break;
case ARG_MIN_BITRATE:
{
gboolean old_value = vorbisenc->managed;
vorbisenc->min_bitrate = g_value_get_int (value);
+ if (vorbisenc->min_bitrate >= 0
+ && vorbisenc->min_bitrate < LOWEST_BITRATE) {
+ g_warning ("Lowest allowed bitrate is %d", LOWEST_BITRATE);
+ vorbisenc->min_bitrate = LOWEST_BITRATE;
+ }
if (vorbisenc->min_bitrate > 0 && vorbisenc->max_bitrate > 0)
vorbisenc->managed = TRUE;
else