| 319 | } |
| 320 | |
| 321 | static void segment_list_print_entry(AVIOContext *list_ioctx, |
| 322 | ListType list_type, |
| 323 | const SegmentListEntry *list_entry, |
| 324 | void *log_ctx) |
| 325 | { |
| 326 | switch (list_type) { |
| 327 | case LIST_TYPE_FLAT: |
| 328 | avio_printf(list_ioctx, "%s\n", list_entry->filename); |
| 329 | break; |
| 330 | case LIST_TYPE_CSV: |
| 331 | case LIST_TYPE_EXT: |
| 332 | print_csv_escaped_str(list_ioctx, list_entry->filename); |
| 333 | avio_printf(list_ioctx, ",%f,%f\n", list_entry->start_time, list_entry->end_time); |
| 334 | break; |
| 335 | case LIST_TYPE_M3U8: |
| 336 | avio_printf(list_ioctx, "#EXTINF:%f,\n%s\n", |
| 337 | list_entry->end_time - list_entry->start_time, list_entry->filename); |
| 338 | break; |
| 339 | case LIST_TYPE_FFCONCAT: |
| 340 | { |
| 341 | char *buf; |
| 342 | if (av_escape(&buf, list_entry->filename, NULL, AV_ESCAPE_MODE_AUTO, AV_ESCAPE_FLAG_WHITESPACE) < 0) { |
| 343 | av_log(log_ctx, AV_LOG_WARNING, |
| 344 | "Error writing list entry '%s' in list file\n", list_entry->filename); |
| 345 | return; |
| 346 | } |
| 347 | avio_printf(list_ioctx, "file %s\n", buf); |
| 348 | av_free(buf); |
| 349 | break; |
| 350 | } |
| 351 | default: |
| 352 | av_assert0(!"Invalid list type"); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | static int segment_end(AVFormatContext *s, int write_trailer, int is_last) |
| 357 | { |
no test coverage detected