MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_dict_set_timestamp

Function ff_dict_set_timestamp

libavformat/utils.c:610–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608}
609
610int ff_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp)
611{
612 time_t seconds = timestamp / 1000000;
613 struct tm *ptm, tmbuf;
614 ptm = gmtime_r(&seconds, &tmbuf);
615 if (ptm) {
616 char buf[32];
617 if (!strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S", ptm))
618 return AVERROR_EXTERNAL;
619 av_strlcatf(buf, sizeof(buf), ".%06dZ", (int)(timestamp % 1000000));
620 return av_dict_set(dict, key, buf, 0);
621 } else {
622 return AVERROR_EXTERNAL;
623 }
624}
625
626static const AVOption* find_opt(void *obj, const char *name, size_t len)
627{

Callers 5

parse_headerFunction · 0.85
amf_parse_objectFunction · 0.85

Calls 2

av_strlcatfFunction · 0.85
av_dict_setFunction · 0.85

Tested by

no test coverage detected