summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuciana Fujii Pontello <luciana@fujii.eti.br>2012-10-29 13:24:25 +0000
committerTim-Philipp Müller <tim@centricular.net>2012-11-05 12:50:07 +0000
commit40325be3a491275eb267c07c8151a173a76c749f (patch)
treefb532b1ad6b60ae4386c81d3628a859d415fc7db
parentdda3106650e847f95fa91fedebc4523aad847780 (diff)
hlssink: reset when going to NULL state
https://bugzilla.gnome.org/show_bug.cgi?id=687133
-rw-r--r--gst/hls/gsthlssink.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gst/hls/gsthlssink.c b/gst/hls/gsthlssink.c
index 8d33c335c..02b134e0e 100644
--- a/gst/hls/gsthlssink.c
+++ b/gst/hls/gsthlssink.c
@@ -152,6 +152,16 @@ gst_hls_sink_class_init (GstHlsSinkClass * klass)
}
static void
+gst_hls_sink_reset (GstHlsSink * sink)
+{
+ sink->index = 0;
+ sink->multifilesink = NULL;
+ sink->last_stream_time = 0;
+
+ sink->playlist = gst_m3u8_playlist_new (6, 5, FALSE);
+}
+
+static void
gst_hls_sink_init (GstHlsSink * sink, GstHlsSinkClass * sink_class)
{
GstPadTemplate *templ = gst_static_pad_template_get (&sink_template);
@@ -161,17 +171,14 @@ gst_hls_sink_init (GstHlsSink * sink, GstHlsSinkClass * sink_class)
gst_pad_add_event_probe (sink->ghostpad,
G_CALLBACK (gst_hls_sink_ghost_event_probe), sink);
- sink->index = 0;
- sink->multifilesink = NULL;
- sink->last_stream_time = 0;
sink->location = g_strdup (DEFAULT_LOCATION);
sink->playlist_location = g_strdup (DEFAULT_PLAYLIST_LOCATION);
sink->playlist_root = g_strdup (DEFAULT_PLAYLIST_ROOT);
- sink->playlist = gst_m3u8_playlist_new (6, 5, FALSE);
sink->max_files = DEFAULT_MAX_FILES;
sink->target_duration = DEFAULT_TARGET_DURATION;
sink->count = 0;
sink->timeout_id = 0;
+ gst_hls_sink_reset (sink);
}
static gboolean
@@ -320,6 +327,7 @@ gst_hls_sink_change_state (GstElement * element, GstStateChange trans)
sink->count = 0;
break;
case GST_STATE_CHANGE_READY_TO_NULL:
+ gst_hls_sink_reset (sink);
break;
default:
break;