summaryrefslogtreecommitdiff
path: root/libavformat/oggdec.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>
* ogg: Forward errors furtherLuca Barbato2015-04-20
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-19
| | | | This applies to every library where performance is not critical.
* oggdec: Check memory allocationFederico Tomassetti2015-03-21
| | | | | | Bug-Id: CID 1257798 / CID 1257805 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lavf: move internal fields from public to internal contextwm42015-02-10
| | | | | | | This is not an API change; the fields were explicitly declared private before. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* oggdec: add support for VP8 demuxingJames Almer2014-12-18
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* oggdec: add support for Opus in Ogg demuxingNicolas George2013-10-12
|
* avformat: Use av_reallocp_array() where suitableAlexandra Khirnova2013-09-10
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* ogg: Fix potential infinite discard loopReimar Döffinger2013-08-19
| | | | | | | | | | | | Seeking in certain broken files would cause ogg_read_timestamp to fail because ogg_packet would go into a state where all packets of stream 1 would be discarded until the end of the stream. Bug-Id: 553 CC: libav-stable@libav.org Signed-off-by: Jan Gerber <j@v2v.cc> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* oggdec: do not fall back on binary search in the generic code.Anton Khirnov2013-07-02
| | | | | Binary search is already attempted in the format-specific seek function, so the fallback is only reached if binary search failed already.
* ogg: relax demuxer conformance checksLuca Barbato2013-06-22
| | | | | Some samples in the wild are missing headers that are expected by the specification but in practice do not affect decoding.
* oggdec: make sure the private parse data is cleaned upLuca Barbato2013-01-06
|
* oggdec: free the ogg streams on read_header failureLuca Barbato2013-01-06
| | | | Plug an annoying memory leak on broken files.
* oggdec: check memory allocationLuca Barbato2012-12-23
|
* oggdec: K&R cosmetic formattingLuca Barbato2012-12-23
|
* ogg: calculate the start position once all the headers are parsedLuca Barbato2012-09-24
| | | | | The fisbone packets can be muxed in any order as long the last one comes before the first data packet.
* ogg: check that the expected number of headers had been parsedLuca Barbato2012-09-24
| | | | Not having the header for a codec is a tell-tale of a broken file.
* Fix uninitialized reads on malformed ogg files.Dale Curtis2012-03-08
| | | | | | | | | | The ogg decoder wasn't padding the input buffer with the appropriate FF_INPUT_BUFFER_PADDING_SIZE bytes. Which led to uninitialized reads in various pieces of parsing code when they thought they had more data than they actually did. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavf: remove AVFormatParameters from AVFormatContext.read_header signatureAnton Khirnov2012-01-27
|
* misc Doxygen markup improvementsDiego Biurrun2011-12-05
|
* lavf: make av_set_pts_info private.Anton Khirnov2011-11-30
| | | | It's supposed to be called only from (de)muxers.
* lavf: make some seeking functions privateAnton Khirnov2011-10-28
| | | | | | | Specifically av_update_cur_dts(), av_seek_frame_binary() and av_gen_search(). They are not supposed to be called outside lavf.
* lavf: replace av_new_stream->avformat_new_stream part II.Anton Khirnov2011-10-19
| | | | | | | | Manual replacements are done in this commit. In many cases, the id is some constant made up number (e.g. 0 for video and 1 for audio), which is then not used in the demuxer for anything. Those ids are removed.
* oggdec: add support for Xiph's CELT codecNicolas George2011-09-26
| | | | | | | This patch also introduces CODEC_ID_CELT. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* oggdec: fix out of bound write in the ogg demuxerLaurent Aimar2011-09-17
| | | | | | | Between ogg_save() and ogg_restore() calls, the number of streams could have been reduced. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* oggdec: prevent heap corruption.Chris Evans2011-07-11
| | | | | | | | Specifically crafted samples can reinit ogg->streams[] while reading samples, and thus we should not cache old pointers since these may no longer be valid. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* ogg: propagate return values and return more meaningful error valuesNicolas George2011-07-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* oggdec: Abort Ogg header parsing when encountering a data packet.Reimar Döffinger2011-07-04
| | | | | | Fixes Bugzilla #11. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* ogg: fix double free when finding length of small chained oggs.Ronald S. Bultje2011-06-29
| | | | | | | | ogg_save() copies streams[], but doesn't keep track of free()'ed struct members. Thus, if in between a call to ogg_save() and ogg_restore(), streams[].private was free()'ed, this would result in a double free -> crash, which happened when e.g. playing small chained ogg fragments.
* Remove stray extra arguments from av_dlog() invocations.Diego Biurrun2011-06-02
|
* Remove unused variablesMans Rullgard2011-06-02
|
* Cosmetics: fix prototypes in oggdecClément Bœsch2011-05-12
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* oggdec: fix memleak with continuous streams.Clément Bœsch2011-05-12
| | | | | | | This avoids the creation of a new AVStream instead of replacing it when a stream reset occurs (track change with some webradios for example). Signed-off-by: Diego Biurrun <diego@biurrun.de>
* oggdec: use explicit AVInputFormat struct initializersClément Bœsch2011-05-12
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* oggdec: simplify ogg_probeClément Bœsch2011-05-12
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* Replace some commented-out debug printf() / av_log() messages with av_dlog().Diego Biurrun2011-04-29
|
* oggdec: reindent after 8f3eebd6Clément Bœsch2011-04-24
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* oggdec: use av_freep() instead of av_free()Michael Niedermayer2011-04-20
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* oggdec: simplify audio chained ogg streams supportClément Bœsch2011-04-15
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* oggdec: fix demuxing chained audio streamsClément Bœsch2011-04-10
| | | | | | | | | Chained ogg served by icecast and mpd should demux properly now. Fixes issue2337 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avio: introduce an AVIOContext.seekable fieldAnton Khirnov2011-04-03
| | | | Use it instead of url_is_streamed and AVIOContext.is_streamed.
* avio: deprecate url_feofAnton Khirnov2011-03-07
| | | | | | AVIOContext.eof_reached should be used directly instead. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio_ prefix for url_fsizeAnton Khirnov2011-03-07
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: deprecate url_fgetc and remove all it usesAnton Khirnov2011-03-07
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: add avio_tell macro as a replacement for url_ftellAnton Khirnov2011-03-04
| | | | 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: rename ByteIOContext to AVIOContext.Anton Khirnov2011-02-20
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* oggdec: Fix incorrect assumption about header/data interleavingReimar Döffinger2011-02-08
| | | | | | | | | | | | Currently (since the data_offset fix) the ogg demuxer assumes that after the first non-header packets in any stream no more header packets will follow. This is not guaranteed, so change the code back again to wait until it has finished the headers for all streams before returning from ogg_get_headers. This fixes issue 2428. Signed-off-by: Mans Rullgard <mans@mansr.com>