History

avformat/hlsenc: donnot show duplicate segment warning at byterange mode

When the hlsenc at BYTERANGE mode, it should not show the warning message: "Duplicated segment filename detected:"

Steven Liu committed 9 years ago

Commit 3996ae91 parent 8bb59e61 file · +3 −2Browse files

Unified · Split

libavformat/hlsenc.c+3−2
@@ -722,6 +722,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double · 721 unmodified lines
722722 {
723723 HLSSegment *en = av_malloc(sizeof(*en));
724724 const char *filename;
725+ int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 0);
725726 int ret;
726727
727728 if (!en)
@@ -737,8 +738,8 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double · 9 unmodified lines
737738 if (hls->use_localtime_mkdir) {
738739 filename = hls->avf->filename;
739740 }
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) {
742743 av_log(hls, AV_LOG_WARNING, "Duplicated segment filename detected: %s\n", filename);
743744 }
744745 av_strlcpy(en->filename, filename, sizeof(en->filename));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t