From: Thomas Vander Stichele Date: Thu, 2 Mar 2006 17:15:38 +0000 (+0000) Subject: extra debugging from older version, makes it easier to compare X-Git-Tag: 1.19.3~511^2~12132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=967a2963005046bc55e4aecfc48c6d71c6975a2f;p=platform%2Fupstream%2Fgstreamer.git extra debugging from older version, makes it easier to compare Original commit message from CVS: extra debugging from older version, makes it easier to compare --- diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 57913b91fb..f3d61dad4d 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -1101,11 +1101,16 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) GstClockTime last_ts = GST_BUFFER_END_TIME (pad->buffer); - /* if the next packet in the current page is going to make the page + /* if the next packet in the current page is going to make the page * too long, we need to flush */ if (last_ts > ogg_mux->next_ts + ogg_mux->max_delay) { ogg_page page; + GST_LOG_OBJECT (pad->pad, + GST_GP_FORMAT " stored packet %" G_GINT64_FORMAT + " will make page too long, flushing", + GST_BUFFER_OFFSET_END (pad->buffer), pad->stream.packetno); + while (ogg_stream_flush (&pad->stream, &page)) { /* Place page into the per-pad queue */ ret = gst_ogg_mux_pad_queue_page (ogg_mux, pad, &page, @@ -1120,11 +1125,6 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) } } - if (ogg_mux->need_headers) { - ret = gst_ogg_mux_send_headers (ogg_mux); - ogg_mux->need_headers = FALSE; - } - /* if we don't know which pad to pull on, use the best one */ if (ogg_mux->pulling == NULL) { ogg_mux->pulling = best; @@ -1141,6 +1141,11 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) } } + if (ogg_mux->need_headers) { + ret = gst_ogg_mux_send_headers (ogg_mux); + ogg_mux->need_headers = FALSE; + } + /* we are pulling from a pad, continue to do so until a page * has been filled and queued */ if (ogg_mux->pulling != NULL) { @@ -1174,6 +1179,9 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) /* mark BOS and packet number */ packet.b_o_s = (pad->packetno == 0); packet.packetno = pad->packetno++; + GST_DEBUG_OBJECT (pad->pad, GST_GP_FORMAT + " packet %" G_GINT64_FORMAT " (%ld bytes) created from buffer", + packet.granulepos, packet.packetno, packet.bytes); packet.e_o_s = 0; tmpbuf = NULL; @@ -1191,9 +1199,13 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) /* flush the currently built page if neccesary */ if (force_flush) { + GST_LOG_OBJECT (pad->pad, + GST_GP_FORMAT " forcing flush because of keyframe", + GST_BUFFER_OFFSET_END (pad->buffer)); while (ogg_stream_flush (&pad->stream, &page)) { ret = gst_ogg_mux_pad_queue_page (ogg_mux, pad, &page, pad->first_delta); + /* increment the page number counter */ pad->pageno++; /* mark other pages as delta */ @@ -1244,12 +1256,16 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) timestamp = GST_BUFFER_TIMESTAMP (pad->buffer); timestamp_end = GST_BUFFER_END_TIME (pad->buffer); + GST_LOG_OBJECT (pad->pad, + GST_GP_FORMAT " packet %" G_GINT64_FORMAT ", time %" + GST_TIME_FORMAT ") packetin'd", + granulepos, packet.packetno, GST_TIME_ARGS (timestamp)); /* don't need the old buffer anymore */ gst_buffer_unref (pad->buffer); /* store new readahead buffer */ pad->buffer = tmpbuf; - /* let ogg write out the pages now. The packet we got could end + /* let ogg write out the pages now. The packet we got could end * up in more than one page so we need to write them all */ if (ogg_stream_pageout (&pad->stream, &page) > 0) { if (ogg_page_granulepos (&page) == granulepos) {