diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-18 01:22:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-18 01:22:14 +0100 |
commit | d3316c3f85c291f6875e3cc56dae2ccea1f15f09 (patch) | |
tree | dba644ba851a517bfb896148a30307f52ffef186 /libavformat/hdsenc.c | |
parent | 324797eb83dff7708a464e2ff61dd1551cc5c058 (diff) | |
parent | 19fc283dbb53a5f7d6658fd4edcfa59b99369b58 (diff) | |
download | ffmpeg-d3316c3f85c291f6875e3cc56dae2ccea1f15f09.tar.gz |
Merge commit '19fc283dbb53a5f7d6658fd4edcfa59b99369b58' into release/2.4
* commit '19fc283dbb53a5f7d6658fd4edcfa59b99369b58':
lavf: replace rename() with ff_rename()
Conflicts:
libavformat/hdsenc.c
libavformat/internal.h
See: 95d2fc6a76f3e0a98329f1ca70f98e7c085f0abf
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hdsenc.c')
-rw-r--r-- | libavformat/hdsenc.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c index 7530aa9150..9182ca40ee 100644 --- a/libavformat/hdsenc.c +++ b/libavformat/hdsenc.c @@ -204,11 +204,7 @@ static int write_manifest(AVFormatContext *s, int final) avio_printf(out, "</manifest>\n"); avio_flush(out); avio_close(out); - if (rename(temp_filename, filename) == -1) { - av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", temp_filename, filename); - return AVERROR(errno); - } - return 0; + return ff_rename(temp_filename, filename); } static void update_size(AVIOContext *out, int64_t pos) @@ -289,11 +285,7 @@ static int write_abst(AVFormatContext *s, OutputStream *os, int final) update_size(out, afrt_pos); update_size(out, 0); avio_close(out); - if (rename(temp_filename, filename) == -1) { - av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", temp_filename, filename); - return AVERROR(errno); - } - return 0; + return ff_rename(temp_filename, filename); } static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts) @@ -487,10 +479,9 @@ static int hds_flush(AVFormatContext *s, OutputStream *os, int final, snprintf(target_filename, sizeof(target_filename), "%s/stream%dSeg1-Frag%d", s->filename, index, os->fragment_index); - if (rename(os->temp_filename, target_filename) == -1) { - av_log(s, AV_LOG_ERROR, "failed to rename file %s to %s\n", os->temp_filename, target_filename); - return AVERROR(errno); - } + ret = ff_rename(os->temp_filename, target_filename); + if (ret < 0) + return ret; add_fragment(os, target_filename, os->frag_start_ts, end_ts - os->frag_start_ts); if (!final) { |