summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2015-09-03 15:11:00 +0200
committerTim-Philipp Müller <tim@centricular.com>2015-09-30 10:06:18 +0100
commit5ee804e297e075cc2114d4eadbc891abbb7188f6 (patch)
tree757ac26c2521d724fdec6c4fad5e5474a6661788
parenta81ee2c60b4de800dd8f2f8d278cc0a44e2917ff (diff)
downloadgstreamer-plugins-bad-5ee804e297e075cc2114d4eadbc891abbb7188f6.tar.gz
mssdemux: always use timescale for gst timestamp calculation
Not doing this can lead the demuxer to attempt downloading fragments for an invalid start time. The server would then send a HTTP Precondition failed error, the demuxer would try some more times to download the invalid fragment and eventually error out. https://bugzilla.gnome.org/show_bug.cgi?id=754523
-rw-r--r--ext/smoothstreaming/gstmssmanifest.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
index e92e3da4c..6559c2ec7 100644
--- a/ext/smoothstreaming/gstmssmanifest.c
+++ b/ext/smoothstreaming/gstmssmanifest.c
@@ -904,7 +904,7 @@ gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream)
guint64 timescale;
GstMssStreamFragment *fragment;
- g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
+ g_return_val_if_fail (stream->active, GST_CLOCK_TIME_NONE);
if (!stream->current_fragment) {
GList *last = g_list_last (stream->fragments);
@@ -912,13 +912,12 @@ gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream)
return GST_CLOCK_TIME_NONE;
fragment = last->data;
- return fragment->time + (fragment->duration * fragment->repetitions);
+ time = fragment->time + (fragment->duration * fragment->repetitions);
+ } else {
+ fragment = stream->current_fragment->data;
+ time = fragment->time + (fragment->duration * stream->fragment_repetition_index);
}
- fragment = stream->current_fragment->data;
-
- time =
- fragment->time + (fragment->duration * stream->fragment_repetition_index);
timescale = gst_mss_stream_get_timescale (stream);
return (GstClockTime) gst_util_uint64_scale_round (time, GST_SECOND,
timescale);