summaryrefslogtreecommitdiff
path: root/libavformat/omadec.c
Commit message (Collapse)AuthorAge
* oma: convert to new channel layout APIVittorio Giovara2022-03-15
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: Make ff_data_to_hex() zero-terminate the stringAndreas Rheinhardt2021-12-08
| | | | | | Most callers want it that way anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/omadec: Don't output uninitialized valuesAndreas Rheinhardt2021-09-24
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-17
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/omadec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-08
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: move AVStream.{parser,need_parsing} to AVStreamInternalJames Almer2021-05-07
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/id3v2: Don't reverse the order of id3v2 APICsAndreas Rheinhardt2021-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing ID3v2 tags, special (non-text) metadata is not applied directly and unconditionally; instead it is stored in a linked list in which elements are prepended. When traversing the list to add APICs (or private tags) at the end, the order is reversed. The same also happens for chapters and therefore the chapter parsing code already reverses the chapters. This commit changes this: By keeping pointers to both head and tail of the linked list one can preserve the order of the entries and remove the reordering code for chapters. Only the pointer to head will be exported: No current caller uses a nonempty list, so exporting both head and tail is unnecessary. This removes the functionality to combine the lists of special metadata read from different ID3v2 tags, but that doesn't make really much sense anyway (and would be trivial to implement if desired) and allows to remove the now unnecessary initializations performed by the callers. The FATE-reference for the id3v2-priv test had to be updated because the order of the tags read into the dict is reversed; for id3v2-priv-remux only the md5 and not the ffprobe output of the remuxed file changes because the order of the private tags has up until now been reversed twice. The references for the aiff/mp3 cover-art tests needed to be updated, because the order of the attached pics is reversed upon reading. It is still not correct, because the muxers write the pics in the order in which they arrive at the muxer instead of the order given by pkt->stream_index. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/oma: Move stuff only used by demuxer to demuxerAndreas Rheinhardt2021-02-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/oma: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/omadec: Fix memleaks upon read_header failureAndreas Rheinhardt2020-06-15
| | | | | | | Fixes possible leaks of id3v2 metadata as well as an AVDES struct in case the content is encrypted and an error happens lateron. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/id3v2: Remove unnecessary indirectionAndreas Rheinhardt2020-05-25
| | | | | | | | | ff_id3v2_parse_apic/chapters/priv/priv_dict all had a parameter extra_meta of type ID3v2ExtraMeta ** as if the functions wanted to make *extra_meta point to something else. But they don't, so just use an ID3v2ExtraMeta *. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/id3v2: Avoid allocations for ID3v2ExtraMetaAndreas Rheinhardt2020-05-25
| | | | | | | | | | | | Up until now, the ID3v2ExtraMeta structure (which is used when parsing ID3v2 tags containing attached pictures, chapters etc.) contained a pointer to separately allocated data that depended on the type of the tag. Yet the difference of the sizes of the largest and the smallest of these structures is fairly small, so that it is better to simply include a union of all the possible types of tag-dependent structures in ID3v2ExtraMeta. This commit implements this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: Forward errors where possibleAndreas Rheinhardt2019-12-12
| | | | | | | | | | It is not uncommon to find code where the caller thinks to know better what the return value should be than the callee. E.g. something like "if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit changes several instances of this to instead forward the actual error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* avformat: fix id3 chaptersLukas Stabe2017-10-05
| | | | | | | | | | | These changes store id3 chapter data in ID3v2ExtraMeta and introduce ff_id3v2_parse_chapters to parse them into the format context if needed. Encoders using ff_id3v2_read, which previously parsed chapters into the format context automatically, were adjusted to call ff_id3v2_parse_chapters. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* lavf/omadec: Fix packet duration for Atrac 3 lossless.Carl Eugen Hoyos2017-02-11
|
* lavf/omadec: Remove an unsed variable.Carl Eugen Hoyos2017-02-11
|
* avcodec: add ATRAC Advanced Lossless decodersPaul B Mahol2017-02-11
| | | | | | Only lossy part is decoded for now. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* omadec: fix overflows during bit rate calculationAndreas Cadhalpun2017-01-06
| | | | Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
| * omadec: Fix position of opening parenthesisVittorio Giovara2015-10-30
| |
* | avformat/omadec: Fix { typoMichael Niedermayer2015-10-05
| | | | | | | | | | | | Fixes CID1324299 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '10de408738d28ab17aa5c1fdccd809b0637c12d5'Hendrik Leppkes2015-09-16
|\| | | | | | | | | | | | | * commit '10de408738d28ab17aa5c1fdccd809b0637c12d5': lavf: Update to the new crypto API Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: Update to the new crypto APIVittorio Giovara2015-09-13
| |
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avformat/omadec: Use 64bit for ret to avoid overflowMichael Niedermayer2015-02-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/omadec: Subtract headersize in timestamp calculationMichael Niedermayer2015-02-07
| | | | | | | | | | | | Fixes pts/dts Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/omadec: only compute timestamps based on bitrate if its setMichael Niedermayer2015-02-07
| | | | | | | | | | | | Fixes division by zero Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e352520e3ed7f08f19e63cd60e95da6bb6f037c1'Michael Niedermayer2015-02-07
|\| | | | | | | | | | | | | * commit 'e352520e3ed7f08f19e63cd60e95da6bb6f037c1': oma: Report a timestamp Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * oma: Report a timestampLuca Barbato2015-02-07
| | | | | | | | | | | | Reported-By: jb@videolan.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat/omadec: fix number suffixMichael Niedermayer2015-02-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ff_id3v2_read: add option to limit ID3 magic number searchPeter Ross2014-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 ' chunk tag. If such chunks are stored sequentially, it is possible for the ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g. [1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...] [2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...] Fixes ticket #3530. Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/omadec: fix probetest failureMichael Niedermayer2014-04-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd92024f18fa3d69937cb2575f3a8bf973df02430'Michael Niedermayer2014-03-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd92024f18fa3d69937cb2575f3a8bf973df02430': lavf: more correct printf format specifiers Conflicts: libavformat/asfdec.c libavformat/cafdec.c libavformat/dxa.c libavformat/framecrcenc.c libavformat/hnm.c libavformat/iff.c libavformat/mov.c libavformat/mxfdec.c libavformat/rmdec.c libavformat/rpl.c libavformat/smacker.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: more correct printf format specifiersDiego Biurrun2014-03-11
| |
| * ATRAC3+ decoderMaxim Polijakowski2014-01-09
| | | | | | | | | | | | Cleanup by Diego Biurrun. Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
* | omadec: Disable "Unsupported codec ATRAC3+" warningMaxim Poliakovski2013-12-29
| | | | | | | | | | | | Also add a list of supported decoders. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-04
|\| | | | | | | | | | | | | * qatar/master: omadec: loosen format probing constraints Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * omadec: loosen format probing constraintsDavid Goldwich2013-11-04
| | | | | | | | | | | | | | | | | | | | Imporoves detection of some files in the wild: - ID3v2 a.k.a. "ea3" header is optional. - Version and flags in ID3v2 header are unspecified. Signed-off-by: David Goldwich <david.goldwich@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '1c736bedd9891501960ebac0f7c05eb60225e947'Michael Niedermayer2013-11-04
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '1c736bedd9891501960ebac0f7c05eb60225e947': omadec: check GEOB sizes against buffer size Conflicts: libavformat/omadec.c See: e74fa25cb9f29aee8a36df0c8e492f8bafdbe4a0 See: 91e72e35141f590c38985ad0ae3453a4e9e86b8a Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * omadec: check GEOB sizes against buffer sizeMichael Niedermayer2013-11-04
| | | | | | | | | | | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: David Goldwich <david.goldwich@gmail.com> CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * omadec: Fix wrong number of array elementsMichael Niedermayer2013-11-04
| | | | | | | | | | | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: David Goldwich <david.goldwich@gmail.com> CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avformat: use ff_alloc_extradata()Paul B Mahol2013-10-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-09-30
|\| | | | | | | | | | | | | * qatar/master: omadec: fix bitrate for ATRAC3+ streams Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * omadec: fix bitrate for ATRAC3+ streamsMaxim Poliakovski2013-09-29
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '23d0fdcf6f30843fc3f14084d80581f1ca10f1f3'Michael Niedermayer2013-09-30
|\| | | | | | | | | | | | | | | | | | | * commit '23d0fdcf6f30843fc3f14084d80581f1ca10f1f3': Add support for multichannel ATRAC3+ streams. Conflicts: libavformat/oma.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add support for multichannel ATRAC3+ streams.Maxim Poliakovski2013-09-29
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avformat/omadec: simplify checks in nprobe()Michael Niedermayer2013-09-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>