media: update range when active clients changed

When we changed the number of active clients, update the current range
information because we want the second client connecting to a shared resource
continue from where the stream currently.
This commit is contained in:
Wim Taymans 2010-12-12 15:48:47 +01:00 committed by Wim Taymans
parent d99a448f79
commit ca76a73ca0

View file

@ -341,7 +341,7 @@ collect_media_stats (GstRTSPMedia * media)
GST_INFO ("stats: position %" GST_TIME_FORMAT ", duration %" GST_INFO ("stats: position %" GST_TIME_FORMAT ", duration %"
GST_TIME_FORMAT, GST_TIME_ARGS (position), GST_TIME_ARGS (duration)); GST_TIME_FORMAT, GST_TIME_ARGS (position), GST_TIME_ARGS (duration));
if (position == -1) { if (position == -1 || media->active > 0) {
media->range.min.type = GST_RTSP_TIME_NOW; media->range.min.type = GST_RTSP_TIME_NOW;
media->range.min.seconds = -1; media->range.min.seconds = -1;
} else { } else {
@ -1893,7 +1893,7 @@ gst_rtsp_media_set_state (GstRTSPMedia * media, GstState state,
} }
/* remember where we are */ /* remember where we are */
if (state == GST_STATE_PAUSED) if (state == GST_STATE_PAUSED || old_active != media->active)
collect_media_stats (media); collect_media_stats (media);
return TRUE; return TRUE;