Commit f012ab67 authored by Zaheer Abbas Merali's avatar Zaheer Abbas Merali

matroskamux: set offsets on outgoing buffers

parent b37845da
......@@ -65,7 +65,7 @@ gst_ebml_write_init (GstEbmlWrite * ebml, GstEbmlWriteClass * klass)
ebml->streamheader = NULL;
ebml->streamheader_pos = 0;
ebml->writing_streamheader = FALSE;
ebml->current_offset = 0;
ebml->caps = NULL;
}
......@@ -135,6 +135,7 @@ gst_ebml_write_reset (GstEbmlWrite * ebml)
ebml->last_write_result = GST_FLOW_OK;
ebml->timestamp = GST_CLOCK_TIME_NONE;
ebml->need_newsegment = TRUE;
ebml->current_offset = 0;
}
......@@ -223,6 +224,8 @@ gst_ebml_write_flush_cache (GstEbmlWrite * ebml, gboolean is_keyframe)
ebml->cache = NULL;
GST_DEBUG ("Flushing cache of size %d", GST_BUFFER_SIZE (buffer));
gst_buffer_set_caps (buffer, ebml->caps);
GST_BUFFER_OFFSET (buffer) = ebml->current_offset++;
GST_BUFFER_OFFSET_END (buffer) = ebml->current_offset;
if (ebml->last_write_result == GST_FLOW_OK) {
if (ebml->need_newsegment) {
GstEvent *ev;
......@@ -402,6 +405,8 @@ gst_ebml_write_element_push (GstEbmlWrite * ebml, GstBuffer * buf)
}
buf = gst_buffer_make_metadata_writable (buf);
gst_buffer_set_caps (buf, ebml->caps);
GST_BUFFER_OFFSET (buf) = ebml->current_offset++;
GST_BUFFER_OFFSET_END (buf) = ebml->current_offset;
if (ebml->writing_streamheader) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
}
......
......@@ -59,6 +59,7 @@ typedef struct _GstEbmlWrite {
gboolean writing_streamheader;
GstByteWriter *streamheader;
guint64 streamheader_pos;
guint64 current_offset;
GstCaps *caps;
} GstEbmlWrite;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment