]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/file.c
amr: set channel_layout
[ffmpeg] / libavformat / file.c
index 3ea681fd9f13f1927fb929155892736ab478385c..c552a9eaa58c544285413d99a6f160441ea3da22 100644 (file)
@@ -121,12 +121,18 @@ 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;
+    int64_t ret;
+
     if (whence == AVSEEK_SIZE) {
         struct stat st;
-        int ret = fstat(c->fd, &st);
+
+        ret = fstat(c->fd, &st);
         return ret < 0 ? AVERROR(errno) : 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)