[FFmpeg-devel] [PATCH] lavf/mxf: fix parsing of timestamps
Matthieu Bouron
matthieu.bouron at gmail.com
Sat Apr 13 17:12:20 CEST 2013
Correct bit mask for month/day/hour/min/sec values.
For reference the timestamp format specified in S377M is as follow:
year (int16), month (uint8), day (uint8), hour (uint8), sec (uint8),
msec (uint8).
A value of 0 for every fields means timestamp "unknown".
---
libavformat/mxfdec.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index adc5c68..3195bf2 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1662,11 +1662,11 @@ static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
{
struct tm time;
time.tm_year = (timestamp >> 48) - 1900;
- time.tm_mon = (timestamp >> 40 & 0xF) - 1;
- time.tm_mday = (timestamp >> 32 & 0xF);
- time.tm_hour = (timestamp >> 24 & 0XF);
- time.tm_min = (timestamp >> 16 & 0xF);
- time.tm_sec = (timestamp >> 8 & 0xF);
+ time.tm_mon = (timestamp >> 40 & 0xFF) - 1;
+ time.tm_mday = (timestamp >> 32 & 0xFF);
+ time.tm_hour = (timestamp >> 24 & 0xFF);
+ time.tm_min = (timestamp >> 16 & 0xFF);
+ time.tm_sec = (timestamp >> 8 & 0xFF);
*str = av_mallocz(32);
if (!*str)
--
1.8.2.1
More information about the ffmpeg-devel
mailing list