summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
Commit message (Collapse)AuthorAge
* lavf/id3v2: fail read_apic on EOF reading mimetypechcunningham2018-12-17
| | | | | | | | avio_read may return EOF, leaving the mimetype array unitialized. fail early when this occurs to avoid using the array in an unitialized state. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/id3v2: use png header to get PNG signaturePaul B Mahol2018-12-14
|
* id3v2: fix unsynchronizationwm42018-02-04
| | | | | | | | | | | | | | | The ID3v2 "unsynchronization scheme" requires replacing any 0xFF 0x00 sequences with 0xFF. This has to be done on every byte of the source data, while the current code skipped a byte after a replacement. This meant 0xFF 0x00 0xFF 00 was translated to 0xFF 0xFF 0x00 instead of 0xFF 0xFF. It feels a bit messy to do this correctly with the avio use. But fortunately, this translation can be done in-place, so we can just do it in memory. Inspired by what taglib does. Also see 9ae80e6a9cefcab61e867256ba19ef78a4bfe0cb. (The sample file for that commit is gone, so it could not be retested.)
* avformat: add option to parse/store ID3 PRIV tags in metadata.Richard Shaffer2018-01-24
| | | | | | | | | | | | | | Enables getting access to ID3 PRIV tags from the command-line or metadata API when demuxing. The PRIV owner is stored as the metadata key prepended with "id3v2_priv.", and the data is stored as the metadata value. As PRIV tags may contain arbitrary data, non-printable characters, including NULL bytes, are escaped as \xXX. Similarly, any metadata tags that begin with "id3v2_priv." are inserted as ID3 PRIV tags into the output (assuming the format supports ID3). \xXX sequences in the value are un-escaped to their byte value. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* 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>
* Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'James Almer2017-09-26
|\ | | | | | | | | | | | | * commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3': Mark some arrays that never change as const. Merged-by: James Almer <jamrial@gmail.com>
| * Mark some arrays that never change as const.Anton Khirnov2017-02-01
| |
| * srt: Adjust signedness of sscanf format stringsDiego Biurrun2016-10-28
| | | | | | | | Fixes several warnings from -Wformat.
* | avformat/id3v2: Use ffio_ensure_seekback() in id3v2_read_internal()Michael Niedermayer2017-05-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: fix ID3v2 parser for v2.2 comment framesChris Moeller2017-01-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/id3v2: fix memleak with empty stringsMichael Niedermayer2016-08-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/id3v2: Mark variable as unused to avoid "set but not used" warningMichael Niedermayer2016-08-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: read id3v2 comment tagsChris Moeller2016-08-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | 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.
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | id3v2: strip trailing spaces from APIC tagwm42015-06-18
| | | | | | | | | | | | | | | | | | | | | | The APIC description must be unique, and some ID3v2 tag writers add spaces to write several APIC entries with the same description. The trailing spaces simply serve as a way to disambiguate the description. Do this so that API users do not have to special-case mp3 to fix this cosmetic issue. Requested-by: wm4 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: detect PNG by header instead of mimeMichael Niedermayer2015-06-18
| | | | | | | | | | | | | | | | the mimetype for PNG can be set to jpeg Fixes 01\ -\ Cider\ Time.mp3 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | id3v2: catch avio_read errors in check_tagAndreas Cadhalpun2015-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since len is an unsigned int, the comparison is currently treated as unsigned and thus ignores all errors from avio_read. Thus cast len to int, which is unproblematic, because at that point len is between 0 and 4. This fixes 'Conditional jump or move depends on uninitialised value' valgrind warnings in is_tag. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '379e5603f4131e677ecf5ba79973dcd5603f28ea'Michael Niedermayer2015-05-10
|\| | | | | | | | | | | | | | | | | | | | | * commit '379e5603f4131e677ecf5ba79973dcd5603f28ea': id3v2: Do not export empty APIC description Conflicts: libavformat/id3v2.c See: b697b297b77f73c932307120e32c187d521d2ff7 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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.
* | id3v2: do not export APIC description if emptywm42015-05-08
| | | | | | | | | | | | | | | | 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. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a'Michael Niedermayer2015-02-25
|\| | | | | | | | | | | | | * commit '8e32b1f0963d01d4f5d4803eb721f162e0d58d9a': libavformat: Use ffio_free_dyn_buf where applicable Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/id3v2: remove unused variableMichael Niedermayer2015-01-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '54bc15d5ebfd07fd468743ba29f709ea19e840b9'Michael Niedermayer2015-01-15
|\| | | | | | | | | | | | | | | | | | | | | * commit '54bc15d5ebfd07fd468743ba29f709ea19e840b9': id3v2: fix reading v2.2 attached pictures Conflicts: libavformat/id3v2.c See: 05c3c568dccd6c42fdf6eea891d08c71fe2ee772 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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.
* | Merge commit '932788be5af8dee062c77851b573ea47dd6d047a'Michael Niedermayer2015-01-15
|\| | | | | | | | | | | | | | | | | | | * commit '932788be5af8dee062c77851b573ea47dd6d047a': id3v2: add names to the parameters of ID3v2EMFunc.read Conflicts: libavformat/id3v2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * id3v2: add names to the parameters of ID3v2EMFunc.readAnton Khirnov2015-01-14
| | | | | | | | Some of them are not immediately obvious.
* | avformat/id3v2: Fix incompatible pointer type warningsMichael Niedermayer2015-01-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8809c974a3fb51f96e498a5556a4a5bbacc581ce'Michael Niedermayer2015-01-15
|\| | | | | | | | | | | | | | | | | | | * commit '8809c974a3fb51f96e498a5556a4a5bbacc581ce': id3v2: constify the 'tag' parameter to special metadata parsing callback Conflicts: libavformat/id3v2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * id3v2: constify the 'tag' parameter to special metadata parsing callbackAnton Khirnov2015-01-14
| | | | | | | | Those functions should not ever modify it.
* | avformat/id3v2: support USLT tagswm42015-01-06
| | | | | | | | | | | | | | I think this turned out pretty terrible. There's no good way to add new custom tags that write to AVFormatContext->metadata. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: Use av_freep() avoid leaving stale pointers in memoryMichael Niedermayer2014-12-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | id3v2: prefer TDRC for date over TDRL.Benoit Fouet2014-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | TDRL is what we used as a replacement of TYER, and, according to http://id3.org/id3v2.4.0-changes : TYER - Year This frame is replaced by the TDRC frame, 'Recording time' [F:4.2.5]. So change TDRL usages to TDRC. Fixes ticket #3694 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: support buggy id3v2.3 tag length in id3v2.4Benoit Fouet2014-10-17
| | | | | | | | | | | | | | | | | | Some encoders do not use syncsafe sizes in v2.4 id3 tags. Check the next tag to try to choose between the two. Fixes ticket #4003 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: silence a warning when CONFIG_ZLIB is unset.Benoit Fouet2014-10-16
| | | | | | | | | | | | | | dlen is only read when CONFIG_ZLIB is set, so mark it as possibly unused. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: Fix "warning: unused variable uncompressed_buffer_size" if ↵Michael Niedermayer2014-08-30
| | | | | | | | | | | | zlib is unavailable Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Use correct msvc type specifiers for ptrdiff_t and size_t.Carl Eugen Hoyos2014-04-24
| | | | | | | | | | | | | | The Windows runtime aborts if it finds %t or %z. Fixes ticket #3472. Reviewed-by: Ronald Bultje
* | 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>
* | ff_id3v2_free_extra_meta: set the pointer pointing to extra_meta to NULLPeter Ross2014-04-19
| | | | | | | | | | | | | | Fixes ticket #3530. Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: decode compilation metadataPeter Ross2014-03-15
| | | | | | | | | | | | | | Described http://id3.org/iTunes%20Compilation%20Flag Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: allow ID3 parsing without AVFormatContextAnssi Hannula2013-12-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ff_id3v2_read_dict() for parsing without AVFormatContext, but instead with AVIOContext and AVDictionary. AVFormatContext is still used for logging, if available. Chapter parsing is the only non-logging functionality that actually needs AVFormatContext, and AFAICS it should be modified to write the data to ID3v2ExtraMeta first, from where it can be implanted to AVFormatContext by a separate function (like it is done with read_apic() and ff_id3v2_parse_apic()). That is outside the scope of this patch, though. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | avformat/id3v2: parse ID3 Private frames as extra metadataAnssi Hannula2013-12-31
| | | | | | | | | | | | They are used in HLS. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
* | Read pictures in id3v2.2Carl Eugen Hoyos2013-12-23
| |
* | avformat/id3v2: Check avio_read() return value in read_chapter()Michael Niedermayer2013-12-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: factor free code to the end of read_chapter()Michael Niedermayer2013-12-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vformat/id3v2: check avio_read for short reads in addition to errorsMichael Niedermayer2013-12-15
| | | | | | | | | | Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/id3v2: Check avio_read() return code in id3v2_parse()Michael Niedermayer2013-12-15
| | | | | | | | | | | | | | Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f5a04a9b50d_7087_mp3__mp3__tooSmallFinal.mp3 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>