]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mp4.c
mp4: Make sample number be an unsigned parameter.
[paraslash.git] / mp4.c
diff --git a/mp4.c b/mp4.c
index 9ed0fcbb4dfbfaa07b53893e7e021607a17636ad..869b80fa966dbcef2d039935a4a44053d21f963b 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -655,7 +655,7 @@ uint64_t mp4_get_duration(const struct mp4 *f)
        return t->duration * 1000 / t->time_scale;
 }
 
-int mp4_set_sample_position(struct mp4 *f, int32_t sample)
+int mp4_set_sample_position(struct mp4 *f, uint32_t sample)
 {
        const struct mp4_track *t = &f->track;
        int32_t offset, chunk, chunk_sample;
@@ -882,8 +882,9 @@ int mp4_meta_update(struct mp4 *f)
        ret = write_data(f, new_moov_data, new_moov_size);
        if (ret < 0)
                goto free_moov;
-       f->cb->truncate(f->cb->user_data);
-       ret = 1;
+       ret = f->cb->truncate(f->cb->user_data);
+       if (ret < 0)
+               ret = -ERRNO_TO_PARA_ERROR(errno);
 free_moov:
        free(new_moov_data);
        return ret;