]> git.tuebingen.mpg.de Git - paraslash.git/commit
mp4: Introduce skip_bytes().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 24 Aug 2021 19:37:06 +0000 (21:37 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:36 +0000 (21:37 +0200)
commitdc0c48a91e2970e192f2c09181ded9a11cee790d
tree220ec6b81727e5605540f331d46f748f244dcf8c
parent3b7939a8c294dc3ee103d99e6ff00e2800cf39f3
mp4: Introduce skip_bytes().

We often call one of the read_intX() helpers with a NULL result pointer
just to move the file position forward. Calling ->seek() with whence
set to SEEK_CUR is simpler and has the advantage that this operation
cannot fail. If we happen to seek beyond EOF, the next read will
return EOF and we'll abort then.

This patch provides the skip_bytes() helper and replaces all
read_intX(f, NULL) calls by calls to skip_bytes() and removes the
error checking.

Due to this cleanup read_int8() and read_int24() and read_u24_be()
(the latter being an inline function defined in portable_io.h) have
become unused, so remove these as well.
mp4.c
portable_io.h