Commit 95130695 authored by Robin Stocker's avatar Robin Stocker Committed by Wim Taymans
Browse files

gst/mpegdemux/gstmpegdemux.c: Converting from time to bytes operates on the...

gst/mpegdemux/gstmpegdemux.c: Converting from time to bytes operates on the stream_time, not the SCR timeline.

Original commit message from CVS:
Patch by: Robin Stocker <robin at nibor dot org>
* gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_src_query):
Converting from time to bytes operates on the stream_time, not the SCR
timeline.
The position reporting should happen in stream_time, not the segment
timestamp range. See #557161.
parent f1814feb
2008-12-29 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Robin Stocker <robin at nibor dot org>
* gst/mpegdemux/gstmpegdemux.c: (gst_flups_demux_src_query):
Converting from time to bytes operates on the stream_time, not the SCR
timeline.
The position reporting should happen in stream_time, not the segment
timestamp range. See #557161.
2008-12-29 Wim Taymans <wim.taymans@collabora.co.uk> 2008-12-29 Wim Taymans <wim.taymans@collabora.co.uk>
* gst-libs/gst/app/gstappsrc.c: (gst_app_src_class_init), * gst-libs/gst/app/gstappsrc.c: (gst_app_src_class_init),
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
/* We clamp scr delta with 0 so negative bytes won't be possible */ /* We clamp scr delta with 0 so negative bytes won't be possible */
#define GSTTIME_TO_BYTES(time) \ #define GSTTIME_TO_BYTES(time) \
((time != -1) ? gst_util_uint64_scale (MAX(0,(gint64) (GSTTIME_TO_MPEGTIME(time) - demux->first_scr)), demux->scr_rate_n, demux->scr_rate_d) : -1) ((time != -1) ? gst_util_uint64_scale (MAX(0,(gint64) (GSTTIME_TO_MPEGTIME(time))), demux->scr_rate_n, demux->scr_rate_d) : -1)
#define BYTES_TO_GSTTIME(bytes) ((bytes != -1) ? MPEGTIME_TO_GSTTIME(gst_util_uint64_scale (bytes, demux->scr_rate_d, demux->scr_rate_n)) : -1) #define BYTES_TO_GSTTIME(bytes) ((bytes != -1) ? MPEGTIME_TO_GSTTIME(gst_util_uint64_scale (bytes, demux->scr_rate_d, demux->scr_rate_n)) : -1)
#define ADAPTER_OFFSET_FLUSH(_bytes_) demux->adapter_offset += (_bytes_) #define ADAPTER_OFFSET_FLUSH(_bytes_) demux->adapter_offset += (_bytes_)
...@@ -895,8 +895,7 @@ gst_flups_demux_src_query (GstPad * pad, GstQuery * query) ...@@ -895,8 +895,7 @@ gst_flups_demux_src_query (GstPad * pad, GstQuery * query)
goto not_supported; goto not_supported;
} }
position = demux->base_time + position = MPEGTIME_TO_GSTTIME (demux->current_scr - demux->first_scr);
MPEGTIME_TO_GSTTIME (demux->current_scr - demux->first_scr);
GST_LOG_OBJECT (demux, "Position at GStreamer Time:%" GST_TIME_FORMAT, GST_LOG_OBJECT (demux, "Position at GStreamer Time:%" GST_TIME_FORMAT,
GST_TIME_ARGS (position)); GST_TIME_ARGS (position));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment