summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2012-12-01 17:05:38 +0100
committerTim-Philipp Müller <tim@centricular.net>2012-12-10 14:48:28 +0000
commit3a8d38db74f646e54810e799a381d99458724ebe (patch)
tree059c613bc58474fc522542beb43921b9b12e610f
parent811f13282fc7175035c53da5cdbb1ca8464df34f (diff)
downloadgstreamer-plugins-bad-3a8d38db74f646e54810e799a381d99458724ebe.tar.gz
rtmpsrc: disable seeking if the configured url specifies live=true
Disable seeking when live=true is set in the location URL (eg: "rtmp://example.net/stream live=true")
-rw-r--r--ext/rtmp/gstrtmpsrc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c
index c1a5845a7..477ea6395 100644
--- a/ext/rtmp/gstrtmpsrc.c
+++ b/ext/rtmp/gstrtmpsrc.c
@@ -503,11 +503,6 @@ gst_rtmp_src_do_seek (GstBaseSrc * basesrc, GstSegment * segment)
return FALSE;
}
- if (!src->seekable) {
- GST_LOG_OBJECT (src, "Not a seekable stream");
- return FALSE;
- }
-
if (!src->rtmp) {
GST_LOG_OBJECT (src, "Not connected yet");
return FALSE;
@@ -519,6 +514,11 @@ gst_rtmp_src_do_seek (GstBaseSrc * basesrc, GstSegment * segment)
if (src->cur_offset == 0 && segment->start == 0)
return TRUE;
+ if (!src->seekable) {
+ GST_LOG_OBJECT (src, "Not a seekable stream");
+ return FALSE;
+ }
+
src->last_timestamp = GST_CLOCK_TIME_NONE;
if (!RTMP_SendSeek (src->rtmp, segment->start / GST_MSECOND)) {
GST_ERROR_OBJECT (src, "Seeking failed");
@@ -553,7 +553,6 @@ gst_rtmp_src_start (GstBaseSrc * basesrc)
src->cur_offset = 0;
src->last_timestamp = 0;
- src->seekable = TRUE;
src->discont = TRUE;
uri_copy = g_strdup (src->uri);
@@ -567,6 +566,8 @@ gst_rtmp_src_start (GstBaseSrc * basesrc)
src->rtmp = NULL;
return FALSE;
}
+ src->seekable = !(src->rtmp->Link.lFlags & RTMP_LF_LIVE);
+ GST_INFO_OBJECT (src, "seekable %d", src->seekable);
/* open if required */
if (!RTMP_IsConnected (src->rtmp)) {