summaryrefslogtreecommitdiffstats
path: root/gst/speed
diff options
context:
space:
mode:
Diffstat (limited to 'gst/speed')
-rw-r--r--gst/speed/demo-mp3.c2
-rw-r--r--gst/speed/gstspeed.c21
2 files changed, 15 insertions, 8 deletions
diff --git a/gst/speed/demo-mp3.c b/gst/speed/demo-mp3.c
index d2144cf3..f26acff2 100644
--- a/gst/speed/demo-mp3.c
+++ b/gst/speed/demo-mp3.c
@@ -39,7 +39,7 @@ static gboolean
time_tick_cb (GstElement * audiosink)
{
GstFormat format = GST_FORMAT_TIME;
- guint64 total, pos;
+ gint64 total, pos;
if (gst_element_query (audiosink, GST_QUERY_TOTAL, &format, &total)
&& gst_element_query (audiosink, GST_QUERY_POSITION, &format, &pos)) {
diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c
index edb23be9..0d26ad71 100644
--- a/gst/speed/gstspeed.c
+++ b/gst/speed/gstspeed.c
@@ -116,7 +116,7 @@ speed_parse_caps (GstSpeed * filter, const GstCaps * caps)
{
const gchar *mimetype;
GstStructure *structure;
- gboolean ret;
+ gint rate, chans, width, buffer_frames;
g_return_val_if_fail (filter != NULL, FALSE);
g_return_val_if_fail (caps != NULL, FALSE);
@@ -131,12 +131,19 @@ speed_parse_caps (GstSpeed * filter, const GstCaps * caps)
else
return FALSE;
- ret = gst_structure_get_int (structure, "rate", &filter->rate);
- ret &= gst_structure_get_int (structure, "channels", &filter->channels);
- ret &= gst_structure_get_int (structure, "width", &filter->width);
+ if (!gst_structure_get_int (structure, "rate", &rate)
+ || !gst_structure_get_int (structure, "width", &width)
+ || !gst_structure_get_int (structure, "channels", &chans))
+ return FALSE;
+
+ filter->rate = rate;
+ filter->width = width;
+ filter->channels = chans;
- filter->buffer_frames = 0;
- gst_structure_get_int (structure, "buffer-frames", &filter->buffer_frames);
+ if (gst_structure_get_int (structure, "buffer-frames", &buffer_frames))
+ filter->buffer_frames = buffer_frames;
+ else
+ filter->buffer_frames = 0;
if (filter->format == GST_SPEED_FORMAT_FLOAT) {
filter->sample_size = filter->channels * filter->width / 8;
@@ -145,7 +152,7 @@ speed_parse_caps (GstSpeed * filter, const GstCaps * caps)
filter->sample_size = filter->channels * filter->width / 8;
}
- return ret;
+ return TRUE;
}
GType