]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/file.c
h263dec: restore error concealment functionality after merge
[ffmpeg] / libavformat / file.c
index a9c5281102d3fb8c6410eba7633562ae54358bfd..1352bcc54637f6d0a33752a64101a89ef2b3db56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Buffered file io for ffmpeg system
+ * buffered file I/O
  * Copyright (c) 2001 Fabrice Bellard
  *
  * This file is part of FFmpeg.
 static int file_read(URLContext *h, unsigned char *buf, int size)
 {
     int fd = (intptr_t) h->priv_data;
-    return read(fd, buf, size);
+    int r = read(fd, buf, size);
+    return (-1 == r)?AVERROR(errno):r;
 }
 
 static int file_write(URLContext *h, const unsigned char *buf, int size)
 {
     int fd = (intptr_t) h->priv_data;
-    return write(fd, buf, size);
+    int r = write(fd, buf, size);
+    return (-1 == r)?AVERROR(errno):r;
 }
 
 static int file_get_handle(URLContext *h)