[FFmpeg-cvslog] r17011 - trunk/libavformat/mxfenc.c
Reimar Döffinger
Reimar.Doeffinger
Thu Feb 5 23:18:54 CET 2009
On Thu, Feb 05, 2009 at 02:07:18PM -0800, Baptiste Coudurier wrote:
> On 2/5/2009 1:03 PM, Reimar D?ffinger wrote:
> > On Thu, Feb 05, 2009 at 09:15:18PM +0100, bcoudurier wrote:
> >> +static uint64_t mxf_parse_timestamp(time_t timestamp)
> >> +{
> >> + struct tm *time = localtime(×tamp);
> >> + return (uint64_t)(time->tm_year+1900)<< 48 |
> >> + (uint64_t)(time->tm_mon+1)<< 40 |
> >> + (uint64_t) time->tm_mday<< 32 |
> >> + time->tm_hour<< 24 |
> >> + time->tm_min<< 16 |
> >> + time->tm_sec<< 8;
> >> +}
> >
> > Huh, the time is stored in a timezone-dependent format without storing
> > the time zone?
>
> Seems so, anyway I don't make the specs.
>
> Besides which format specifies the time zone ?
> mov/mp4 doesn't, at least.
I would assume if they don't specify a time zone they use UTC/GMT.
> > Anyway, you can not use localtime, it is not thread-safe.
>
> localtime is used in libavformat parse_date, though this is not an
> argument. How important is the thread safety here ?
> It is really not like time having 1 second difference is a problem, no ?
Huh? Why onw second time difference? The point is that when by chance
the user application calls localtime at the same time as libavformat
both will get a random combination of both times.
I'd say these functions should be added to the forbidden-functions list
like printf etc.
More information about the ffmpeg-cvslog
mailing list