Browse Source

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>
tags/n2.6
Michael Niedermayer 10 years ago
parent
commit
0704c44d68
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/cache.c

+ 2
- 2
libavformat/cache.c View File

@@ -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;


Loading…
Cancel
Save