summaryrefslogtreecommitdiffstats
path: root/gst/rtsp
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-11-11 15:16:31 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-11-11 15:16:31 +0000
commit8a2bcfecb005d3caf8c69798dd377f2c781607f7 (patch)
tree37a68e5c7a4ba0bb2e7a489335c20959718e0e87 /gst/rtsp
parent320e96a27c5328998c8cf712bec9b6a142d92d6d (diff)
gst/rtsp/gstrtspsrc.c: Only pause/play in the seek handler when the source was playing.
Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_do_seek), (gst_rtspsrc_perform_seek): Only pause/play in the seek handler when the source was playing. Fixes #529379.
Diffstat (limited to 'gst/rtsp')
-rw-r--r--gst/rtsp/gstrtspsrc.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index ae50606e..dc55aa1f 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -1233,15 +1233,11 @@ gst_rtspsrc_connection_receive (GstRTSPSrc * src, GstRTSPMessage * message,
static gboolean
gst_rtspsrc_do_seek (GstRTSPSrc * src, GstSegment * segment)
{
- gboolean res;
-
src->state = GST_RTSP_STATE_SEEKING;
/* PLAY will add the range header now. */
src->need_range = TRUE;
- res = gst_rtspsrc_play (src, segment);
-
- return res;
+ return TRUE;
}
static gboolean
@@ -1255,6 +1251,7 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
gint64 cur, stop;
gboolean flush;
gboolean update;
+ gboolean playing;
GstSegment seeksegment = { 0, };
if (event) {
@@ -1321,10 +1318,18 @@ gst_rtspsrc_perform_seek (GstRTSPSrc * src, GstEvent * event)
if ((stop = seeksegment.stop) == -1)
stop = seeksegment.duration;
- gst_rtspsrc_pause (src);
+ playing = (src->state == GST_RTSP_STATE_PLAYING);
+
+ /* if we were playing, pause first */
+ if (playing)
+ gst_rtspsrc_pause (src);
res = gst_rtspsrc_do_seek (src, &seeksegment);
+ /* and continue playing */
+ if (playing)
+ res = gst_rtspsrc_play (src, &seeksegment);
+
/* prepare for streaming again */
if (flush) {
/* if we started flush, we stop now */