summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-01-28 14:02:15 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-01-28 15:20:58 -0300
commit9a9d4ecceabd0de3632f588ce5d89d7ba78b5490 (patch)
tree0d46c4039ad7b1677b342372b55e809e9cd1c59e
parent5ff1229754ed2970efca4a4c0c352e99e6102070 (diff)
qtdemux: simplify segment.base math
Remove a fix for heavily edited files added for fixing https://bugzilla.gnome.org/show_bug.cgi?id=345830 to work with seeks and proper gaps playback. The fix was replaced for a more general solution that bases on using previous segment's duration, just like it works for media segments playback. https://bugzilla.gnome.org/show_bug.cgi?id=743518
-rw-r--r--gst/isomp4/qtdemux.c6
-rw-r--r--gst/isomp4/qtdemux.h3
2 files changed, 1 insertions, 8 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 32ab27384..7e20428e7 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -1425,7 +1425,6 @@ gst_qtdemux_perform_seek (GstQTDemux * qtdemux, GstSegment * segment,
}
segment->position = desired_offset;
segment->time = desired_offset;
- qtdemux->segment_base = desired_offset;
/* we stop at the end */
if (segment->stop == -1)
@@ -1874,7 +1873,6 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
qtdemux->offset = 0;
gst_adapter_clear (qtdemux->adapter);
gst_segment_init (&qtdemux->segment, GST_FORMAT_TIME);
- qtdemux->segment_base = 0;
if (hard) {
for (n = 0; n < qtdemux->n_streams; n++) {
@@ -3640,6 +3638,7 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
if (G_UNLIKELY (QTSEGMENT_IS_EMPTY (segment))) {
start = segment->time + seg_time;
time = offset;
+ stop = start - seg_time + segment->duration;
} else if (qtdemux->segment.rate >= 0) {
start = MIN (segment->media_start + seg_time, stop);
time = offset;
@@ -3674,9 +3673,6 @@ gst_qtdemux_activate_segment (GstQTDemux * qtdemux, QtDemuxStream * stream,
stream->segment.stop = stop;
stream->segment.time = time;
stream->segment.position = start;
- stream->segment.base =
- segment->time >
- qtdemux->segment_base ? segment->time - qtdemux->segment_base : 0;
/* now prepare and send the segment */
if (stream->pad) {
diff --git a/gst/isomp4/qtdemux.h b/gst/isomp4/qtdemux.h
index 99ba47d58..22469b898 100644
--- a/gst/isomp4/qtdemux.h
+++ b/gst/isomp4/qtdemux.h
@@ -123,9 +123,6 @@ struct _GstQTDemux {
gint64 seek_offset;
gint64 push_seek_start;
gint64 push_seek_stop;
- guint64 segment_base; /* The offset from which playback was started, needs to
- * be subtracted from GstSegment.base to get a correct
- * running time whenever a new QtSegment is activated */
#if 0
/* gst index support */