| 642 | } |
| 643 | |
| 644 | static void format_date(char *buf, int size, int64_t time_us) |
| 645 | { |
| 646 | struct tm *ptm, tmbuf; |
| 647 | int64_t time_ms = time_us / 1000; |
| 648 | const time_t time_s = time_ms / 1000; |
| 649 | int millisec = time_ms - (time_s * 1000); |
| 650 | ptm = gmtime_r(&time_s, &tmbuf); |
| 651 | if (ptm) { |
| 652 | int len; |
| 653 | if (!strftime(buf, size, "%Y-%m-%dT%H:%M:%S", ptm)) { |
| 654 | buf[0] = '\0'; |
| 655 | return; |
| 656 | } |
| 657 | len = strlen(buf); |
| 658 | snprintf(buf + len, size - len, ".%03dZ", millisec); |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | static int write_adaptation_set(AVFormatContext *s, AVIOContext *out, int as_index, |
| 663 | int final) |
no outgoing calls
no test coverage detected