ext/ogg/gstoggdemux.c: Fix EOS again. Needs to be done in a better way. We should not remove the pad if there is no n...

Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_event),
(gst_ogg_demux_handle_event), (_find_chain_get_unknown_part),
(_find_streams_check), (gst_ogg_demux_push):
Fix EOS again. Needs to be done in a better way. We should not
remove the pad if there is no new chained stream.
This commit is contained in:
Wim Taymans 2004-10-26 14:41:06 +00:00
parent e2dc945577
commit a38d338dcd
2 changed files with 18 additions and 16 deletions

View File

@ -1,3 +1,11 @@
2004-10-26 Wim Taymans <wim@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_event),
(gst_ogg_demux_handle_event), (_find_chain_get_unknown_part),
(_find_streams_check), (gst_ogg_demux_push):
Fix EOS again. Needs to be done in a better way. We should not
remove the pad if there is no new chained stream.
2004-10-26 Iain <iaingnome@gmail.com> 2004-10-26 Iain <iaingnome@gmail.com>
* ext/ogg/gstoggdemux.c (gst_ogg_pad_new): Free the tag list. * ext/ogg/gstoggdemux.c (gst_ogg_pad_new): Free the tag list.

View File

@ -559,12 +559,10 @@ gst_ogg_demux_src_event (GstPad * pad, GstEvent * event)
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_PLAY); GST_OGG_SET_STATE (ogg, GST_OGG_STATE_PLAY);
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT; pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;);
);
if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) { if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) {
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
pad->flags |= GST_OGG_PAD_NEEDS_FLUSH; pad->flags |= GST_OGG_PAD_NEEDS_FLUSH;);
);
} }
GST_DEBUG_OBJECT (ogg, GST_DEBUG_OBJECT (ogg,
"initiating seeking to format %d, offset %" G_GUINT64_FORMAT, format, "initiating seeking to format %d, offset %" G_GUINT64_FORMAT, format,
@ -638,8 +636,7 @@ gst_ogg_demux_handle_event (GstPad * pad, GstEvent * event)
gst_event_unref (event); gst_event_unref (event);
GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT); GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT);
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT; pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;);
);
break; break;
default: default:
gst_pad_event_default (pad, event); gst_pad_event_default (pad, event);
@ -925,8 +922,7 @@ _find_chain_get_unknown_part (GstOggDemux * ogg, gint64 * start, gint64 * end)
*end = G_MAXINT64; *end = G_MAXINT64;
g_assert (ogg->current_chain >= 0); g_assert (ogg->current_chain >= 0);
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset); FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset););
);
if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) { if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) {
*end = gst_file_pad_get_length (ogg->sinkpad); *end = gst_file_pad_get_length (ogg->sinkpad);
@ -1055,8 +1051,7 @@ _find_streams_check (GstOggDemux * ogg)
} else { } else {
endpos = G_MAXINT64; endpos = G_MAXINT64;
FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1, FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1,
endpos = MIN (endpos, pad->start_offset); endpos = MIN (endpos, pad->start_offset););
);
} }
if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) { if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) {
/* have we found the endposition for all streams yet? */ /* have we found the endposition for all streams yet? */
@ -1365,14 +1360,13 @@ gst_ogg_demux_push (GstOggDemux * ogg, ogg_page * page)
if (ogg_page_eos (page)) { if (ogg_page_eos (page)) {
GST_DEBUG_OBJECT (ogg, "got EOS for stream with serial %d, sending EOS now", GST_DEBUG_OBJECT (ogg, "got EOS for stream with serial %d, sending EOS now",
cur->serial); cur->serial);
/* Removing pads while PLAYING doesn't work with current schedulers */
/* remove from list, as this will never be called again */ /* send an EOS before removing this pad */
if (GST_PAD_IS_USABLE (cur->pad))
gst_pad_push (cur->pad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
gst_element_remove_pad (GST_ELEMENT (ogg), cur->pad); gst_element_remove_pad (GST_ELEMENT (ogg), cur->pad);
cur->pad = NULL; cur->pad = NULL;
#if 0
/* this is also not possible because sending EOS this way confuses the scheduler */
gst_pad_push (cur->pad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
#endif
} }
} }
static void static void