Commit Graph

11 Commits

Author SHA1 Message Date
Karsten Otto c5329d64b1 aadec: improve seeking in mp3 content
MP3 frames may not be aligned to aa chunk boundaries. When seeking,
calculate the expected frame offset in the target chunk. Adjust the
timestamp and truncate the next packet accordingly.

This solution works for the majority of tested audio material. For
some rare encodings with mp3 padding or embedded id3 tags, it will
mispredict the correct offset, and at worst skip an extra frame.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-14 19:04:48 +02:00
Karsten Otto 6cc6b619b9 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>
2018-07-09 03:25:53 +02:00
Karsten Otto c126065947 aadec: improve eof detection
Remember the end position of audio content in the file and check it during
read_packet. There always seems to be other data beyond it, which could be
misinterpreted as more audio. Also add some extra avio_read error checks,
to bail early in case of a broken/truncated file.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-08 11:14:53 +02:00
Clément Bœsch 549045254c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
Paul B Mahol 591be9e384 avformat/aadec: use avio_get_str()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-16 10:24:02 +01:00
Paul B Mahol e0665d385e avformat/aadec: stop ignoring file metadata
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-16 10:24:01 +01:00
Paul B Mahol 40cf943714 avcodec: add SIPR parser
Fixes #2056.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-16 10:24:01 +01:00
Derek Buitenhuis 6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Vesselin Bontchev 8e28e0721c avformat/aa: initialize "header_seed" and "header_key"
Fixes CID 1322364, CID 1322363

Signed-off-by: Vesselin Bontchev <vesselin.bontchev@yandex.com>
2015-09-10 09:06:13 +02:00
Vesselin Bontchev 4cd1d2314b avformat/aa: use correct format specifier in sscanf
This demuxer was broken on a large number of platforms due to usage of wrong
format specifier in sscanf. This patch fixes the problem, and also adds some
debug logging to reduce future debugging pain.
2015-08-25 12:44:20 +00:00
Vesselin Bontchev e32a99264b Add support for Audible AA files
https://en.wikipedia.org/wiki/Audible.com#Quality
2015-08-21 04:24:58 +00:00