]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
* fixing a bug in DV timestamp generation. Now libavtest doesn't
authorromansh <romansh@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Aug 2004 05:42:49 +0000 (05:42 +0000)
committerromansh <romansh@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Aug 2004 05:42:49 +0000 (05:42 +0000)
     depend on a local TZ anymore.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3368 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/dv.c
tests/libav.regression.ref

index bda7d94a9da1a2ee05b22a5842b13183507acde3..888dc2d1b8e06c46378513243c34924663d62a6e 100644 (file)
@@ -195,7 +195,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
     case dv_timecode:
           ct = (time_t)(c->frames / ((float)c->sys->frame_rate / 
                                      (float)c->sys->frame_rate_base));
-          localtime_r(&ct, &tc);
+          gmtime_r(&ct, &tc);
           /* 
            * LTC drop-frame frame counter drops two frames (0 and 1) every 
            * minute, unless it is exactly divisible by 10
@@ -253,14 +253,15 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
     case dv_viedo_recdate:  /* VAUX recording date */
           ct = c->start_time + (time_t)(c->frames / 
               ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
-          localtime_r(&ct, &tc);
+          gmtime_r(&ct, &tc);
          buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
                         /* 0xff is very likely to be "unknown" */
          buf[2] = (3 << 6) | /* reserved -- always 1 */
                   ((tc.tm_mday / 10) << 4) | /* Tens of day */
                   (tc.tm_mday % 10);         /* Units of day */
          buf[3] = /* we set high 4 bits to 0, shouldn't we set them to week? */
-                  (tc.tm_mon % 10);         /* Units of month */
+                  (((tc.tm_mon + 1) / 10) << 4) |    /* Tens of month */
+                  ((tc.tm_mon + 1) % 10);            /* Units of month */
          buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */
                   (tc.tm_year % 10);                 /* Units of year */
           break;
@@ -268,7 +269,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
     case dv_video_rectime:  /* VAUX recording time */
           ct = c->start_time + (time_t)(c->frames / 
               ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
-          localtime_r(&ct, &tc);
+          gmtime_r(&ct, &tc);
          buf[1] = (3 << 6) | /* reserved -- always 1 */
                   0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
          buf[2] = (1 << 7) | /* reserved -- always 1 */ 
index c90d2432d43b14de85375ef7e5d41b982ffb9136..f241b3350717bead026196ab87d30e3d734085dd 100644 (file)
@@ -25,7 +25,7 @@ b57e3c4e0f27cbd0bf7b7fafb142fe7f *./data/b-libav.ffm
 fea20ced22451312dd463110e594eda6 *./data/b-libav.nut
 332415 ./data/b-libav.nut
 ./data/b-libav.nut CRC=001a3415
-b28918de1199e60a7ac235eefacb7d3b *./data/b-libav.dv
+4e4b45f8f39ee65658c40ccc3e94a2b0 *./data/b-libav.dv
 3600000 ./data/b-libav.dv
 ./data/b-libav.dv CRC=03701687
 9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm