aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/ffmdec.c
diff options
context:
space:
mode:
authorPatrik Kullman <patrik@yes.nu>2009-02-12 02:15:07 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-12 02:15:07 +0000
commit6fcce4f995df3c6c44b16a810b772f529e9aa6bf (patch)
tree1b40cd43cc638e778db33417c39273270f0d3df4 /libavformat/ffmdec.c
parent22009729d7acba3f79a7d0012fec4aadf4025abc (diff)
downloadffmpeg-6fcce4f995df3c6c44b16a810b772f529e9aa6bf.tar.gz
Change ffm_write_write_index to return int, and return if error occured.
Patch by Patrik Kullman, patrik at yes dot nu Originally committed as revision 17172 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ffmdec.c')
-rw-r--r--libavformat/ffmdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 9951d756ea..6f96c719ab 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -34,7 +34,7 @@ int64_t ffm_read_write_index(int fd)
return AV_RB64(buf);
}
-void ffm_write_write_index(int fd, int64_t pos)
+int ffm_write_write_index(int fd, int64_t pos)
{
uint8_t buf[8];
int i;
@@ -42,7 +42,9 @@ void ffm_write_write_index(int fd, int64_t pos)
for(i=0;i<8;i++)
buf[i] = (pos >> (56 - i * 8)) & 0xff;
lseek(fd, 8, SEEK_SET);
- write(fd, buf, 8);
+ if (write(fd, buf, 8) != 8)
+ return AVERROR(EIO);
+ return 8;
}
void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size)