summaryrefslogtreecommitdiffstats
path: root/gst/xingheader
diff options
context:
space:
mode:
Diffstat (limited to 'gst/xingheader')
-rw-r--r--gst/xingheader/gstxingmux.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gst/xingheader/gstxingmux.c b/gst/xingheader/gstxingmux.c
index 76f11ec8..d10006cc 100644
--- a/gst/xingheader/gstxingmux.c
+++ b/gst/xingheader/gstxingmux.c
@@ -319,7 +319,7 @@ generate_xing_header (GstXingMux * xing)
GstXingSeekEntry *entry = (GstXingSeekEntry *) it->data;
gint64 byte;
- if ((entry->timestamp * 100) / duration >= percent) {
+ while ((entry->timestamp * 100) / duration >= percent) {
byte = (entry->byte * 256) / byte_count;
GST_DEBUG (" %d %% -- %d 1/256", percent, byte);
*data = byte;
@@ -327,6 +327,17 @@ generate_xing_header (GstXingMux * xing)
percent++;
}
}
+
+ if (percent < 100) {
+ guchar b = *(data - 1);
+ gint i;
+
+ for (i = percent; i < 100; i++) {
+ GST_DEBUG (" %d %% -- %d 1/256", i, b);
+ *data = b;
+ data++;
+ }
+ }
}
GST_DEBUG ("Setting Xing flags to 0x%x\n", *xing_flags);
@@ -376,6 +387,12 @@ gst_xing_mux_finalize (GObject * obj)
xing->adapter = NULL;
}
+ if (xing->seek_table) {
+ g_list_foreach (xing->seek_table, (GFunc) g_free, NULL);
+ g_list_free (xing->seek_table);
+ xing->seek_table = NULL;
+ }
+
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
@@ -389,6 +406,7 @@ xing_reset (GstXingMux * xing)
if (xing->seek_table) {
g_list_foreach (xing->seek_table, (GFunc) g_free, NULL);
+ g_list_free (xing->seek_table);
xing->seek_table = NULL;
}