diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-25 04:24:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-25 04:24:16 +0200 |
commit | 97a8f4dd119e76218ede40bd94b562f94c79b9e7 (patch) | |
tree | 3b7ac1b3cf01d859f2545012a8411fff4114c66d /libavformat/smoothstreamingenc.c | |
parent | af89c144181f4a7003477c22a88d40b366b42a7c (diff) | |
parent | 7785ce1c769369abf85b276148548a5510aabb5f (diff) | |
download | ffmpeg-97a8f4dd119e76218ede40bd94b562f94c79b9e7.tar.gz |
Merge commit '7785ce1c769369abf85b276148548a5510aabb5f'
* commit '7785ce1c769369abf85b276148548a5510aabb5f':
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/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 7fbb2b7d7f..fa9984a50d 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -34,6 +34,7 @@ #include "libavutil/opt.h" #include "libavutil/avstring.h" +#include "libavutil/file.h" #include "libavutil/mathematics.h" #include "libavutil/intreadwrite.h" @@ -282,8 +283,7 @@ static int write_manifest(AVFormatContext *s, int final) avio_printf(out, "</SmoothStreamingMedia>\n"); avio_flush(out); avio_close(out); - rename(temp_filename, filename); - return 0; + return ff_rename(temp_filename, filename); } static int ism_write_header(AVFormatContext *s) @@ -540,7 +540,9 @@ static int ism_flush(AVFormatContext *s, int final) snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); snprintf(target_filename, sizeof(target_filename), "%s/Fragments(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); copy_moof(s, filename, header_filename, moof_size); - rename(filename, target_filename); + ret = ff_rename(filename, target_filename); + if (ret < 0) + break; add_fragment(os, target_filename, header_filename, start_ts, duration, os->cur_start_pos, size); } |