]> git.tuebingen.mpg.de Git - paraslash.git/commit - web/manual.md
afh: Dynamic chunks.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 21 Dec 2016 23:57:15 +0000 (00:57 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 25 Mar 2017 10:54:36 +0000 (11:54 +0100)
commitb6b571e6c6fb52207b11fc7833b272ec8cfa28bf
tree3810274f6c30d399be87849561884ddfdaa6da16
parent234647bb5139513bdf36c1afec46f5c43ba27adc
afh: Dynamic chunks.

paraslash chunk tables were designed long ago with the idea that the
full audio file, with the exception of a potential header, is going
to be sent to the client. This allows to store a sequence of offsets
as the chunk table. Each chunk is defined as the contiguous region
of the file given by two consecutive offsets.

For most audio formats, however, not every part of the file corresponds
to encoded audio. We work around this on the client side by letting
the filters detect and skip those parts which can not be fed to
the decoder.

This works generally well, but for the aac decoder we have a rather
ugly hack that skips over any non aac decoded data of its input. This
hack was never very reliable, and the concept of dynamic chunks
finally allows to get rid of it.

Dynamic chunks work as follows. Each audio format handler signifies
support by defining the new ->get_chunk method. In this case
afh_get_chunk() no longer consults the chunk table at all but calls
the new method instead in order to obtain a reference to the chunk.

This comes with a certain overhead at runtime because we need to call
into the functions of the mp4ff library (ships together with faad)
rather looking up the offset in the chunk table.

Only the aac audio format handler supports dynamic chunks per this
commit. To keep the patch size relatively small, this commit does not
touch ->get_file_info() of the aac audio format handler. Therefore,
when a new m4a file is added to the database, the aac audio format
handler still creates the chunk table. A subsequent commit will turn
off this unnecessary operation.

The documentation is updated to mention that mp4ff is now required
for the aac audio format handler. The configure script now checks
for the mp4ff header and the library and deactivates aac support if
it was not found.
aac_afh.c
aacdec_filter.c
afh.c
afh.h
afh_common.c
afh_recv.c
configure.ac
error.h
vss.c
web/manual.md