summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
Commit message (Collapse)AuthorAge
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* 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.
* flvdec: Add sanity checking of the last packet sizeMartin Storsjö2016-01-19
| | | | | | | | For http, this avoids spurious warnings about failed requests (e.g. HTTP error 416 Requested Range Not Satisfiable), if the last packet is truncated and the size read is bogus. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: perform duration search just onceMichael Niedermayer2016-01-19
| | | | | | | | When loading a truncated flv file, it would previously try to do a seek to the end of every packet read. For some input protocols (such as http), such repeated seek attempts are cripple the reading performance. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: do not create any streams in read_header()Anton Khirnov2015-12-12
| | | | | | | | | | | The current muxer behaviour is to create streams in read_header() based on the audio/video presence flags, but fill in the stream parameters later when we actually get some packets for them. This is rather shady, since other demuxers set the stream parameters immediately when the stream is created and do not touch the stream codec context after that. Change the flv demuxer to behave in the same way as other similar demuxers -- create the streams only when we get a packet for them.
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* flv: Name an enum and use its typeVittorio Giovara2015-06-12
|
* Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-19
| | | | This applies to every library where performance is not critical.
* avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* flvdec: Document how the duration is retrieved at the end of the fileUwe L. Korn2014-11-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: make sure to check create_stream and report the same errorVittorio Giovara2014-10-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 732242
* flvdec: avoid unitialized use of a struct memberVittorio Giovara2014-10-21
| | | | | CC: libav-stable@libav.org Bug-Id: CID 718141
* flvdec: update AVFormatContext.event_flags with METADATA_UPDATED whenever ↵Andrew Stone2014-08-13
| | | | | | metadata changes. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Expose metadata found in onCuePoint events in .flv files.Andrew Stone2014-08-13
| | | | | | | | | | | | | | | | Currently, only onMetaData is used, but some providers (wrongly) put metadata into onCuePoint events, and it's still nice to be able to use that data. onCuePoint events also present metadata slightly differently than onMetaData events: all metadata is found inside an object called "parameters". In order to extract this metadata, it's easiest to recurse through the object tree and pull out anything found in child objects and put it in the top-level metadata. Reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/2/help.html?content=00001404.html Signed-off-by: Anton Khirnov <anton@khirnov.net>
* flv: Index the audio streamLuca Barbato2014-08-01
| | | | | And leverage the video index if the video is just disabled as wm4 did in an initial patch.
* flvdec: Do not default to a video and audio streamUwe L. Korn2014-06-01
| | | | | | | | | If no streams were indicated in the FLV header, do not automatically allocate by default a video and an audio stream. Instead, in the case that the header did not indicate the presence of any data, allocate no stream until data actually arrives for one type. Signed-off-by: Martin Storsjö <martin@martin.st>
* flv: Do not mangle dts values for negative ctsLuca Barbato2014-04-23
| | | | Some applications really mean to send negative pts.
* flv: Warn only onceLuca Barbato2014-04-23
| | | | No point in sending the message multiple time.
* flv: Improve log messagesLuca Barbato2014-04-23
| | | | | Messages should start with a capital letter and possibly end with a "." if they are statements.
* flv: Workaround for buggy Omnia A/XE encoderBenjamin Larsson2014-01-11
| | | | | | | | | The Omnia A/XE encoder writes the explicit extra data incorrectly and wrongly disables parametric stereo. Truncating the extra data by setting the size to 2 works around this. The AAC extra data parser will then only parse the correct parts. Bug-id: 599
* flv: Make onTextData parsing robustLuca Barbato2013-09-22
| | | | Certain streaming servers do not preserve the order of the fields.
* flv: Do not export datastream as metadataLuca Barbato2013-09-16
| | | | It is used internally.
* flv: Fix the help stringLuca Barbato2013-08-27
|
* flvdec: Eliminate completely silly gotoDiego Biurrun2013-08-01
|
* flvdec: K&R formatting cosmeticsDiego Biurrun2013-08-01
|
* flvdec: Fix = vs. == typo in sample rate checkDiego Biurrun2013-08-01
|
* Remove unreachable returnsDiego Biurrun2013-07-27
|
* flvdec: read audio sample size and channels metadataJustin Ruggles2013-03-28
| | | | | This is needed in order for the FLV demuxer not to detect a codec change when using the "flv_metadata" option.
* flvdec: use the correct audio codec id when parsing metadataJustin Ruggles2013-03-28
|
* flvdec: Check the return value of a mallocMartin Storsjö2013-03-02
| | | | | | | | | | The callers of this function can't report errors sanely. If this one malloc fails, don't write the extradata byte, make sure we try to malloc it the next time we're called instead, and make sure we still consume the input data byte. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Don't read the VP6 header byte when setting codec type based on metadataMartin Storsjö2013-03-02
| | | | | | | | | This header byte is only present when actually reading a VP6 frame, not when reading the codec type field in the metadata. This potential bug has been present since 5b54a90c. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: set channel layoutJustin Ruggles2012-11-12
|
* flvdec: always set AVFMTCTX_NOHEADER.Anton Khirnov2012-09-11
| | | | New streams may be created at any time, e.g. on codec change.
* avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-04
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* Improve descriptiveness of a number of codec and container long namesDiego Biurrun2012-07-30
|
* flvdec: remove spurious use of stream idLuca Barbato2012-07-29
| | | | We match streams by codec id now.
* flvdec: Treat all nellymoser versions as the same codecMartin Storsjö2012-07-05
| | | | | | | | This avoids creating new AVStreams for them when switching between different variants of them, since we can handle changes between different sample rates of nellymoser within the same stream. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: optionally trust the metadataLuca Barbato2012-07-05
| | | | | In certain conditions video or audio frames might appear way later in the stream.
* flvdec: initial stream switch supportLuca Barbato2012-07-03
| | | | Codec change midstream gets mapped to a separate stream.
* flv: add support for G.711Damien Fetis2012-06-28
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* flvdec: remove incomplete, disabled seeking codeRonald S. Bultje2012-06-19
|
* flv: support stream text data as onTextDataLuca Barbato2012-06-03
| | | | | | | Adobe specifies onTextData as the standard message to use to deliver text information. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* flvdec: Make sure sample_rate is set to the updated valueMartin Storsjö2012-05-23
| | | | | | | | | | | | | | | | The sample_rate variable is used for checks for audio format changes at the end of the function. This fixes cases where the sample rate was set from the codec id by flv_set_audio_codec (as for nellymoser 8 kHz/16 kHz), so the value set to last_sample_rate wasn't equal to sample_rate at this point. This caused the demuxer otherwise reports a spurious change to 5512 Hz and back to the correct one. Updating channels in the same way is only done for consistency. Currently, flv_set_audio_codec doesn't update that value. Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Align muxer/demuxer declarationsMartin Storsjö2012-04-06
| | | | | | | Also add missing trailing commas, break long codec_tag lines and add spaces in codec_tag declarations. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Remove the now redundant check for known broken metadata creatorMichael Niedermayer2012-02-27
| | | | | | The index validation identifies these indexes as broken. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Validate index entries added from metadata while readingMartin Storsjö2012-02-27
| | | | | | | | | | | By validating the index entries while reading, we don't need to seek at startup to validate the entries. If the error in the index entries is not pointing to (our definition of) the start of packets, and there is an index entry pointing at some of the first packets after the metadata, the invalid index can be discarded almost immediately. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Ignore the index if the ignidx flag is setMartin Storsjö2012-02-22
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Fix indentationMartin Storsjö2012-02-22
| | | | | | Also split a long line. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: remove the pointless value field from flv and iv8Anton Khirnov2012-01-31
| | | | The demuxers don't use it in any way.