diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-11 18:40:55 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-12 11:00:07 +0100 |
commit | 61b284de0d44247316fd185134c293d026e4131c (patch) | |
tree | e4fb723dea7b889470e8f816c3176bdfc22c1f18 /gst/mxf/mxfparse.c | |
parent | 144466e2cd855f420211b475f18ab0a0a4d7243e (diff) | |
download | gst-plugins-bad-61b284de0d44247316fd185134c293d026e4131c.tar.gz gst-plugins-bad-61b284de0d44247316fd185134c293d026e4131c.tar.bz2 gst-plugins-bad-61b284de0d44247316fd185134c293d026e4131c.zip |
mxfdemux: Parse MXFTimestamp's milliseconds and add _to_string() function
Diffstat (limited to 'gst/mxf/mxfparse.c')
-rw-r--r-- | gst/mxf/mxfparse.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gst/mxf/mxfparse.c b/gst/mxf/mxfparse.c index c5c81fdb..2611e817 100644 --- a/gst/mxf/mxfparse.c +++ b/gst/mxf/mxfparse.c @@ -357,7 +357,7 @@ mxf_timestamp_parse (MXFTimestamp * timestamp, const guint8 * data, guint size) timestamp->hour = GST_READ_UINT8 (data + 4); timestamp->minute = GST_READ_UINT8 (data + 5); timestamp->second = GST_READ_UINT8 (data + 6); - timestamp->quarter_msecond = GST_READ_UINT8 (data + 7); + timestamp->msecond = (GST_READ_UINT8 (data + 7) * 1000) / 256; return TRUE; } @@ -385,12 +385,21 @@ mxf_timestamp_compare (const MXFTimestamp * a, const MXFTimestamp * b) return diff; else if ((diff = a->second - b->second) != 0) return diff; - else if ((diff = a->quarter_msecond - b->quarter_msecond) != 0) + else if ((diff = a->msecond - b->msecond) != 0) return diff; else return 0; } +gchar * +mxf_timestamp_to_string (const MXFTimestamp * t, gchar str[32]) +{ + g_snprintf (str, 32, + "%04d-%02u-%02u %02u:%02u:%02u.%03u", t->year, t->month, + t->day, t->hour, t->minute, t->second, t->msecond); + return str; +} + gboolean mxf_fraction_parse (MXFFraction * fraction, const guint8 * data, guint size) { |