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) {
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;
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);
}
}
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;
/* Do we need a newsegment event ? */
if (G_UNLIKELY (demux->audio_need_segment)) {
+ if (demux->close_seg_event)
+ gst_pad_push_event (demux->audio_pad,
+ gst_event_ref (demux->close_seg_event));
+
if (!demux->new_seg_event) {
GST_DEBUG_OBJECT (demux, "pushing newsegment from %"
GST_TIME_FORMAT " to %" GST_TIME_FORMAT,
/* Do we need a newsegment event ? */
if (G_UNLIKELY (demux->video_need_segment)) {
+ if (demux->close_seg_event)
+ gst_pad_push_event (demux->video_pad,
+ gst_event_ref (demux->close_seg_event));
+
if (!demux->new_seg_event) {
GST_DEBUG_OBJECT (demux, "pushing newsegment from %"
GST_TIME_FORMAT " to %" GST_TIME_FORMAT,