diff ffmdec.c @ 4458:f734aba9452e libavformat

Change ffm_write_write_index to return int, and return if error occured. Patch by Patrik Kullman, patrik at yes dot nu
author bcoudurier
date Thu, 12 Feb 2009 02:15:07 +0000
parents 376664156fe2
children 241532434509
line wrap: on
line diff
--- a/ffmdec.c	Thu Feb 12 00:08:44 2009 +0000
+++ b/ffmdec.c	Thu Feb 12 02:15:07 2009 +0000
@@ -34,7 +34,7 @@
     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 @@
     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)