mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
asfdemux: Fix sending eos event for chained asfs
Properly push EOS event when finishing a chained asf file in pull mode Fixes #599718
This commit is contained in:
parent
054f0ca781
commit
ec3b13a250
1 changed files with 9 additions and 7 deletions
|
@ -1483,6 +1483,7 @@ gst_asf_demux_loop (GstASFDemux * demux)
|
||||||
GstFlowReturn flow = GST_FLOW_OK;
|
GstFlowReturn flow = GST_FLOW_OK;
|
||||||
GstBuffer *buf = NULL;
|
GstBuffer *buf = NULL;
|
||||||
guint64 off;
|
guint64 off;
|
||||||
|
gboolean sent_eos = FALSE;
|
||||||
|
|
||||||
if (G_UNLIKELY (demux->state == GST_ASF_DEMUX_STATE_HEADER)) {
|
if (G_UNLIKELY (demux->state == GST_ASF_DEMUX_STATE_HEADER)) {
|
||||||
if (!gst_asf_demux_pull_headers (demux)) {
|
if (!gst_asf_demux_pull_headers (demux)) {
|
||||||
|
@ -1622,21 +1623,22 @@ eos:
|
||||||
gst_asf_demux_reset (demux, TRUE);
|
gst_asf_demux_reset (demux, TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* normal playback, send EOS to all linked pads */
|
/* normal playback, send EOS to all linked pads */
|
||||||
GST_INFO_OBJECT (demux, "Sending EOS, at end of stream");
|
GST_INFO_OBJECT (demux, "Sending EOS, at end of stream");
|
||||||
gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
|
gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
|
||||||
}
|
sent_eos = TRUE;
|
||||||
/* ... and fall through to pause */
|
/* ... and fall through to pause */
|
||||||
GST_DEBUG_OBJECT (demux, "EOSing");
|
|
||||||
}
|
}
|
||||||
pause:
|
pause:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (demux, "pausing task");
|
GST_DEBUG_OBJECT (demux, "pausing task, flow return: %s",
|
||||||
|
gst_flow_get_name (flow));
|
||||||
demux->segment_running = FALSE;
|
demux->segment_running = FALSE;
|
||||||
gst_pad_pause_task (demux->sinkpad);
|
gst_pad_pause_task (demux->sinkpad);
|
||||||
|
|
||||||
/* For the error cases (not EOS) */
|
/* For the error cases (not EOS) */
|
||||||
if (GST_FLOW_IS_FATAL (flow) || flow == GST_FLOW_NOT_LINKED) {
|
if (!sent_eos) {
|
||||||
/* Post an error. Hopefully something else already has, but if not... */
|
/* Post an error. Hopefully something else already has, but if not... */
|
||||||
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
||||||
(_("Internal data stream error.")),
|
(_("Internal data stream error.")),
|
||||||
|
|
Loading…
Reference in a new issue