ext/ogg/gstoggdemux.c: Synchronized discont handling.
Original commit message from CVS: * ext/ogg/gstoggdemux.c: (gst_ogg_demux_push), (gst_ogg_pad_push): Synchronized discont handling.
This commit is contained in:
parent
477d4ee09b
commit
4744db22d7
@ -1,3 +1,8 @@
|
|||||||
|
2004-10-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_push), (gst_ogg_pad_push):
|
||||||
|
Synchronized discont handling.
|
||||||
|
|
||||||
2004-10-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
2004-10-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_event),
|
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_src_event),
|
||||||
|
@ -562,12 +562,10 @@ gst_ogg_demux_src_event (GstPad * pad, GstEvent * event)
|
|||||||
|
|
||||||
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK);
|
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK);
|
||||||
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,
|
||||||
@ -642,8 +640,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);
|
||||||
@ -929,8 +926,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);
|
||||||
@ -1059,8 +1055,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? */
|
||||||
@ -1390,7 +1385,7 @@ gst_ogg_demux_push (GstOggDemux * ogg, ogg_page * page)
|
|||||||
"ended seek at offset %" G_GUINT64_FORMAT " (requested %"
|
"ended seek at offset %" G_GUINT64_FORMAT " (requested %"
|
||||||
G_GUINT64_FORMAT, cur->known_offset, ogg->seek_to);
|
G_GUINT64_FORMAT, cur->known_offset, ogg->seek_to);
|
||||||
ogg->seek_pad = NULL;
|
ogg->seek_pad = NULL;
|
||||||
ogg->seek_to = 0;
|
ogg->seek_offset = 0;
|
||||||
ogg->seek_try = 0;
|
ogg->seek_try = 0;
|
||||||
}
|
}
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
@ -1503,8 +1498,21 @@ gst_ogg_pad_push (GstOggDemux * ogg, GstOggPad * pad)
|
|||||||
/* send discont if needed */
|
/* send discont if needed */
|
||||||
if (pos != -1 && (pad->flags & GST_OGG_PAD_NEEDS_DISCONT)
|
if (pos != -1 && (pad->flags & GST_OGG_PAD_NEEDS_DISCONT)
|
||||||
&& GST_PAD_IS_USABLE (pad->pad)) {
|
&& GST_PAD_IS_USABLE (pad->pad)) {
|
||||||
GstEvent *event = gst_event_new_discontinuous (FALSE,
|
/* so in order to synchronized the variety of streams, we will
|
||||||
GST_FORMAT_DEFAULT, pos, GST_FORMAT_UNDEFINED);
|
* not use the granpos but the last seekpos for the discont. */
|
||||||
|
GstEvent *event;
|
||||||
|
gint64 discont;
|
||||||
|
|
||||||
|
fmt = GST_FORMAT_DEFAULT;
|
||||||
|
if (!GST_PAD_PEER (pad->pad) ||
|
||||||
|
!gst_pad_convert (GST_PAD_PEER (pad->pad),
|
||||||
|
ogg->seek_format, ogg->seek_to, &fmt, &discont)) {
|
||||||
|
event = gst_event_new_discontinuous (FALSE,
|
||||||
|
ogg->seek_format, ogg->seek_to, GST_FORMAT_UNDEFINED);
|
||||||
|
} else {
|
||||||
|
event = gst_event_new_discontinuous (FALSE,
|
||||||
|
GST_FORMAT_DEFAULT, discont, GST_FORMAT_UNDEFINED);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: this might be wrong because we can only use the last
|
/* FIXME: this might be wrong because we can only use the last
|
||||||
* known offset */
|
* known offset */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user