summaryrefslogtreecommitdiff
path: root/ext/smoothstreaming
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2014-12-04 12:21:04 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2014-12-04 14:28:25 -0300
commita105af22f2f1d7325137b318e1e2070ce2d5bfa1 (patch)
tree0644cc6cdf6bc166aa9c1e914ca9fa461574fd11 /ext/smoothstreaming
parenta2c31e38d14bde826af9d3cd45c0664fb57c163b (diff)
mssdemux: fix getting current position in segments when after last one
For live streams this makes a difference when resyncing after a Manifest refresh, otherwise it doesn't know where to restart
Diffstat (limited to 'ext/smoothstreaming')
-rw-r--r--ext/smoothstreaming/gstmssmanifest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
index 029873125..26958ebb1 100644
--- a/ext/smoothstreaming/gstmssmanifest.c
+++ b/ext/smoothstreaming/gstmssmanifest.c
@@ -855,8 +855,14 @@ gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream)
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
- if (!stream->current_fragment)
- return GST_CLOCK_TIME_NONE;
+ if (!stream->current_fragment) {
+ GList *last = g_list_last (stream->fragments);
+ if (last == NULL)
+ return GST_CLOCK_TIME_NONE;
+
+ fragment = last->data;
+ return fragment->time + (fragment->duration * fragment->repetitions);
+ }
fragment = stream->current_fragment->data;