From 361979b83b98648a2cd3e5d09f66bb0a3d669417 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 4 Jul 2006 14:06:03 +0000 Subject: [PATCH] gst/playback/gstplaybasebin.c: Improve checking if we are dealing with a stream. Added some more uris that need buffe... Original commit message from CVS: * gst/playback/gstplaybasebin.c: (is_stream), (gen_source_element): Improve checking if we are dealing with a stream. Added some more uris that need buffering. --- ChangeLog | 6 ++++++ common | 2 +- gst/playback/gstplaybasebin.c | 22 +++++++++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24c880c..75dc701 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-04 Wim Taymans + + * gst/playback/gstplaybasebin.c: (is_stream), (gen_source_element): + Improve checking if we are dealing with a stream. Added some + more uris that need buffering. + 2006-07-03 Edward Hervey * ext/vorbis/vorbisdec.c: (vorbis_do_clip): diff --git a/common b/common index a98b370..dd173e2 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit a98b370bd49bc3f3225bbd9013cda5a53789f53d +Subproject commit dd173e2720ac21e4a47c97705d7ff32271a0ee66 diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index bb5b185..003e10d 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -1244,6 +1244,22 @@ setup_subtitle (GstPlayBaseBin * play_base_bin, gchar * sub_uri) return subbin; } +/* lame - FIXME, maybe we can use seek_types/mask here? */ +static gboolean +is_stream (GstPlayBaseBin * play_base_bin, gchar * uri) +{ + static const gchar *uris[] = { "http://", "mms://", "mmsh://", + "mmsu://", "mmst://", "rtp://", "rtsp://", NULL + }; + gint i; + + for (i = 0; uris[i]; i++) { + if (g_str_has_prefix (uri, uris[i])) + return TRUE; + } + return FALSE; +} + /* * Generate a source element that does caching for network streams. */ @@ -1276,11 +1292,7 @@ gen_source_element (GstPlayBaseBin * play_base_bin, GstElement ** subbin) if (!source) return NULL; - /* lame - FIXME, maybe we can use seek_types/mask here? */ - play_base_bin->is_stream = !strncmp (play_base_bin->uri, "http://", 7) || - !strncmp (play_base_bin->uri, "mms://", 6) || - !strncmp (play_base_bin->uri, "rtp://", 6) || - !strncmp (play_base_bin->uri, "rtsp://", 7); + play_base_bin->is_stream = is_stream (play_base_bin, play_base_bin->uri); /* make HTTP sources send extra headers so we get icecast * metadata in case the stream is an icecast stream */ -- 2.7.4