X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=mp4.c;h=7145a47a829695e2cf82a46f58b18aa743c30246;hb=b96d1f30be6fda4b3d93aef19e66273260503cac;hp=381c9a21d8d24a709d7b474f90ad5e97bb87374d;hpb=76d113c01c9d97a43c361252fef65ba4b1e4da6c;p=paraslash.git diff --git a/mp4.c b/mp4.c index 381c9a21..7145a47a 100644 --- a/mp4.c +++ b/mp4.c @@ -609,6 +609,9 @@ static int open_file(const struct mp4_callback *cb, bool meta_only, struct mp4 * ret = -E_MP4_BAD_SAMPLERATE; if (f->track.sample_rate == 0) goto fail; + ret = -E_MP4_MISSING_ATOM; + if (f->udta_size == 0 || f->meta_size == 0 || f->ilst_size == 0) + goto fail; *result = f; return 1; fail: @@ -617,7 +620,7 @@ fail: return ret; } -int mp4_open_read(const struct mp4_callback *cb, struct mp4 **result) +int mp4_open(const struct mp4_callback *cb, struct mp4 **result) { struct mp4 *f; int ret; @@ -732,11 +735,6 @@ int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result) if (ret < 0) return ret; - if (f->udta_size == 0 || f->meta_size == 0 || f->ilst_size == 0) { - mp4_close(f); - *result = NULL; - return -E_MP4_MISSING_ATOM; - } *result = f; return 1; } @@ -869,7 +867,7 @@ static int write_data(struct mp4 *f, void *data, size_t size) return 1; } -int mp4_meta_update(struct mp4 *f) +int mp4_update_meta(struct mp4 *f) { void *new_moov_data; uint32_t new_moov_size;