+static void
+gst_qt_mux_register_buffer_in_chunk (GstQTMux * qtmux, GstQTPad * pad,
+ guint buffer_size, GstClockTime duration)
+{
+ /* not that much happens here,
+ * but updating any of this very likely needs to happen all in sync,
+ * unless there is a very good reason not to */
+
+ /* for computing the avg bitrate */
+ pad->total_bytes += buffer_size;
+ pad->total_duration += duration;
+ /* for keeping track of where we are in chunk;
+ * ensures that data really is located as recorded in atoms */
+ qtmux->current_chunk_size += buffer_size;
+ qtmux->current_chunk_duration += duration;
+}
+