Mercurial > libavformat.hg
comparison dv.c @ 515:ad72189eec07 libavformat
* replacing calls to not-always-available gmtime_r with our own code.
The new helper function actually differs in semantics from gmtime_r,
so if that seems to be a problem I can actually move it to dv.c
completely, since only DV muxer uses the code anyway.
author | romansh |
---|---|
date | Wed, 18 Aug 2004 08:15:07 +0000 |
parents | 4655d19a3d94 |
children | d788959a01e2 |
comparison
equal
deleted
inserted
replaced
514:828bdf418a7b | 515:ad72189eec07 |
---|---|
193 (0 & 0x07); /* AP3: Subcode application ID */ | 193 (0 & 0x07); /* AP3: Subcode application ID */ |
194 break; | 194 break; |
195 case dv_timecode: | 195 case dv_timecode: |
196 ct = (time_t)(c->frames / ((float)c->sys->frame_rate / | 196 ct = (time_t)(c->frames / ((float)c->sys->frame_rate / |
197 (float)c->sys->frame_rate_base)); | 197 (float)c->sys->frame_rate_base)); |
198 gmtime_r(&ct, &tc); | 198 brktimegm(ct, &tc); |
199 /* | 199 /* |
200 * LTC drop-frame frame counter drops two frames (0 and 1) every | 200 * LTC drop-frame frame counter drops two frames (0 and 1) every |
201 * minute, unless it is exactly divisible by 10 | 201 * minute, unless it is exactly divisible by 10 |
202 */ | 202 */ |
203 ltc_frame = (c->frames + 2*ct/60 - 2*ct/600) % c->sys->ltc_divisor; | 203 ltc_frame = (c->frames + 2*ct/60 - 2*ct/600) % c->sys->ltc_divisor; |
251 break; | 251 break; |
252 case dv_audio_recdate: | 252 case dv_audio_recdate: |
253 case dv_viedo_recdate: /* VAUX recording date */ | 253 case dv_viedo_recdate: /* VAUX recording date */ |
254 ct = c->start_time + (time_t)(c->frames / | 254 ct = c->start_time + (time_t)(c->frames / |
255 ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base)); | 255 ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base)); |
256 gmtime_r(&ct, &tc); | 256 brktimegm(ct, &tc); |
257 buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */ | 257 buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */ |
258 /* 0xff is very likely to be "unknown" */ | 258 /* 0xff is very likely to be "unknown" */ |
259 buf[2] = (3 << 6) | /* reserved -- always 1 */ | 259 buf[2] = (3 << 6) | /* reserved -- always 1 */ |
260 ((tc.tm_mday / 10) << 4) | /* Tens of day */ | 260 ((tc.tm_mday / 10) << 4) | /* Tens of day */ |
261 (tc.tm_mday % 10); /* Units of day */ | 261 (tc.tm_mday % 10); /* Units of day */ |
262 buf[3] = /* we set high 4 bits to 0, shouldn't we set them to week? */ | 262 buf[3] = /* we set high 4 bits to 0, shouldn't we set them to week? */ |
263 (((tc.tm_mon + 1) / 10) << 4) | /* Tens of month */ | 263 ((tc.tm_mon / 10) << 4) | /* Tens of month */ |
264 ((tc.tm_mon + 1) % 10); /* Units of month */ | 264 (tc.tm_mon % 10); /* Units of month */ |
265 buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */ | 265 buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */ |
266 (tc.tm_year % 10); /* Units of year */ | 266 (tc.tm_year % 10); /* Units of year */ |
267 break; | 267 break; |
268 case dv_audio_rectime: /* AAUX recording time */ | 268 case dv_audio_rectime: /* AAUX recording time */ |
269 case dv_video_rectime: /* VAUX recording time */ | 269 case dv_video_rectime: /* VAUX recording time */ |
270 ct = c->start_time + (time_t)(c->frames / | 270 ct = c->start_time + (time_t)(c->frames / |
271 ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base)); | 271 ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base)); |
272 gmtime_r(&ct, &tc); | 272 brktimegm(ct, &tc); |
273 buf[1] = (3 << 6) | /* reserved -- always 1 */ | 273 buf[1] = (3 << 6) | /* reserved -- always 1 */ |
274 0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */ | 274 0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */ |
275 buf[2] = (1 << 7) | /* reserved -- always 1 */ | 275 buf[2] = (1 << 7) | /* reserved -- always 1 */ |
276 ((tc.tm_sec / 10) << 4) | /* Tens of seconds */ | 276 ((tc.tm_sec / 10) << 4) | /* Tens of seconds */ |
277 (tc.tm_sec % 10); /* Units of seconds */ | 277 (tc.tm_sec % 10); /* Units of seconds */ |