summaryrefslogtreecommitdiff
path: root/libavformat/mp3dec.c
Commit message (Collapse)AuthorAge
* avformat/mp3dec: Adjust returned timestamp in the CBR seeking caseMichael Niedermayer2015-04-21
| | | | | | | | With this the returned timestamp should match the packet instead of the requested timestamp, which may lay between packets Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/mp3dec: fix gapless audio when seeking in CBR modewm42015-04-17
| | | | | | | | | | | | Removing a bunch of questionable hacks makes it work. These hacks apparently try to make concatenated mp3s with Lame headers seekable, which doesn't make too much sense anyway. The main change is that we trust the Xing header file size field now (the same field is used for seeking with Xing TOC). Note that a mp3 might contain an unknown number of unsupported additional tags, so we can't reliably compute this size manually. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/mp3dec: offset seek index to end of vbr headerswm42015-04-15
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Revert "avformat/mp3dec: offset seek index to end of id3v2 tag"wm42015-04-15
| | | | | | | | This reverts commit 8b76c0eb561b0313e2a27950fe9d2bc5e4780dd8. It was slightly incorrect; the next commit fixes it. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/mp3dec: Allow forcing the use of the xing TOC for CBR filesMichael Niedermayer2015-04-15
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/mp3dec: offset seek index to end of id3v2 tagwm42015-03-31
| | | | | | | The Xing index won't account for the id3 tag - it's relative to the headers. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'fe99c52fa99e44961a09cd1324aefd492b797fc8'Michael Niedermayer2015-03-11
|\ | | | | | | | | | | | | | | | | | | | | | | * commit 'fe99c52fa99e44961a09cd1324aefd492b797fc8': mp3: Properly use AVCodecContext API Conflicts: libavformat/mp3dec.c See: 6ad42b3e15478284321dd285acaf189a16590854 See: b851bc20c6931c084710e69f7eec30d8c1bdb68e Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3: Properly use AVCodecContext APIVittorio Giovara2015-03-11
| | | | | | | | | | | | | | Rather than having an unitialized context on the stack, allocate it with defaults and free it when unneeded. CC: libav-stable@libav.org
* | avformat/mp3dec: Check for avcodec_alloc_context3() failureMichael Niedermayer2015-02-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: properly allocate dummy AVCodecContextMichael Niedermayer2015-02-26
| | | | | | | | | | | | | | Fixes (harmless) use of uninitialized variable Found-by: jamrial Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '9deaec782810d098bca11c9332fab2d2f4c5fb78'Michael Niedermayer2015-02-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '9deaec782810d098bca11c9332fab2d2f4c5fb78': lavf: move internal fields from public to internal context Conflicts: libavformat/avformat.h libavformat/internal.h libavformat/mux.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3: Tweak the probe scoresLuca Barbato2014-12-07
| | | | | | | | | | | | | | | | Having more than 10 consecutive frames decoded as mp3 should be considered a clear signal that the sample is mp3 and not mpegps. Reported-By: Florian Iragne <florian@iragne.fr> CC: libav-stable@libav.org
* | avformat/mp3dec: Name the dummy variable as what it is, to avoid confusionMichael Niedermayer2014-12-14
| | | | | | | | | | Found-by: nattyzs <nattyzs@163.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: avoid seeking to negative positionsMichael Niedermayer2014-11-18
| | | | | | | | | | | | Fixes Ticket4038 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: also accept Lavc as shortname to read delaysMichael Niedermayer2014-10-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '99143140dea12363af680d02e23cb42cfe191679'Michael Niedermayer2014-10-24
|\| | | | | | | | | | | | | | | | | | | | | * commit '99143140dea12363af680d02e23cb42cfe191679': mp3dec: fix reading the Xing tag Conflicts: libavformat/mp3dec.c See: 19ff479f694ddccc1fd1fa00eff94f96ca82671b Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3dec: fix reading the Xing tagAnton Khirnov2014-10-24
| | | | | | | | | | | | | | The quality scale field is only supposed to be present if the fourth bit is set. In practice, lame always sets it, but other tools might not. CC:libav-stable@libav.org
* | avformat/mp3dec: avoid early EOF with concatenated gapless mp3swm42014-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a file created with something like: cat file1.mp3 file2.mp3 > result.mp3 Then if file2.mp3 has gapless information, result.mp3 would stop playing something in the middle. This happens because the gapless info directs the decoder to discard all samples after a certain position. To make matters worse, the gapless info of file2.mp3 will be used when playing the file1.mp3 part, because the gapless info is located at the end of the file. While handling concatenated gapless files correctly would be insane and a lot of effort (especially without scanning the whole file on opening), it's easy to prevent at least early EOF. Playback will happen to work, even if it's slightly broken. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: fix gapless audio supportwm42014-09-20
| | | | | | | | | | | | | | | | | | | | | | | | The code already had skipping of initial padding, but discarding trailing frame padding was missing. This is somewhat questionable, because it will make the decoder discard any data after the declared file size in the LAME header. But note that skipping full frames at the end of the stream is required. Encoders actually create such files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: Improve seeking frame sync codeMichael Niedermayer2014-09-10
| | | | | | | | | | | | Fixes Ticket3884 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Ignore xing number of frames if the file is larger than indicated.Carl Eugen Hoyos2014-07-24
| | | | | | | | Fixes ticket #3777.
* | avformat/mp3dec: check the number of frames per buffer sizeMichael Niedermayer2014-05-12
| | | | | | | | | | | | Fixes misdetection of issue3327-libc-2.17.so Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '32d05934abc7427bb90380a4c1ab20a15fd7d821'Michael Niedermayer2014-04-18
|\| | | | | | | | | | | | | | | | | | | * commit '32d05934abc7427bb90380a4c1ab20a15fd7d821': mp3dec: decode more data from Info header Conflicts: libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3dec: decode more data from Info headerAlessandro Ghedini2014-04-17
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'fbd8e042107ec63e0ddf155588c59dcb76007641'Michael Niedermayer2014-04-17
|\| | | | | | | | | | | | | | | | | | | * commit 'fbd8e042107ec63e0ddf155588c59dcb76007641': mp3dec: move XING/Info and VBRI parsing into their own functions Conflicts: libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3dec: move XING/Info and VBRI parsing into their own functionsAlessandro Ghedini2014-04-17
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '15c5a8d22d12d29a364ca2ab6438f1dee2fa08c7'Michael Niedermayer2014-03-24
|\| | | | | | | | | | | | | | | | | | | * commit '15c5a8d22d12d29a364ca2ab6438f1dee2fa08c7': mp3dec: export replaygain tags from ID3v2 Conflicts: Changelog Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3dec: export replaygain tags from ID3v2Anton Khirnov2014-03-24
| |
* | avformat/mp3dec: optimize mp3_seek() for dir < 0Michael Niedermayer2014-03-02
| | | | | | | | | | | | this minimizes the amount of protocol seeks and reading needed in that case Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: fix start time in light of initial skip samplesMichael Niedermayer2014-01-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: 4x faster probingMichael Niedermayer2013-11-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: perform seek resync in the correct directionMichael Niedermayer2013-10-25
| | | | | | | | | | | | | | Fixes seeking to the last frame in CBR files Fixes Ticket2773 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'c0779a67e85df856904ee6fab760c4233d4c2be5'Michael Niedermayer2013-09-12
|\| | | | | | | | | | | | | | | | | | | * commit 'c0779a67e85df856904ee6fab760c4233d4c2be5': mp3: add .mpa extension Conflicts: libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3: add .mpa extensionVittorio Giovara2013-09-12
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avformat/mp3dec: improve detection of mp3s with huge id3 tagsMichael Niedermayer2013-08-26
| | | | | | | | | | | | | | When a id3 tag is larger than the amount of space we will probe give it a score similar to what a .mp3 extension would have given it Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3dec: make const tables static constMichael Niedermayer2013-08-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3dec: detect CBR and use CBR axiom to seekMichael Niedermayer2013-07-08
| | | | | | | | | | | | | | This should also work reasonable with truncated and growing mp3s. Fixes Ticket2590 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: read TOC even if not all needed information is availableMichael Niedermayer2013-07-07
| | | | | | | | | | | | This fixes hyothetical bugs with parsing of elements after the TOC Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: read xing toc independant of usetoc, only skip filling ↵Michael Niedermayer2013-07-07
| | | | | | | | | | | | | | | | index if requested Fixes hypothetical parsing bug with -usetoc 0 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/mp3dec: Add usetoc option to allow dlsabling the use of the xing TOCMichael Niedermayer2013-07-06
| | | | | | | | | | | | | | The toc is inexact and not using it can thus make sense. Using it is faster though, thus the opposite can similarly makes sense Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e0f8be6413b6a8d334d6052e610af32935c310af'Michael Niedermayer2013-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e0f8be6413b6a8d334d6052e610af32935c310af': avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate Conflicts: libavformat/ac3dec.c libavformat/avformat.h libavformat/avs.c libavformat/m4vdec.c libavformat/mov.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegvideodec.c libavformat/psxstr.c libavformat/pva.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriateDiego Biurrun2013-05-04
| |
* | Merge commit '505642f18276aed03278ac91b1f334ea888eac6a'Michael Niedermayer2013-04-19
|\| | | | | | | | | | | | | | | | | | | * commit '505642f18276aed03278ac91b1f334ea888eac6a': mp3dec: fallback to generic seeking when a TOC is not present Conflicts: libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mp3dec: fallback to generic seeking when a TOC is not presentMichael Niedermayer2013-04-19
| | | | | | | | | | | | | | Fixes seeking without a Xing/Info header. CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mp3dec: Fix VBR bit rate parsingAlexander Kojevnikov2013-03-08
| | | | | | | | | | | | | | | | | | | | | | | | When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag. When parsing the stream, don't override the bit rate if it's already set, otherwise calculate the mean bit rate from parsed frames. This way, the bit rate will be set correctly both for CBR and VBR streams. CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | mp3dec: Fix VBR bit rate parsingAlexander Kojevnikov2013-03-05
| | | | | | | | | | | | | | | | | | | | | | When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag. When parsing the stream, don't override the bit rate if it's already set, otherwise calculate the mean bit rate from parsed frames. This way, the bit rate will be set correctly both for CBR and VBR streams. Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3_read_probe: make buffer related pointers constMichael Niedermayer2012-12-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3dec: remove unused variableMichael Niedermayer2012-10-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3demux: Rewrite xing TOC based seekingMichael Niedermayer2012-10-21
| | | | | | | | | | | | | | | | | | | | The libav code depends on mp3 startcodes only occuring at the start of frames. But there is nothing in mp3 that prevents them occuring elsewhere by chance. Thus the code would fail randomly, the new code searches for 3 consecutive valid frames. If this turns out to be still insufficient the number can be raised further, or additional checks added. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mp3dec: fix seeking without xing TOCMichael Niedermayer2012-09-20
| | | | | | | | | | | | fixes regression from the xing toc support Signed-off-by: Michael Niedermayer <michaelni@gmx.at>