]> git.sesse.net Git - ffmpeg/commitdiff
avformat/avio: move ff_rename implementation from internal.h to avio.c
authorMarton Balint <cus@passwd.hu>
Wed, 8 Jan 2020 22:50:41 +0000 (23:50 +0100)
committerMarton Balint <cus@passwd.hu>
Sun, 19 Jan 2020 21:17:04 +0000 (22:17 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/avio.c
libavformat/internal.h

index 2dd231229602a544e64a19ef7a8d1fa0be28068f..8c2c85f1714cd6e7503da06a606d05194d781334 100644 (file)
@@ -26,6 +26,7 @@
 #include "libavutil/avassert.h"
 #include "os_support.h"
 #include "avformat.h"
+#include "internal.h"
 #if CONFIG_NETWORK
 #include "network.h"
 #endif
@@ -665,3 +666,17 @@ int ff_check_interrupt(AVIOInterruptCB *cb)
         return cb->callback(cb->opaque);
     return 0;
 }
+
+int ff_rename(const char *oldpath, const char *newpath, void *logctx)
+{
+    int ret = 0;
+    if (rename(oldpath, newpath) == -1) {
+        ret = AVERROR(errno);
+        if (logctx) {
+            char err[AV_ERROR_MAX_STRING_SIZE] = {0};
+            av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, ret);
+            av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s: %s\n", oldpath, newpath, err);
+        }
+    }
+    return ret;
+}
index ec9a29907a19c77d7a135fb254c998cf78097d47..da09983083b8264243cd3c17fb424b3b612cae4c 100644 (file)
@@ -586,19 +586,7 @@ int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src);
  * @param newpath destination path
  * @return        0 or AVERROR on failure
  */
-static inline int ff_rename(const char *oldpath, const char *newpath, void *logctx)
-{
-    int ret = 0;
-    if (rename(oldpath, newpath) == -1) {
-        ret = AVERROR(errno);
-        if (logctx) {
-            char err[AV_ERROR_MAX_STRING_SIZE] = {0};
-            av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, ret);
-            av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s: %s\n", oldpath, newpath, err);
-        }
-    }
-    return ret;
-}
+int ff_rename(const char *oldpath, const char *newpath, void *logctx);
 
 /**
  * Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end