diff --git a/ChangeLog b/ChangeLog index 6a7afd0cd6..42e1ada0a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-01-30 Andy Wingo + * ext/ogg/gstoggmux.c (gst_ogg_mux_dequeue_page): Compare + timestamp + duration, not just timestamp -- ogg pages should be + ordered by stop time. Necessary fix given the change in vorbis + timestamps. + * ext/theora/theoraenc.c (theora_enc_sink_setcaps) (gst_theora_enc_init): Pull the granule shift out of the encoder. (granulepos_add): New function, handles the messiness of adjusting diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index bba1ccd7dd..745ade62d9 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -571,12 +571,12 @@ gst_ogg_mux_dequeue_page (GstOggMux * mux, GstFlowReturn * flowret) if (buf) { /* if no oldest buffer yet, take this one */ if (oldest == GST_CLOCK_TIME_NONE) { - oldest = GST_BUFFER_TIMESTAMP (buf); + oldest = GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf); opad = pad; } else { /* if we have an oldest, compare with this one */ - if (GST_BUFFER_TIMESTAMP (buf) < oldest) { - oldest = GST_BUFFER_TIMESTAMP (buf); + if (GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf) < oldest) { + oldest = GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf); opad = pad; } } @@ -588,9 +588,9 @@ gst_ogg_mux_dequeue_page (GstOggMux * mux, GstFlowReturn * flowret) g_assert (opad); buf = g_queue_pop_head (opad->pagebuffers); GST_LOG_OBJECT (opad, - GST_GP_FORMAT " pushing oldest page (time %" GST_TIME_FORMAT ")", + GST_GP_FORMAT " pushing oldest page (end time %" GST_TIME_FORMAT ")", GST_BUFFER_OFFSET_END (buf), - GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf))); *flowret = gst_ogg_mux_push_buffer (mux, buf); ret = TRUE; }