diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-27 11:52:33 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-27 11:52:33 +0100 |
commit | 4ae1d6021be96dcded093e51d04294075b14e511 (patch) | |
tree | 44fbc8a90455083052c15e2e19ff5c2f42a3221d /libavformat/hdsenc.c | |
parent | cc663bd13a97a92a3b3ba838393e77f2e1c490ad (diff) | |
parent | 675ac56b7ee0f204963fde55295197c5df80aa91 (diff) | |
download | ffmpeg-4ae1d6021be96dcded093e51d04294075b14e511.tar.gz |
Merge commit '675ac56b7ee0f204963fde55295197c5df80aa91'
* commit '675ac56b7ee0f204963fde55295197c5df80aa91':
Revert "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/hdsenc.c')
-rw-r--r-- | libavformat/hdsenc.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c index b2d82e9925..33d7c3a3a8 100644 --- a/libavformat/hdsenc.c +++ b/libavformat/hdsenc.c @@ -163,7 +163,6 @@ static int write_manifest(AVFormatContext *s, int final) HDSContext *c = s->priv_data; AVIOContext *out; char filename[1024], temp_filename[1024]; - const char *write_filename; int ret, i; float duration = 0; @@ -172,11 +171,10 @@ static int write_manifest(AVFormatContext *s, int final) snprintf(filename, sizeof(filename), "%s/index.f4m", s->filename); snprintf(temp_filename, sizeof(temp_filename), "%s/index.f4m.tmp", s->filename); - write_filename = USE_RENAME_REPLACE ? temp_filename : filename; - ret = avio_open2(&out, write_filename, AVIO_FLAG_WRITE, + ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", write_filename); + av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); return ret; } avio_printf(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); @@ -206,7 +204,7 @@ static int write_manifest(AVFormatContext *s, int final) avio_printf(out, "</manifest>\n"); avio_flush(out); avio_close(out); - return USE_RENAME_REPLACE ? ff_rename(temp_filename, filename, s) : 0; + return ff_rename(temp_filename, filename, s); } static void update_size(AVIOContext *out, int64_t pos) @@ -225,7 +223,6 @@ static int write_abst(AVFormatContext *s, OutputStream *os, int final) HDSContext *c = s->priv_data; AVIOContext *out; char filename[1024], temp_filename[1024]; - const char *write_filename; int i, ret; int64_t asrt_pos, afrt_pos; int start = 0, fragments; @@ -243,11 +240,10 @@ static int write_abst(AVFormatContext *s, OutputStream *os, int final) "%s/stream%d.abst", s->filename, index); snprintf(temp_filename, sizeof(temp_filename), "%s/stream%d.abst.tmp", s->filename, index); - write_filename = USE_RENAME_REPLACE ? temp_filename : filename; - ret = avio_open2(&out, write_filename, AVIO_FLAG_WRITE, + ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", write_filename); + av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); return ret; } avio_wb32(out, 0); // abst size @@ -289,7 +285,7 @@ static int write_abst(AVFormatContext *s, OutputStream *os, int final) update_size(out, afrt_pos); update_size(out, 0); avio_close(out); - return USE_RENAME_REPLACE ? ff_rename(temp_filename, filename, s) : 0; + return ff_rename(temp_filename, filename, s); } static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts) |