aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2017-06-19 10:35:41 +0800
committerSteven Liu <lq@chinaffmpeg.org>2017-06-19 10:35:41 +0800
commit3996ae930256f5c387f2d2e46908b7c433efc588 (patch)
treea4f29cf917416a176c7f3a282a390eda78e77f26 /libavformat/hlsenc.c
parent8bb59e6742eeb00a418e49ef8ea601d1d637e51a (diff)
downloadffmpeg-3996ae930256f5c387f2d2e46908b7c433efc588.tar.gz
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:" Reported-by: Marco <marco@worldcast.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 7ed121a5dd..40143c86aa 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -722,6 +722,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double
{
HLSSegment *en = av_malloc(sizeof(*en));
const char *filename;
+ int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 0);
int ret;
if (!en)
@@ -737,8 +738,8 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double
if (hls->use_localtime_mkdir) {
filename = hls->avf->filename;
}
- if (find_segment_by_filename(hls->segments, filename)
- || find_segment_by_filename(hls->old_segments, filename)) {
+ if ((find_segment_by_filename(hls->segments, filename) || find_segment_by_filename(hls->old_segments, filename))
+ && !byterange_mode) {
av_log(hls, AV_LOG_WARNING, "Duplicated segment filename detected: %s\n", filename);
}
av_strlcpy(en->filename, filename, sizeof(en->filename));