When the hlsenc at BYTERANGE mode, it should not show the warning message: "Duplicated segment filename detected:"
Unified · Split
| @@ -722,6 +722,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double · 721 unmodified lines | ||
| 722 | 722 | { |
| 723 | 723 | HLSSegment *en = av_malloc(sizeof(*en)); |
| 724 | 724 | const char *filename; |
| 725 | + int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 0); | |
| 725 | 726 | int ret; |
| 726 | 727 | |
| 727 | 728 | if (!en) |
| @@ -737,8 +738,8 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double · 9 unmodified lines | ||
| 737 | 738 | if (hls->use_localtime_mkdir) { |
| 738 | 739 | filename = hls->avf->filename; |
| 739 | 740 | } |
| 740 | − if (find_segment_by_filename(hls->segments, filename) | |
| 741 | − || find_segment_by_filename(hls->old_segments, filename)) { | |
| 741 | + if ((find_segment_by_filename(hls->segments, filename) || find_segment_by_filename(hls->old_segments, filename)) | |
| 742 | + && !byterange_mode) { | |
| 742 | 743 | av_log(hls, AV_LOG_WARNING, "Duplicated segment filename detected: %s\n", filename); |
| 743 | 744 | } |
| 744 | 745 | av_strlcpy(en->filename, filename, sizeof(en->filename)); |