]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
mp4: Implement error checking for the write path.
[paraslash.git] / aac_afh.c
index f3a06c4c213c80fad95158d8c33b18fafa43e33a..0a80bfcf3a44205ea7d42f9ac260c03f910ba199 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -173,10 +173,10 @@ static uint32_t aac_afh_meta_seek_cb(void *user_data, uint64_t pos)
        return lseek(fd, pos, SEEK_SET);
 }
 
-static uint32_t aac_afh_meta_write_cb(void *user_data, void *dest, uint32_t want)
+static ssize_t aac_afh_meta_write_cb(void *user_data, void *dest, size_t count)
 {
        int fd = *(int *)user_data;
-       return write(fd, dest, want);
+       return write(fd, dest, count);
 }
 
 static uint32_t aac_afh_meta_truncate_cb(void *user_data)
@@ -238,11 +238,7 @@ static int aac_afh_rewrite_tags(const char *map, size_t mapsize,
        replace_or_add_tag("album", tags->album, metadata);
        replace_or_add_tag("date", tags->year, metadata);
        replace_or_add_tag("comment", tags->comment, metadata);
-       ret = -E_MP4_META_WRITE;
-       if (!mp4_meta_update(mp4))
-               goto close;
-       ret = 1;
-close:
+       ret = mp4_meta_update(mp4);
        mp4_close(mp4);
        return ret;
 }