Commit c8b36444 authored by Matthieu Bouron's avatar Matthieu Bouron Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8da2a3ab
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment