summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
Commit message (Collapse)AuthorAge
* 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.
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* id3v2: Do not export empty APIC descriptionwm42015-05-09
| | | | | | APIC tags always have a description. Tag writers obviously leave it empty if there is no description. In this case, libavformat would export "" as title. Do not set the title instead.
* libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* id3v2: fix reading v2.2 attached picturesAnton Khirnov2015-01-14
| | | | | In v2.2, the picture type is not a zero-terminated string, but has a constant size of 3 bytes.
* id3v2: add names to the parameters of ID3v2EMFunc.readAnton Khirnov2015-01-14
| | | | Some of them are not immediately obvious.
* id3v2: constify the 'tag' parameter to special metadata parsing callbackAnton Khirnov2015-01-14
| | | | Those functions should not ever modify it.
* id3v2: check for end of file while unescaping tagsLuca Barbato2013-05-03
| | | | | | | Prevent a serious out of buffer bound write. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
* id3v2: K&R formatting cosmeticsLuca Barbato2013-05-02
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* avformat: Drop unnecessary ff_ name prefixes from static functionsDiego Biurrun2013-04-30
|
* id3v2: pad the APIC packets as required by lavc.Anton Khirnov2013-04-04
| | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* avpacket: use AVBuffer to allow refcounting the packets.Anton Khirnov2013-03-08
| | | | | | This will allow us to avoid copying the packets in many cases. This breaks ABI.
* id3v2: fix reading unsynchronized frames.Anton Khirnov2012-11-22
| | | | | | | | | Current code would incorrectly process e.g. 'ff 00 ff 00 ff' to 'ff ff ff', while it should be 'ff ff 00 ff'. Fixes Bug 395. CC: libav-stable@libav.org
* id3v2: strdup the genre name explicitly.Clément Bœsch2012-09-17
| | | | | | | | | It would have been done anyway in the av_dict_set() call. This simplifies the code and avoid a warning because of assigning a const string from ff_id3v1_genre_str to a non-const variable. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf/id3v2: do not export empty fields.Clément Bœsch2012-09-17
| | | | | | This also avoids a memleak. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* id3v2: Match PIC mimetype/format case-insensitivelyMohammad Alsaleh2012-08-12
| | | | | | | | | | | Some files' embedded art seems to have the mimetype 'image/JPG' instead of 'image/jpg'. Libav fails to parse those because it matches case-sensitively. Use av_strncasecmp() to fix this behaviour. Signed-off-by: Mohammad Alsaleh <msal@tormail.org> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* id3v2: Support v2.2 PICMohammad Alsaleh2012-08-08
| | | | | | | | | | | | id3 v2.2 uses image format ("JPG","PNG") instead of mimetypes. Currently, the attached picture is skipped because the format string does not match a known picture mimetype. This patch fixes this behaviour. Signed-off-by: Mohammad Alsaleh <msal@tormail.org> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* id3v2: add a mimetype for bmp pictures.Anton Khirnov2012-07-07
|
* id3v2: fix skipping extended header in id3v2.4Anton Khirnov2012-04-01
| | | | In v2.4, the length includes the length field itself.
* id3v2: add another mimetype for JPEG imageKostya Shishkov2012-03-29
|
* id3v2: set the keyframe flag on attached pictures.Anton Khirnov2012-03-20
|
* id3v2: remove unused ff_id3v2_read().Anton Khirnov2012-02-29
| | | | Rename ff_id3v2_read_all to ff_id3v2_read().
* lavf: export id3v2 attached pictures as streams.Anton Khirnov2012-02-29
|
* id3v2: read attached pictures and export them in ID3v2ExtraMeta.Anton Khirnov2012-02-29
|
* Fix a bunch of common typos.Diego Biurrun2011-12-11
|
* id3v2: fix type of ID3v2EMFunc.free()Anton Khirnov2011-11-02
|
* id3v2: reduce the scope of some non-globally-used symbols/structuresDiego Biurrun2011-10-13
|
* id3v2: cosmetics: move some declarations before the places they are usedDiego Biurrun2011-10-13
|
* id3v2: fix NULL pointer dereferenceAnton Khirnov2011-10-11
| | | | Bug found by Laurent Aimar fenrir at videolan org
* id3v2: remove pointless castsAnton Khirnov2011-10-03
|
* id3v2: read TXXX frames with two calls to decode_str() instead of one.Anton Khirnov2011-10-03
| | | | | | | Read the key in the first, value in the second. This allows to avoid pointless strdups and simplify decode_str() by dropping two of its parameters.
* id3v2: don't discard the whole tag when encountering empty frames.Anton Khirnov2011-10-03
| | | | | While they're technically invalid, it's better to skip them and try to read the rest of the tag.
* id3v2: add support for non-text and GEOB type tag framesDavid Goldwich2011-09-21
| | | | | | | | | | | | | | | | | | | | | | This extends the ID3v2 parser to allow for reading of non-text (i.e. other than T***) meta tag frames providing a ff_id3v2_read_all() function. An additional data structure 'ID3v2ExtraMeta' is introduced for these tags since AVDictionary is string oriented and unsuitable for binary data. A parser for tag frames of type GEOB is implemented, which is needed to extract keyring information from encrypted OMA files. GEOB data is parsed into 'ID3v2ExtraMetaGEOB' data structures. The routine to decode characters from different encodings to UTF-8, formerly part of the read_ttag() function, is moved to its own function. Because some tag frames contain subparts of unknown length, the function is now also able to read until a null character is found. In addition, the function now takes care of allocating a buffer long enough to hold the decoded characters. Signed-off-by: David Goldwich <david.goldwich@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Remove all uses of now deprecated metadata functions.Anton Khirnov2011-06-08
|
* id3v2: Check malloc result. ID3v2 tags can be very large.Alex Converse2011-05-26
|
* id3v2: Initialize tflags for version 2.2.Alex Converse2011-05-26
|
* id3v2: skip broken tags with invalid sizeAnton Khirnov2011-03-22
| | | | fixes issue2649.
* id3v2: don't explicitly skip paddingAnton Khirnov2011-03-22
| | | | It's pointless, since there's a seek to the end of tag later.
* id3v2: simplify error handling.Anton Khirnov2011-03-21
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* id3v2: explicitly seek to the end of the tag after readingAnton Khirnov2011-03-21
| | | | | | | | Current code might stop in the middle of an invalid tag. fixes issue2650 Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes senseAnton Khirnov2011-03-16
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* id3v2: merge TYER/TDAT/TIME to date tagAnton Khirnov2011-03-15
|
* id3v2: fix typo in error messageAnton Khirnov2011-03-09
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* avio: add avio_tell macro as a replacement for url_ftellAnton Khirnov2011-03-04
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavf: replace all uses of url_fskip with avio_seekAnton Khirnov2011-03-01
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio_ prefix for url_fseekAnton Khirnov2011-03-01
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio_ prefixes for get_* functionsAnton Khirnov2011-02-21
| | | | | | | | | | | | | | In the name of consistency: get_byte -> avio_r8 get_<type> -> avio_r<type> get_buffer -> avio_read get_partial_buffer will be made private later get_strz is left out becase I want to change it later to return something useful. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: move init_put_byte() to a new private header and rename itAnton Khirnov2011-02-20
| | | | | | | init_put_byte should never be used outside of lavf, since sizeof(AVIOContext) isn't part of public ABI. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>