diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-21 19:27:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-23 16:53:36 +0100 |
commit | 6c9537b807e587960d4dd73fa6f68d0280a49f92 (patch) | |
tree | 301473acaec67bf3fb080c39efe3587218da5005 | |
parent | 665916ffa2ad4f7d628139556b8e888da285a9af (diff) | |
download | ffmpeg-6c9537b807e587960d4dd73fa6f68d0280a49f92.tar.gz |
avformat/hlsenc: Warn if a non file protocol is used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/hlsenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index bf7910991f..788535162a 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -247,6 +247,10 @@ static int hls_window(AVFormatContext *s, int last) int version = hls->flags & HLS_SINGLE_FILE ? 4 : 3; const char *proto = avio_find_protocol_name(s->filename); int use_rename = proto && !strcmp(proto, "file"); + static unsigned warned_non_file; + + if (!use_rename && !warned_non_file++) + av_log(s, AV_LOG_ERROR, "Cannot use rename on non file protocol, this may lead to races and temporarly partial files\n"); snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", s->filename); if ((ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, |