diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-17 15:12:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-17 15:15:43 +0200 |
commit | 291b220377d43adbecc86da84f43aed547957ffc (patch) | |
tree | 1ed87946e01e30c2b989c8822503c61ff99ad0c8 /libavformat/file.c | |
parent | 1ad63ff14adb652996c4604da59a330cef0d494e (diff) | |
parent | 2f34021d57b1343bb01b377a4797bef7cbc7be3c (diff) | |
download | ffmpeg-291b220377d43adbecc86da84f43aed547957ffc.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avconv: flush filtered frames before reconfiguring filters
mov: stsd entries must be at least 16 byte
mov: detect EOF in mov_read_dref()
file: return proper error on seek failures
Conflicts:
libavformat/file.c
libavformat/mov.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/file.c')
-rw-r--r-- | libavformat/file.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/file.c b/libavformat/file.c index e21148e2b4..defe3165e2 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -135,12 +135,17 @@ static int file_open(URLContext *h, const char *filename, int flags) static int64_t file_seek(URLContext *h, int64_t pos, int whence) { FileContext *c = h->priv_data; + int ret; + if (whence == AVSEEK_SIZE) { struct stat st; - int ret = fstat(c->fd, &st); + ret = fstat(c->fd, &st); return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : st.st_size); } - return lseek(c->fd, pos, whence); + + ret = lseek(c->fd, pos, whence); + + return ret < 0 ? AVERROR(errno) : ret; } static int file_close(URLContext *h) |