summaryrefslogtreecommitdiffstats
path: root/gst/flv/gstflvdemux.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-10-27 09:10:54 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-10-27 09:10:54 +0000
commit4dc92cff1ec25b63c32c73879d66b778f0a26635 (patch)
treed65f2aa1740f48ccc6291d6ea668f0f93a4edebf /gst/flv/gstflvdemux.c
parent77de3318151adba45080513f00b5b2e6d5eede00 (diff)
downloadgst-plugins-bad-4dc92cff1ec25b63c32c73879d66b778f0a26635.tar.gz
gst-plugins-bad-4dc92cff1ec25b63c32c73879d66b778f0a26635.tar.bz2
gst-plugins-bad-4dc92cff1ec25b63c32c73879d66b778f0a26635.zip
gst/flv/: Close the currently playing segment from the streaming thread instead of the thread where the seek event is...
Original commit message from CVS: * gst/flv/gstflvdemux.c: (gst_flv_demux_cleanup), (gst_flv_demux_handle_seek_pull), (gst_flv_demux_dispose): * gst/flv/gstflvdemux.h: * gst/flv/gstflvparse.c: (gst_flv_parse_tag_audio), (gst_flv_parse_tag_video): Close the currently playing segment from the streaming thread instead of the thread where the seek event is handled.
Diffstat (limited to 'gst/flv/gstflvdemux.c')
-rw-r--r--gst/flv/gstflvdemux.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c
index df018587..028dded8 100644
--- a/gst/flv/gstflvdemux.c
+++ b/gst/flv/gstflvdemux.c
@@ -112,6 +112,11 @@ gst_flv_demux_cleanup (GstFLVDemux * demux)
demux->new_seg_event = NULL;
}
+ if (demux->close_seg_event) {
+ gst_event_unref (demux->close_seg_event);
+ demux->close_seg_event = NULL;
+ }
+
gst_adapter_clear (demux->adapter);
if (demux->audio_codec_data) {
@@ -774,14 +779,18 @@ gst_flv_demux_handle_seek_pull (GstFLVDemux * demux, GstEvent * event)
GST_DEBUG_OBJECT (demux, "closing running segment %" GST_SEGMENT_FORMAT,
demux->segment);
- /* Close the current segment for a linear playback, FIXME, queue for
- * streaming thread. */
+ if (G_UNLIKELY (demux->close_seg_event)) {
+ gst_event_unref (demux->close_seg_event);
+ demux->close_seg_event = NULL;
+ }
+
+ /* Close the current segment for a linear playback */
if (demux->segment->rate >= 0) {
/* for forward playback, we played from start to last_stop */
- gst_pad_event_default (demux->sinkpad, gst_event_new_new_segment (TRUE,
- demux->segment->rate, demux->segment->format,
- demux->segment->start, demux->segment->last_stop,
- demux->segment->time));
+ demux->close_seg_event = gst_event_new_new_segment (TRUE,
+ demux->segment->rate, demux->segment->format,
+ demux->segment->start, demux->segment->last_stop,
+ demux->segment->time);
} else {
gint64 stop;
@@ -789,9 +798,9 @@ gst_flv_demux_handle_seek_pull (GstFLVDemux * demux, GstEvent * event)
stop = demux->segment->duration;
/* for reverse playback, we played from stop to last_stop. */
- gst_pad_event_default (demux->sinkpad, gst_event_new_new_segment (TRUE,
- demux->segment->rate, demux->segment->format,
- demux->segment->last_stop, stop, demux->segment->last_stop));
+ demux->close_seg_event = gst_event_new_new_segment (TRUE,
+ demux->segment->rate, demux->segment->format,
+ demux->segment->last_stop, stop, demux->segment->last_stop);
}
}
@@ -1139,6 +1148,11 @@ gst_flv_demux_dispose (GObject * object)
demux->new_seg_event = NULL;
}
+ if (demux->close_seg_event) {
+ gst_event_unref (demux->close_seg_event);
+ demux->close_seg_event = NULL;
+ }
+
if (demux->audio_codec_data) {
gst_buffer_unref (demux->audio_codec_data);
demux->audio_codec_data = NULL;