diff options
author | Matthieu Bouron <matthieu.bouron@gmail.com> | 2013-04-13 17:12:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-13 17:26:16 +0200 |
commit | c8b364449424f09397a3be46b8215ed92284e393 (patch) | |
tree | 7ce50330784c126a7dbdf4c4ebd3a1be2fadd2aa /libavformat | |
parent | 8da2a3aba3a7f51daf841c77cb6183a0d6dd528e (diff) | |
download | ffmpeg-c8b364449424f09397a3be46b8215ed92284e393.tar.gz |
lavf/mxf: fix parsing of timestamps
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".
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mxfdec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 630675625c..4ceaaee844 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) |