diff options
author | Alessandro Decina <alessandro.d@gmail.com> | 2012-12-01 17:05:38 +0100 |
---|---|---|
committer | Alessandro Decina <alessandro.d@gmail.com> | 2012-12-01 17:11:43 +0100 |
commit | 62879bdd38ee824230e6bc403e6805550cf5b870 (patch) | |
tree | e97ced77957fafb3df353ef3c68be9462b0137be /ext/rtmp | |
parent | caa9014bceffa8154de1692c62ba3c99cbc04d62 (diff) | |
download | gstreamer-plugins-bad-62879bdd38ee824230e6bc403e6805550cf5b870.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")
Diffstat (limited to 'ext/rtmp')
-rw-r--r-- | ext/rtmp/gstrtmpsrc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c index 9137cec4e..8adf4e79c 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)) { |