mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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>
This commit is contained in:
parent
8da2a3aba3
commit
c8b3644494
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user