audiopanorama: fix get_unit_size
This commit is contained in:
parent
d18a578ba4
commit
7dba29cbd3
@ -301,20 +301,19 @@ static gboolean
|
|||||||
gst_audio_panorama_get_unit_size (GstBaseTransform * base, GstCaps * caps,
|
gst_audio_panorama_get_unit_size (GstBaseTransform * base, GstCaps * caps,
|
||||||
gsize * size)
|
gsize * size)
|
||||||
{
|
{
|
||||||
|
GstAudioInfo info;
|
||||||
gint width, channels;
|
gint width, channels;
|
||||||
GstStructure *structure;
|
|
||||||
gboolean ret;
|
|
||||||
|
|
||||||
g_assert (size);
|
g_assert (size);
|
||||||
|
|
||||||
/* this works for both float and int */
|
if (!gst_audio_info_from_caps (&info, caps))
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
return FALSE;
|
||||||
ret = gst_structure_get_int (structure, "width", &width);
|
|
||||||
ret &= gst_structure_get_int (structure, "channels", &channels);
|
|
||||||
|
|
||||||
|
width = GST_AUDIO_INFO_WIDTH (&info);
|
||||||
|
channels = GST_AUDIO_INFO_CHANNELS (&info);
|
||||||
*size = width * channels / 8;
|
*size = width * channels / 8;
|
||||||
|
|
||||||
return ret;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user