diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-25 02:14:15 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-25 02:14:15 +0100 |
commit | 71ecfcf2d31e4f906f52c3450f4fb46c5087f50e (patch) | |
tree | 2b1e8944703b072c4ce61b751147e912a08480ed /libavformat/smoothstreamingenc.c | |
parent | b83beb131f0d3fdb2d472665f5325f02aeac7d7e (diff) | |
parent | b9d08c77a44390b0848c06f20bc0e9e951ba6a3c (diff) | |
download | ffmpeg-71ecfcf2d31e4f906f52c3450f4fb46c5087f50e.tar.gz |
Merge commit 'b9d08c77a44390b0848c06f20bc0e9e951ba6a3c'
* commit 'b9d08c77a44390b0848c06f20bc0e9e951ba6a3c':
lavf: Don't try to update files atomically with renames on windows
Conflicts:
libavformat/dashenc.c
libavformat/hdsenc.c
libavformat/internal.h
libavformat/smoothstreamingenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/smoothstreamingenc.c')
-rw-r--r-- | libavformat/smoothstreamingenc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index d6cdf90f52..94cc8e7a60 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -215,14 +215,16 @@ static int write_manifest(AVFormatContext *s, int final) SmoothStreamingContext *c = s->priv_data; AVIOContext *out; char filename[1024], temp_filename[1024]; + const char *write_filename; int ret, i, video_chunks = 0, audio_chunks = 0, video_streams = 0, audio_streams = 0; int64_t duration = 0; snprintf(filename, sizeof(filename), "%s/Manifest", s->filename); snprintf(temp_filename, sizeof(temp_filename), "%s/Manifest.tmp", s->filename); - ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); + write_filename = USE_RENAME_REPLACE ? temp_filename : filename; + ret = avio_open2(&out, write_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); + av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", write_filename); return ret; } avio_printf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); @@ -283,7 +285,7 @@ static int write_manifest(AVFormatContext *s, int final) avio_printf(out, "</SmoothStreamingMedia>\n"); avio_flush(out); avio_close(out); - return ff_rename(temp_filename, filename, s); + return USE_RENAME_REPLACE ? ff_rename(temp_filename, filename, s) : 0; } static int ism_write_header(AVFormatContext *s) |