diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 2426b7275f..4198f6cbdc 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1440,6 +1440,19 @@ gst_ogg_pad_handle_push_mode_state (GstOggPad * pad, ogg_page * page) } GST_INFO_OBJECT (ogg, "Bisection needed %d + %d steps", ogg->push_bisection_steps[0], ogg->push_bisection_steps[1]); + ogg->stats_bisection_steps[0] += ogg->push_bisection_steps[0]; + ogg->stats_bisection_steps[1] += ogg->push_bisection_steps[1]; + if (ogg->stats_bisection_max_steps[0] < ogg->push_bisection_steps[0]) + ogg->stats_bisection_max_steps[0] = ogg->push_bisection_steps[0]; + if (ogg->stats_bisection_max_steps[1] < ogg->push_bisection_steps[1]) + ogg->stats_bisection_max_steps[1] = ogg->push_bisection_steps[1]; + ogg->stats_nbisections++; + GST_INFO_OBJECT (ogg, + "So far, %.2f + %.2f bisections needed per seek (max %d + %d)", + ogg->stats_bisection_steps[0] / (float) ogg->stats_nbisections, + ogg->stats_bisection_steps[1] / (float) ogg->stats_nbisections, + ogg->stats_bisection_max_steps[0], + ogg->stats_bisection_max_steps[1]); } } } else if (ogg->push_state == PUSH_LINEAR1) { @@ -1853,6 +1866,12 @@ gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class) ogg->push_lock = g_mutex_new (); ogg->chains = g_array_new (FALSE, TRUE, sizeof (GstOggChain *)); + ogg->stats_nbisections = 0; + ogg->stats_bisection_steps[0] = 0; + ogg->stats_bisection_steps[1] = 0; + ogg->stats_bisection_max_steps[0] = 0; + ogg->stats_bisection_max_steps[1] = 0; + ogg->newsegment = NULL; } diff --git a/ext/ogg/gstoggdemux.h b/ext/ogg/gstoggdemux.h index 712dc8f05c..fea4c60dc5 100644 --- a/ext/ogg/gstoggdemux.h +++ b/ext/ogg/gstoggdemux.h @@ -188,6 +188,9 @@ struct _GstOggDemux gboolean push_disable_seeking; gint push_bisection_steps[2]; + gint stats_bisection_steps[2]; + gint stats_bisection_max_steps[2]; + gint stats_nbisections; /* ogg stuff */ ogg_sync_state sync;