]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/internal.h
mpegtsenc: recognize .mts as MPEG Transport Stream
[ffmpeg] / libavformat / internal.h
index c66a0458efd482ddebcfa1f7c62366c11d8a0943..d10c5433d0a8d45dbf4a2c38109ad780c029c9c8 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <stdint.h>
 #include "avformat.h"
+#include "os_support.h"
 
 #define MAX_URL_SIZE 4096
 
@@ -351,4 +352,18 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags);
  */
 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;
+}
+
 #endif /* AVFORMAT_INTERNAL_H */