flvmux: Fix index building to make entries point to tag's start offset

Previous coding was wrongly incrementing the total byte count before
adding an index entry.
This commit is contained in:
Jan Urbański 2010-03-14 01:09:37 +01:00 committed by Sebastian Dröge
parent a7a0afa5c4
commit b21c5c9015

View file

@ -538,8 +538,6 @@ gst_flv_mux_release_pad (GstElement * element, GstPad * pad)
static GstFlowReturn static GstFlowReturn
gst_flv_mux_push (GstFlvMux * mux, GstBuffer * buffer) gst_flv_mux_push (GstFlvMux * mux, GstBuffer * buffer)
{ {
mux->byte_count += GST_BUFFER_SIZE (buffer);
if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer)) { if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer)) {
GstFlvMuxIndexEntry *entry = g_slice_new (GstFlvMuxIndexEntry); GstFlvMuxIndexEntry *entry = g_slice_new (GstFlvMuxIndexEntry);
entry->position = mux->byte_count; entry->position = mux->byte_count;
@ -548,6 +546,8 @@ gst_flv_mux_push (GstFlvMux * mux, GstBuffer * buffer)
mux->index = g_list_prepend (mux->index, entry); mux->index = g_list_prepend (mux->index, entry);
} }
mux->byte_count += GST_BUFFER_SIZE (buffer);
return gst_pad_push (mux->srcpad, buffer); return gst_pad_push (mux->srcpad, buffer);
} }