]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp4: Remove the membuffer error bit.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 14 Aug 2021 20:53:39 +0000 (22:53 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
Due to the previous cleanups, it is never set, so remove all code
which checks whether the bit is set.

mp4.c

diff --git a/mp4.c b/mp4.c
index 76cc6737766033508f4691e93fde59b75728c56c..869a6f6d9446a93a5a42c2f52663249b4e7d5bee 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -1143,7 +1143,6 @@ struct membuffer {
        void *data;
        unsigned written;
        unsigned allocated;
-       unsigned error;
 };
 
 static struct membuffer *membuffer_create(void)
@@ -1159,8 +1158,6 @@ static unsigned membuffer_write(struct membuffer *buf, const void *ptr, unsigned
 {
        unsigned dest_size = buf->written + bytes;
 
-       if (buf->error)
-               return 0;
        if (dest_size > buf->allocated) {
                do {
                        buf->allocated <<= 1;
@@ -1204,11 +1201,6 @@ static void membuffer_write_std_tag(struct membuffer *buf, const char *name,
        membuffer_write(buf, value, len);
 }
 
-static unsigned membuffer_error(const struct membuffer *buf)
-{
-       return buf->error;
-}
-
 static void membuffer_free(struct membuffer *buf)
 {
        free(buf->data);
@@ -1222,11 +1214,7 @@ static unsigned membuffer_get_size(const struct membuffer *buf)
 
 static void *membuffer_detach(struct membuffer *buf)
 {
-       void *ret;
-
-       if (buf->error)
-               return 0;
-       ret = para_realloc(buf->data, buf->written);
+       void *ret = para_realloc(buf->data, buf->written);
        free(buf);
        return ret;
 }
@@ -1266,11 +1254,6 @@ static uint32_t create_ilst(const struct mp4_metadata *meta, void **out_buffer,
                else
                        PARA_ERROR_LOG("invalid tag item: %s\n", tag->item);
        }
-       if (membuffer_error(buf)) {
-               membuffer_free(buf);
-               return 0;
-       }
-
        *out_size = membuffer_get_size(buf);
        *out_buffer = membuffer_detach(buf);
        return 1;