| 608 | } |
| 609 | |
| 610 | int 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 | |
| 626 | static const AVOption* find_opt(void *obj, const char *name, size_t len) |
| 627 | { |
no test coverage detected