aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/internal.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-25 13:04:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-25 13:28:51 +0200
commit92d366f6abf85ebff5f0562894c8f94ebe80f114 (patch)
tree0a11b8ce02d62bab32d599cc5065b34127b8998c /libavformat/internal.h
parenteeb9242b623c76bdda0ef842cf95d3dc03ca3b60 (diff)
downloadffmpeg-92d366f6abf85ebff5f0562894c8f94ebe80f114.tar.gz
avformat: Print error message on failure of ff_rename()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/internal.h')
-rw-r--r--libavformat/internal.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h
index d2aab30982..f7a79dd8d7 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -378,11 +378,15 @@ int ff_generate_avci_extradata(AVStream *st);
* @param newpath destination path
* @return 0 or AVERROR on failure
*/
-static inline int ff_rename(const char *oldpath, const char *newpath)
+static inline int ff_rename(const char *oldpath, const char *newpath, void *logctx)
{
- if (rename(oldpath, newpath) == -1)
- return AVERROR(errno);
- return 0;
+ int ret = 0;
+ if (rename(oldpath, newpath) == -1) {
+ ret = AVERROR(errno);
+ if (logctx)
+ av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s\n", oldpath, newpath);
+ }
+ return ret;
}
/**