[FFmpeg-cvslog] avformat/avio: move ff_rename implementation from internal.h to avio.c

Marton Balint git at videolan.org
Sun Jan 19 23:36:00 EET 2020


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Wed Jan  8 23:50:41 2020 +0100| [df993269ecb970502a0ecdbe21f35e376fc9194c] | committer: Marton Balint

avformat/avio: move ff_rename implementation from internal.h to avio.c

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df993269ecb970502a0ecdbe21f35e376fc9194c
---

 libavformat/avio.c     | 15 +++++++++++++++
 libavformat/internal.h | 14 +-------------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 2dd2312296..8c2c85f171 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -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;
+}
diff --git a/libavformat/internal.h b/libavformat/internal.h
index ec9a29907a..da09983083 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -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



More information about the ffmpeg-cvslog mailing list