[FFmpeg-cvslog] lavf/mxf: fix parsing of timestamps

Matthieu Bouron git at videolan.org
Sat Apr 13 17:37:14 CEST 2013


ffmpeg | branch: master | Matthieu Bouron <matthieu.bouron at gmail.com> | Sat Apr 13 17:12:20 2013 +0200| [c8b364449424f09397a3be46b8215ed92284e393] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8b364449424f09397a3be46b8215ed92284e393
---

 libavformat/mxfdec.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 6306756..4ceaaee 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)



More information about the ffmpeg-cvslog mailing list