aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/cache.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-26 12:11:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-26 12:41:15 +0100
commit0704c44d68704df63eccd5579e66e5f218a378a6 (patch)
tree735c35c7105337f21d75bf32dc78c67827a7909e /libavformat/cache.c
parentafaa4a89463187fe98042ba6bab0269ba4b4ba47 (diff)
downloadffmpeg-0704c44d68704df63eccd5579e66e5f218a378a6.tar.gz
avformat/cache: remove ftruncate usage, its not always available
In case of errors the cache file will be slightly larger than needed, this should have no practical relevance though Should fix build on VS201* Found-by: jamrial Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/cache.c')
-rw-r--r--libavformat/cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/cache.c b/libavformat/cache.c
index f6787ee6cf..02b02bbf54 100644
--- a/libavformat/cache.c
+++ b/libavformat/cache.c
@@ -145,8 +145,8 @@ static int add_entry(URLContext *h, const unsigned char *buf, int size)
return 0;
fail:
- if (pos >= 0)
- ftruncate(c->fd, pos);
+ //we could truncate the file to pos here if pos >=0 but ftruncate isnt available in VS so
+ //for simplicty we just leave the file a bit larger
av_free(entry);
av_free(node);
return ret;