summaryrefslogtreecommitdiff
path: root/libavformat/internal.h
diff options
context:
space:
mode:
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.
*