Merge branch 'master' into 0.11

This commit is contained in:
Wim Taymans 2011-11-03 12:58:42 +01:00
commit bace3995d5
2 changed files with 13 additions and 0 deletions

View file

@ -715,6 +715,11 @@ gst_rtsp_media_seek (GstRTSPMedia * media, GstRTSPTimeRange * range)
g_return_val_if_fail (GST_IS_RTSP_MEDIA (media), FALSE);
g_return_val_if_fail (range != NULL, FALSE);
if (media->seekable) {
GST_INFO ("pipeline is not seekable");
return TRUE;
}
if (range->unit != GST_RTSP_RANGE_NPT)
goto not_supported;
@ -1704,6 +1709,7 @@ gst_rtsp_media_prepare (GstRTSPMedia * media)
/* reset some variables */
media->is_live = FALSE;
media->seekable = FALSE;
media->buffering = FALSE;
/* we're preparing now */
media->status = GST_RTSP_MEDIA_STATUS_PREPARING;
@ -1755,13 +1761,18 @@ gst_rtsp_media_prepare (GstRTSPMedia * media)
switch (ret) {
case GST_STATE_CHANGE_SUCCESS:
GST_INFO ("SUCCESS state change for media %p", media);
media->seekable = TRUE;
break;
case GST_STATE_CHANGE_ASYNC:
GST_INFO ("ASYNC state change for media %p", media);
media->seekable = TRUE;
break;
case GST_STATE_CHANGE_NO_PREROLL:
/* we need to go to PLAYING */
GST_INFO ("NO_PREROLL state change: live media %p", media);
/* FIXME we disable seeking for live streams for now. We should perform a
* seeking query in preroll instead and do a seeking query. */
media->seekable = FALSE;
media->is_live = TRUE;
ret = gst_element_set_state (media->pipeline, GST_STATE_PLAYING);
if (ret == GST_STATE_CHANGE_FAILURE)

View file

@ -179,6 +179,7 @@ typedef enum {
* @source: the bus watch for pipeline messages.
* @id: the id of the watch
* @is_live: if the pipeline is live
* @seekable: if the pipeline can perform a seek
* @buffering: if the pipeline is buffering
* @target_state: the desired target state of the pipeline
* @rtpbin: the rtpbin
@ -220,6 +221,7 @@ struct _GstRTSPMedia {
guint id;
gboolean is_live;
gboolean seekable;
gboolean buffering;
GstState target_state;