summaryrefslogtreecommitdiff
path: root/libavformat/electronicarts.c
Commit message (Collapse)AuthorAge
* avformat/electronicarts: add option to return alpha channel in the main ↵Marton Balint2022-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | video stream in VP6A codec VP6 alpha in EA format is a second VP6 encoded video stream where only the Y component is used and is interpreted as the alpha channel of the first VP6 stream. The alpha VP6 stream is muxed separately from the main VP6 stream, has its own stream headers and packet headers. In theory the two streams might not even have the same resolution (although most likely that is not something that is seen or supported in the wild), but the format is capable of doing it. Merged VP6 alpha (also known as the VP6A codec) means that a packet of the video stream contains the corresponding packet of both VP6 substreams like this: {OffsetOfAlpha, DataPacket, AlphaDataPacket} So data and alpha data of a frame is merged to a single packet, this is how VP6 video with alpha is muxed in FLV and SWF. The first approach is more like how the demuxer sees data in the EA format, unfortunately it is different to what the FLV or SWF format expects, so - having no better place for it in the framework - I decided to do an optional format conversion in the EA demuxer. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/electronicarts: set packet_read in one placeMarton Balint2022-11-22
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/electronicarts: fix EOF checkMarton Balint2022-11-22
| | | | | | Similar to feof(), avio_feof() is only true after an actual overread. Signed-off-by: Marton Balint <cus@passwd.hu>
* electronicarts: convert to new channel layout APIVittorio Giovara2022-03-15
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.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: 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/electronicarts: Clear partial_packet on errorMichael Niedermayer2021-02-12
| | | | | | | | | Fixes: Infinite loop Fixes: 30165/clusterfuzz-testcase-minimized-ffmpeg_dem_EA_fuzzer-6224642371092480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/electronicarts: More chunk_size checksMichael Niedermayer2021-01-29
| | | | | | | | Fixes: Timeout Fixes: 26909/clusterfuzz-testcase-minimized-ffmpeg_dem_EA_fuzzer-6489496553783296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/electronicarts: Check for EOF in each iteration of the loop in ↵Michael Niedermayer2020-10-25
| | | | | | | | | | | ea_read_packet() Fixes: timeout(>20sec -> 1ms) Fixes: 26526/clusterfuzz-testcase-minimized-ffmpeg_dem_EA_fuzzer-5672328069120000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/electronicarts: change non failure return of read_header() to 0Michael Niedermayer2020-09-08
| | | | | | | This matches the documentation, but makes no functional difference Found-by: James Almer Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/electronicarts: Check if there are any streamsMichael Niedermayer2020-09-07
| | | | | | | | Fixes: Assertion failure (invalid stream index) Fixes: 25120/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6565251898933248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Remove unnecessary av_packet_unref()Andreas Rheinhardt2020-02-10
| | | | | | | | | Since bae8844e the packet will always be unreferenced when a demuxer returns an error, so that a lot of calls to av_packet_unref() in lots of demuxers are now redundant and can be removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/electronicarts: If no packet has been read at the end do not treat ↵Michael Niedermayer2019-10-01
| | | | | | | | | | | it as if theres a packet Fixes: Assertion failure Fixes: 17770/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5700606668308480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> 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
* electronicarts: prevent overflow during block alignment calculationAndreas Cadhalpun2017-01-29
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat: fix overflows during bit rate calculationAndreas Cadhalpun2016-12-14
| | | | | | | | The bit_rate field has type int64_t since commit 7404f3bdb90e6a5dcb59bc0a091e2c5c038e557d. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | 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.
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
| |
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | | | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* | libavformat/electronicarts: also demux mpeg audio layer 2Peter Ross2015-10-22
| | | | | | | | | | | | | | | | Signed-off-by: Peter Ross <pross@xvid.org> http://wiki.multimedia.cx/index.php?title=Electronic_Arts_SCxl Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/electronicarts: fix demuxing of certain eam filesPaul B Mahol2015-10-22
| | | | | | | | | | | | Such files have gaps between header chunks. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/electronicarts: support ADPCM PSXPaul B Mahol2015-10-22
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | electronicarts: demux alpha streamPeter Ross2015-06-25
| | | | | | | | | | | | | | | | | | Electronic Arts VP6 files may contain two video streams: one for the primary video stream and another for the alpha mask. The file format uses identical data structures for both streams. Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | electronicarts: move video stream properties into dedicated structurePeter Ross2015-06-25
| | | | | | | | | | | | | | This is required for the alpha stream demux patch. Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/electronicarts: Fixed ea_probe function to accept vp6a videosStephan Vedder2015-06-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Correct few "ffmpeg" typosPaul B Mahol2014-08-24
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'cb7b1a2dfb547ab78342a7a9d5cd729d77d90421'Michael Niedermayer2014-08-22
|\| | | | | | | | | | | | | * commit 'cb7b1a2dfb547ab78342a7a9d5cd729d77d90421': electronicarts: set the framerate for TGQ/TQI Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * electronicarts: set the framerate for TGQ/TQIAnton Khirnov2014-08-22
| | | | | | | | It is hardcoded to 15fps.
* | Merge commit '7b6aae23e12f41cdfac7f1069debfe44d9a3d136'Michael Niedermayer2014-08-22
|\| | | | | | | | | | | | | * commit '7b6aae23e12f41cdfac7f1069debfe44d9a3d136': electronicarts: read the framerate for MAD Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * electronicarts: read the framerate for MADAnton Khirnov2014-08-22
| |
* | Merge commit '4d6c5152849e23a4cc0f6a6ac2880c01ebcd301b'Michael Niedermayer2014-08-22
|\| | | | | | | | | | | | | | | | | | | * commit '4d6c5152849e23a4cc0f6a6ac2880c01ebcd301b': electronicarts: do not fail on zero-sized chunks Conflicts: libavformat/electronicarts.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * electronicarts: do not fail on zero-sized chunksAnton Khirnov2014-08-22
| | | | | | | | | | | | | | At least one FATE sample contains such chunks and happens to work simply by accident (due to find_stream_info() swallowing the error). CC: libav-stable@libav.org
* | replace calls to url_feof() with avio_feof()James Almer2014-08-08
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> 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
| |
* | avformat/electronicarts: detect endianness by comparing sizes instead of ↵Michael Niedermayer2013-12-21
| | | | | | | | | | | | using an arbitrary threshold Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/electronicarts: use 64bit variable for avio_tell() resultMichael Niedermayer2013-12-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/electronicarts: check chunksize more completely in probe()Michael Niedermayer2013-11-11
| | | | | | | | | | | | Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/electronicarts: check chunk size.Michael Niedermayer2013-11-11
| | | | | | | | | | | | Fix infinite loop Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'a9221e39600a31ee13e736e9e47743cde23f0280'Michael Niedermayer2013-09-29
|\| | | | | | | | | | | | | | | * commit 'a9221e39600a31ee13e736e9e47743cde23f0280': electronicarts: Add more sanity checking for the number of channels Note: This check is probably unnecessary Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * electronicarts: Add more sanity checking for the number of channelsMartin Storsjö2013-09-29
| | | | | | | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'f7e616959aff8706edccdae763c24c897c449f6f'Michael Niedermayer2013-09-23
|\| | | | | | | | | | | | | | | | | | | | | * commit 'f7e616959aff8706edccdae763c24c897c449f6f': electronicarts: Check packet sizes before reading Conflicts: libavformat/electronicarts.c See: fb1ea777b3a01be6d71a103529ad37982707cacc Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * electronicarts: Check packet sizes before readingMartin Storsjö2013-09-22
| | | | | | | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '163a729725c6eb0081b0af41a7279f7d19aee86e'Michael Niedermayer2013-08-16
|\| | | | | | | | | | | | | * commit '163a729725c6eb0081b0af41a7279f7d19aee86e': electronicarts: Let functions always returning the same value return void Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * electronicarts: Let functions always returning the same value return voidDiego Biurrun2013-08-15
| |