aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/internal.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-25 04:24:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-25 04:24:16 +0200
commit97a8f4dd119e76218ede40bd94b562f94c79b9e7 (patch)
tree3b7ac1b3cf01d859f2545012a8411fff4114c66d /libavformat/internal.h
parentaf89c144181f4a7003477c22a88d40b366b42a7c (diff)
parent7785ce1c769369abf85b276148548a5510aabb5f (diff)
downloadffmpeg-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/internal.h')
-rw-r--r--libavformat/internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 28c29b0f4e..d2aab30982 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -372,6 +372,20 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precisio
int ff_generate_avci_extradata(AVStream *st);
/**
+ * Wrap errno on rename() error.
+ *
+ * @param oldpath source path
+ * @param newpath destination path
+ * @return 0 or AVERROR on failure
+ */
+static inline int ff_rename(const char *oldpath, const char *newpath)
+{
+ if (rename(oldpath, newpath) == -1)
+ return AVERROR(errno);
+ return 0;
+}
+
+/**
* Allocate extradata with additional FF_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0.
*