mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 04:41:16 +00:00
ext/lame/gstlame.*: Fix the case where you initially have stereo input, and so lame's mode is not set to mono, and th...
Original commit message from CVS: * ext/lame/gstlame.c: * ext/lame/gstlame.h: Fix the case where you initially have stereo input, and so lame's mode is not set to mono, and then you get input with mono audio and soon after you get stereo input again. What happened before this commit is that it would keep the encoding mode as mono. It should change it back to the one requested by the app (or the default one) if not requested.
This commit is contained in:
parent
9d87e1468b
commit
b1a031b960
2 changed files with 7 additions and 3 deletions
|
@ -624,6 +624,7 @@ gst_lame_init (GstLame * lame)
|
||||||
lame->quality = 5; /* lame_get_quality (lame->lgf);
|
lame->quality = 5; /* lame_get_quality (lame->lgf);
|
||||||
* => -1/out of range */
|
* => -1/out of range */
|
||||||
lame->mode = lame_get_mode (lame->lgf);
|
lame->mode = lame_get_mode (lame->lgf);
|
||||||
|
lame->requested_mode = lame->mode;
|
||||||
lame->force_ms = lame_get_force_ms (lame->lgf);
|
lame->force_ms = lame_get_force_ms (lame->lgf);
|
||||||
lame->free_format = lame_get_free_format (lame->lgf);
|
lame->free_format = lame_get_free_format (lame->lgf);
|
||||||
lame->copyright = lame_get_copyright (lame->lgf);
|
lame->copyright = lame_get_copyright (lame->lgf);
|
||||||
|
@ -741,7 +742,7 @@ gst_lame_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
lame->quality = g_value_get_enum (value);
|
lame->quality = g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
case ARG_MODE:
|
case ARG_MODE:
|
||||||
lame->mode = g_value_get_enum (value);
|
lame->requested_mode = g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
case ARG_FORCE_MS:
|
case ARG_FORCE_MS:
|
||||||
lame->force_ms = g_value_get_boolean (value);
|
lame->force_ms = g_value_get_boolean (value);
|
||||||
|
@ -856,7 +857,7 @@ gst_lame_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
g_value_set_enum (value, lame->quality);
|
g_value_set_enum (value, lame->quality);
|
||||||
break;
|
break;
|
||||||
case ARG_MODE:
|
case ARG_MODE:
|
||||||
g_value_set_enum (value, lame->mode);
|
g_value_set_enum (value, lame->requested_mode);
|
||||||
break;
|
break;
|
||||||
case ARG_FORCE_MS:
|
case ARG_FORCE_MS:
|
||||||
g_value_set_boolean (value, lame->force_ms);
|
g_value_set_boolean (value, lame->force_ms);
|
||||||
|
@ -1207,6 +1208,8 @@ gst_lame_setup (GstLame * lame)
|
||||||
/* force mono encoding if we only have one channel */
|
/* force mono encoding if we only have one channel */
|
||||||
if (lame->num_channels == 1)
|
if (lame->num_channels == 1)
|
||||||
lame->mode = 3;
|
lame->mode = 3;
|
||||||
|
else
|
||||||
|
lame->mode = lame->requested_mode;
|
||||||
|
|
||||||
CHECK_ERROR (lame_set_num_channels (lame->lgf, lame->num_channels));
|
CHECK_ERROR (lame_set_num_channels (lame->lgf, lame->num_channels));
|
||||||
CHECK_AND_FIXUP_BITRATE (lame, "bitrate", lame->bitrate, lame->free_format);
|
CHECK_AND_FIXUP_BITRATE (lame, "bitrate", lame->bitrate, lame->free_format);
|
||||||
|
|
|
@ -62,7 +62,8 @@ struct _GstLame {
|
||||||
gint bitrate;
|
gint bitrate;
|
||||||
gfloat compression_ratio;
|
gfloat compression_ratio;
|
||||||
gint quality;
|
gint quality;
|
||||||
gint mode;
|
gint mode; /* actual mode in use now */
|
||||||
|
gint requested_mode; /* requested mode by user/app */
|
||||||
gboolean force_ms;
|
gboolean force_ms;
|
||||||
gboolean free_format;
|
gboolean free_format;
|
||||||
gboolean copyright;
|
gboolean copyright;
|
||||||
|
|
Loading…
Reference in a new issue