[FFmpeg-cvslog] r17172 - in trunk/libavformat: avformat.h ffmdec.c

bcoudurier subversion
Thu Feb 12 03:15:07 CET 2009


Author: bcoudurier
Date: Thu Feb 12 03:15:07 2009
New Revision: 17172

Log:
Change ffm_write_write_index to return int, and return if error occured.
Patch by Patrik Kullman, patrik at yes dot nu

Modified:
   trunk/libavformat/avformat.h
   trunk/libavformat/ffmdec.c

Modified: trunk/libavformat/avformat.h
==============================================================================
--- trunk/libavformat/avformat.h	Thu Feb 12 03:02:42 2009	(r17171)
+++ trunk/libavformat/avformat.h	Thu Feb 12 03:15:07 2009	(r17172)
@@ -1180,7 +1180,7 @@ int64_t av_gettime(void);
 /* ffm-specific for ffserver */
 #define FFM_PACKET_SIZE 4096
 int64_t ffm_read_write_index(int fd);
-void ffm_write_write_index(int fd, int64_t pos);
+int ffm_write_write_index(int fd, int64_t pos);
 void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
 
 /**

Modified: trunk/libavformat/ffmdec.c
==============================================================================
--- trunk/libavformat/ffmdec.c	Thu Feb 12 03:02:42 2009	(r17171)
+++ trunk/libavformat/ffmdec.c	Thu Feb 12 03:15:07 2009	(r17172)
@@ -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
     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)




More information about the ffmpeg-cvslog mailing list