aadec: add chapters and seeking
authorKarsten Otto <ottoka@posteo.de>
Sun, 8 Jul 2018 09:46:26 +0000 (11:46 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 9 Jul 2018 01:25:53 +0000 (03:25 +0200)
commit6cc6b619b95128ef084720c42ef0d361376e8f09
tree09a9de3f6e0f57fab3e7f344d16ca873a7883c56
parent3bf39f2aeff0defcc11454c497b6ea0ffbcd17ca
aadec: add chapters and seeking

read_packet reads content in chunks. Thus seek must be clamped to valid
chunk positions in the file, which in turn are relative to chapter start
positions.

So in read_header, scan for chapter headers once by skipping through the
content. Set stream time_base based on bitrate in bytes/s, for easy
timestamp to position conversion.

Then in read_seek, find the chapter containing the seek position, calculate
the nearest chunk position, and reinit the read_seek state accordingly.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/aadec.c