diff options
Diffstat (limited to 'gst/interleave/interleave.c')
-rw-r--r-- | gst/interleave/interleave.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/interleave/interleave.c b/gst/interleave/interleave.c index 32c50ccc..76843e45 100644 --- a/gst/interleave/interleave.c +++ b/gst/interleave/interleave.c @@ -974,6 +974,11 @@ gst_interleave_src_query_duration (GstInterleave * self, GstQuery * query) gst_iterator_free (it); if (res) { + /* If in bytes format we have to multiply with the number of channels + * to get the correct results. All other formats should be fine */ + if (format == GST_FORMAT_BYTES && max != -1) + max *= self->channels; + /* and store the max */ GST_DEBUG_OBJECT (self, "Total duration in format %s: %" GST_TIME_FORMAT, gst_format_get_name (format), GST_TIME_ARGS (max)); @@ -1095,6 +1100,11 @@ gst_interleave_src_query (GstPad * pad, GstQuery * query) gst_query_set_position (query, format, self->timestamp); res = TRUE; break; + case GST_FORMAT_BYTES: + gst_query_set_position (query, format, + self->offset * self->channels * self->width); + res = TRUE; + break; case GST_FORMAT_DEFAULT: gst_query_set_position (query, format, self->offset); res = TRUE; |