diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-01-06 14:50:29 +0000 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-01-06 14:50:29 +0000 |
commit | b506ab991808be4a38858a93dda617ad235b1d6a (patch) | |
tree | a75d2e92db18fd343228018e33485df80f5e4cb5 /gst/avi/gstavimux.c | |
parent | 67cc69ad52addeee2999f5919cfc3b0fbc554ec8 (diff) |
gst/avi/gstavimux.*: Ensure header size invariance during subsequent rewrite by using tags snapshot.
Original commit message from CVS:
* gst/avi/gstavimux.c: (gst_avi_mux_reset),
(gst_avi_mux_riff_get_avi_header):
* gst/avi/gstavimux.h:
Ensure header size invariance during subsequent rewrite by using
tags snapshot.
Diffstat (limited to 'gst/avi/gstavimux.c')
-rw-r--r-- | gst/avi/gstavimux.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 0e3c4ad3..e93c8b18 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -383,6 +383,11 @@ gst_avi_mux_reset (GstAviMux * avimux) avimux->avi_hdr.max_bps = 10000000; avimux->codec_data_size = 0; + if (avimux->tags_snap) { + gst_tag_list_free (avimux->tags_snap); + avimux->tags_snap = NULL; + } + g_free (avimux->idx); avimux->idx = NULL; @@ -965,7 +970,15 @@ gst_avi_mux_riff_get_avi_header (GstAviMux * avimux) GST_DEBUG_OBJECT (avimux, "creating avi header, data_size %u, idx_size %u", avimux->data_size, avimux->idx_size); - tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux)); + if (avimux->tags_snap) + tags = avimux->tags_snap; + else { + /* need to make snapshot of current state of tags to ensure the same set + * is used next time around during header rewrite at the end */ + tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux)); + if (tags) + tags = avimux->tags_snap = gst_tag_list_copy (tags); + } if (tags) { /* that should be the strlen of all tags + header sizes * not all of tags end up in a avi, still this is a good estimate |