diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-06-05 11:07:17 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-06-05 11:07:17 +0000 |
commit | c6dffa0538819d2995d105e63b445359faa340d0 (patch) | |
tree | d5b7f4fe0285fb7b501d6baa0cfd1b9253f73522 /gst/interleave/interleave.c | |
parent | 15e11ff303990f160fd084e0432e738ddf500918 (diff) | |
download | gst-plugins-bad-c6dffa0538819d2995d105e63b445359faa340d0.tar.gz gst-plugins-bad-c6dffa0538819d2995d105e63b445359faa340d0.tar.bz2 gst-plugins-bad-c6dffa0538819d2995d105e63b445359faa340d0.zip |
gst/interleave/: Properly implement duration and position queries in bytes format. We have to take the upstream reply...
Original commit message from CVS:
* gst/interleave/deinterleave.c: (gst_deinterleave_add_new_pads),
(gst_deinterleave_src_query):
* gst/interleave/interleave.c: (gst_interleave_src_query_duration),
(gst_interleave_src_query):
Properly implement duration and position queries in bytes format. We
have to take the upstream reply and divide/multiply it by the number
of channels to get the correct result.
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; |