ext/dv/gstdvdemux.*: When handling seek requests, don't send the newsegment event from the calling thread. Instead sa...
Original commit message from CVS: * ext/dv/gstdvdemux.c: (gst_dvdemux_handle_pull_seek), (gst_dvdemux_loop), (gst_dvdemux_change_state): * ext/dv/gstdvdemux.h: When handling seek requests, don't send the newsegment event from the calling thread. Instead save it so it can be sent from the streaming thread.
This commit is contained in:
parent
52c986d876
commit
ab9b853b84
@ -1,3 +1,12 @@
|
|||||||
|
2006-08-18 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
|
* ext/dv/gstdvdemux.c: (gst_dvdemux_handle_pull_seek),
|
||||||
|
(gst_dvdemux_loop), (gst_dvdemux_change_state):
|
||||||
|
* ext/dv/gstdvdemux.h:
|
||||||
|
When handling seek requests, don't send the newsegment event from the
|
||||||
|
calling thread. Instead save it so it can be sent from the streaming
|
||||||
|
thread.
|
||||||
|
|
||||||
2006-08-17 Wim Taymans <wim@fluendo.com>
|
2006-08-17 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
Patch by: Sjoerd Simons <sjoerd at luon dot net>
|
Patch by: Sjoerd Simons <sjoerd at luon dot net>
|
||||||
|
@ -1071,15 +1071,15 @@ gst_dvdemux_handle_pull_seek (GstDVDemux * demux, GstPad * pad,
|
|||||||
if ((stop = demux->time_segment.stop) == -1)
|
if ((stop = demux->time_segment.stop) == -1)
|
||||||
stop = demux->time_segment.duration;
|
stop = demux->time_segment.duration;
|
||||||
|
|
||||||
/* now send the newsegment */
|
GST_INFO_OBJECT (demux,
|
||||||
GST_DEBUG_OBJECT (demux, "Sending newsegment from %" GST_TIME_FORMAT
|
"Saving newsegment event to be sent in streaming thread");
|
||||||
" to %" GST_TIME_FORMAT, GST_TIME_ARGS (demux->time_segment.start),
|
|
||||||
GST_TIME_ARGS (stop));
|
|
||||||
|
|
||||||
gst_dvdemux_push_event (demux,
|
if (demux->pending_segment)
|
||||||
gst_event_new_new_segment (FALSE,
|
gst_event_unref (demux->pending_segment);
|
||||||
demux->time_segment.rate, demux->time_segment.format,
|
|
||||||
demux->time_segment.last_stop, stop, demux->time_segment.time));
|
demux->pending_segment = gst_event_new_new_segment (FALSE,
|
||||||
|
demux->time_segment.rate, demux->time_segment.format,
|
||||||
|
demux->time_segment.last_stop, stop, demux->time_segment.time);
|
||||||
|
|
||||||
demux->need_segment = FALSE;
|
demux->need_segment = FALSE;
|
||||||
}
|
}
|
||||||
@ -1610,6 +1610,17 @@ gst_dvdemux_loop (GstPad * pad)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (G_UNLIKELY (dvdemux->pending_segment)) {
|
||||||
|
|
||||||
|
/* now send the newsegment */
|
||||||
|
GST_DEBUG_OBJECT (dvdemux, "Sending newsegment from");
|
||||||
|
|
||||||
|
gst_dvdemux_push_event (dvdemux, dvdemux->pending_segment);
|
||||||
|
dvdemux->pending_segment = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (G_LIKELY (buffer == NULL)) {
|
if (G_LIKELY (buffer == NULL)) {
|
||||||
GST_DEBUG_OBJECT (dvdemux, "pulling buffer at offset %" G_GINT64_FORMAT,
|
GST_DEBUG_OBJECT (dvdemux, "pulling buffer at offset %" G_GINT64_FORMAT,
|
||||||
dvdemux->byte_segment.last_stop);
|
dvdemux->byte_segment.last_stop);
|
||||||
@ -1770,6 +1781,9 @@ gst_dvdemux_change_state (GstElement * element, GstStateChange transition)
|
|||||||
|
|
||||||
event_p = &dvdemux->seek_event;
|
event_p = &dvdemux->seek_event;
|
||||||
gst_event_replace (event_p, NULL);
|
gst_event_replace (event_p, NULL);
|
||||||
|
if (dvdemux->pending_segment)
|
||||||
|
gst_event_unref (dvdemux->pending_segment);
|
||||||
|
dvdemux->pending_segment = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -83,6 +83,7 @@ struct _GstDVDemux {
|
|||||||
|
|
||||||
gint found_header; /* ATOMIC */
|
gint found_header; /* ATOMIC */
|
||||||
GstEvent *seek_event;
|
GstEvent *seek_event;
|
||||||
|
GstEvent *pending_segment;
|
||||||
|
|
||||||
gint16 *audio_buffers[4];
|
gint16 *audio_buffers[4];
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user