aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* lavf/concatdec: do not access packet if av_read_frame returned errorMarton Balint2016-01-101-3/+7
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Add integer fps from 31 to 60 to get_std_framerate()Michael Niedermayer2016-01-092-4/+8
| | | | | | Fixes Ticket 5106 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: Check that pkt duration is within 32bit rangeMichael Niedermayer2016-01-091-4/+4
| | | | | | | Durations outside are not supported Fixes Ticket5114 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ivfenc: fix division by zeroMichael Niedermayer2016-01-081-2/+3
| | | | | | Fixes Ticket 5115 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Simplify format checking codeMichael Niedermayer2016-01-081-9/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskadec: A_QUICKTIME and fourcc 0x00000000Mats Peterson2016-01-081-0/+9
| | | | | | | | | | | | | | | In many older QuickTime files, the audio format, or "fourcc", is 0x00000000. The QuickTime File Format Specification states the following regarding this situation: "This format descriptor should not be used, but may be found in some files. Samples are assumed to be stored in either 'raw ' or 'twos' format, depending on the sample size field in the sound description." MPlayer handles this logic by itself, but FFmpeg/FFplay currently does not. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/mov: Audio and fourcc 0x00000000Mats Peterson2016-01-081-1/+15
| | | | | | | | | | | | | | | In many older QuickTime files, the audio format, or "fourcc", is 0x00000000. The QuickTime File Format Specification states the following regarding this situation: "This format descriptor should not be used, but may be found in some files. Samples are assumed to be stored in either 'raw ' or 'twos' format, depending on the sample size field in the sound description." MPlayer handles this logic by itself, but FFmpeg/FFplay currently does not. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/uncodedframecrcenc: use FF_CEIL_RSHIFT()Clément Bœsch2016-01-071-1/+1
|
* lavf/matroskadec: correct codec_tag for "SMI" SVQ3 filesMats Peterson2016-01-061-2/+4
| | | | | | This corrects the codec_tag for some SVQ3 files Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskaenc: Assume 48kHz sample rate for Opus initial padding.Carl Eugen Hoyos2016-01-052-2/+2
| | | | | Analyzed by Timothy B. Terriberry in Mozilla bug 1227153. Fixes ticket #5121.
* brstm: fix missing closing braceAndreas Cadhalpun2016-01-041-0/+1
| | | | Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* brstm: also allocate b->table in read_packetAndreas Cadhalpun2016-01-041-0/+4
| | | | | | | | This fixes NULL pointer dereferencing if the codec is forced to adpcm_thp even though a different one was detected. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* brstm: make sure an ADPC chunk was read for adpcm_thpAndreas Cadhalpun2016-01-041-0/+5
| | | | | | | This fixes NULL pointer dereferencing. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* lavf/qtpalette: Ignore greyscale bit in certain casesMats Peterson2016-01-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QuickTime File Format Specification states the following: "Depth: A 16-bit integer that indicates the pixel depth of the compressed image. Values of 1, 2, 4, 8 ,16, 24, and 32 indicate the depth of color images. The value 32 should be used only if the image contains an alpha channel. Values of 34, 36, and 40 indicate 2-, 4-, and 8-bit grayscale, respectively, for grayscale images." There is no mention of value 33, i.e. 1-bit video (0x01) with the greyscale bit (0x20) set. I therefore suggest that we ignore the greyscale bit when processing 1-bit video. Another reason to do this is that the first 1-bit sample file below will be displayed properly with blue colors in QuickTime in Windows or Mac *in spite of* the greyscale bit being set. Also, QuickTime in Windows or Mac ignores the greyscale bit if the video sample description contains a palette, regardless of bit depth. This is undocumented behaviour, but I think we should do the same, and it seems pretty logical after all, since one wouldn't really bother putting a customized palette into a grayscale file anyway. See the second 8-bit sample file below, which has the greyscale bit set, and which contains a palette in the video sample description. In Windows or Mac, it will be displayed with the palette in the sample description, in spite of the greyscale bit being set. Sample file 1 (1-bit QuickTime Animation): https://drive.google.com/open?id=0B3_pEBoLs0faTThSek1EeXQ0ZHM Earth Spin 1-bit qtrle orig.mov Sample file 2 (8-bit QuickTime Animation): https://drive.google.com/open?id=0B3_pEBoLs0fad2s0V1YzUWo5aDA quiz-palette+gs.mov Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmdec: reset packet_end in case of failureAndreas Cadhalpun2016-01-031-3/+6
| | | | | | | | This fixes segmentation faults caused by passing a packet_ptr of NULL to memcpy. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat/ffmdec: Add {} to nested if/elseMichael Niedermayer2016-01-031-3/+4
| | | | | | | This preempts potential bugs if this is changed and the indention ends up different from C interpretation Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmdec: change type of state and id to unsignedAndreas Cadhalpun2016-01-021-2/+3
| | | | | | | | This fixes ubsan runtime error: left shift by 8 places cannot be represented in type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Merge commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1'Hendrik Leppkes2016-01-022-3/+3
|\ | | | | | | | | | | | | * commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1': Remove stray line breaks from avpriv_{report_missing_feature|request_samples} Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * Remove stray line breaks from avpriv_{report_missing_feature|request_samples}Diego Biurrun2015-12-262-3/+3
| |
* | Merge commit '5049f6b772891cdf4030a9d572362efc8f7ae97f'Hendrik Leppkes2016-01-021-6/+0
|\| | | | | | | | | | | | | * commit '5049f6b772891cdf4030a9d572362efc8f7ae97f': rtpdec_jpeg: Coalesce redundant error checks Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * rtpdec_jpeg: Coalesce redundant error checksDiego Biurrun2015-12-261-6/+0
| |
| * mpegtsenc: add flag to embed an AC-3 ES the DVB wayStefan Pöschel2015-12-141-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | So far an AC-3 elementary stream is refered to in the PMT according to System A (ATSC). However System B (DVB) has a different way to signal an AC-3 ES within the PMT. This different way can be enabled by a new flag. The flag is more generally named 'system_b' as there are further differences between ATSC and DVB (e.g. the signalling of E-AC-3) which should then also be covered by it in the future. Bug-Id: 73 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * r3d: fix an invalid read introduced in 6bf4c1dAnton Khirnov2015-12-141-1/+1
| |
* | oggparsedaala: reject too large gpshiftAndreas Cadhalpun2016-01-022-2/+7
| | | | | | | | | | | | | | | | | | | | | | Also use a unsigned constant for the shift calculation, as 1 << 31 is undefined for int32_t. This is also fixed oggparsetheora. This fixes ubsan runtime error: shift exponent is too large for 32-bit type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec/utils: fix AVPacket lifetime in seek_frame_genericHendrik Leppkes2016-01-021-2/+5
| | | | | | | | Fixes ticket #5117
* | avformat/mp3dec: Remove unused variableMichael Niedermayer2016-01-011-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/srtdec: rewrite parsing logicClément Bœsch2016-01-011-50/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Ticket #5032 The samples in Ticket #5032 is using \r\r\n as line breaks. Since we already are handling \r, or \n, or \r\n as line breaks, \r\n\n will be considered as a double line breaks. This is an issue because ff_subtitles_read_text_chunk() will as a result stop extracting a chunk after just one line. So instead of parsing the SRT by "chunks" (which means splitting every double LB), this new parser is detecting timing lines, and split the events on this basis. While this sounds safe and simple, it needs to take into account the event number preceding the timing line while handling situations such as: - event number starting at 0 or actually any number instead of 1 - event numbers not being ordered at all - event number being followed by text garbage (this really happened, see Ticket #4898) - event payload containing one or multiple number (a protagonist saying a count-down, a date or whatever) which could be confused with a chapter number - event number being empty (see Ticket #2167) - all kind of weird line breaks can appear randomly like wild pokémons - untrustable line breaks (Ticket #5032) The sample madness.srt tries to sum up most of this into one sample, ticket5032-rrn.srt is the file containing \r\r\n line breaks. and empty-events-2167.srt contains empty events.
* | Merge commit '64f8c439fd663fec4d57ac21af572d498fe21f7a'Hendrik Leppkes2016-01-011-2/+2
|\| | | | | | | | | | | | | * commit '64f8c439fd663fec4d57ac21af572d498fe21f7a': rtmpproto: Include the full path as app when "slist=" is found Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * rtmpproto: Include the full path as app when "slist=" is foundMartin Storsjö2015-12-131-2/+2
| | | | | | | | | | | | | | This matches what librtmp does. This fixes automatic url parsing of crunchyroll urls. Signed-off-by: Martin Storsjö <martin@martin.st>
| * vocdec: do not create the stream in read_header()Anton Khirnov2015-12-121-5/+8
| | | | | | | | | | The stream parameters are not known until we read a packet, so postpone creating it until then.
* | Merge commit '2d0432d918a71468419b7ac1e543ab3b399d3d37'Hendrik Leppkes2016-01-011-38/+39
|\| | | | | | | | | | | | | * commit '2d0432d918a71468419b7ac1e543ab3b399d3d37': vocdec: put the code not shared with other demuxers under appropriate ifdef Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * vocdec: put the code not shared with other demuxers under appropriate ifdefAnton Khirnov2015-12-121-38/+39
| |
| * flvdec: do not create any streams in read_header()Anton Khirnov2015-12-121-9/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Revert "Merge commit '9f1eccb97bf8894cb18b14f642500686505ef186'"Michael Niedermayer2016-01-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This unbreaks muxing-encoding Example: ffmpeg -i matrixbench_mpeg2.mpg new.avi -rw-r----- 1 michael michael 226035354 Jan 1 16:27 new.avi -rw-r----- 1 michael michael 10016802 Jan 1 16:28 ref.avi Also av_get_audio_frame_duration() itself uses frame_size This reverts commit 29e6606e9b42aa811be995e2fcdea4806911bc9f, reversing changes made to 53448461a7720afab0d1f1234af79573fd2e020d.
* | Merge commit '72d658766e6ccf198317dffd6499c5e288847a1c'Hendrik Leppkes2016-01-011-11/+6
|\| | | | | | | | | | | | | * commit '72d658766e6ccf198317dffd6499c5e288847a1c': mp3dec: replace avpriv_mpa_decode_header with avpriv_mpegaudio_decode_header Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mp3dec: replace avpriv_mpa_decode_header with avpriv_mpegaudio_decode_headerAnton Khirnov2015-12-121-11/+6
| | | | | | | | | | The latter does not require a full AVCodecContext and still provides all the functionality needed here.
* | Merge commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c'Hendrik Leppkes2016-01-012-8/+8
|\| | | | | | | | | | | | | * commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c': mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_headerAnton Khirnov2015-12-122-7/+10
| | | | | | | | | | | | Almost all the places from which this function is called already check the header manually and in the two that don't (the mp3 muxer) the check should not cause any problems.
* | Merge commit '6bf4c1d71199b92894f24db6386ed5070e590a16'Hendrik Leppkes2016-01-011-13/+26
|\| | | | | | | | | | | | | * commit '6bf4c1d71199b92894f24db6386ed5070e590a16': r3d: do not create the audio stream until we know the sample rate Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * r3d: do not create the audio stream until we know the sample rateAnton Khirnov2015-12-121-12/+25
| |
* | Merge commit '9f1eccb97bf8894cb18b14f642500686505ef186'Hendrik Leppkes2016-01-011-5/+0
|\| | | | | | | | | | | | | * commit '9f1eccb97bf8894cb18b14f642500686505ef186': ff_parse_specific_params: do not use AVCodecContext.frame_size Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * ff_parse_specific_params: do not use AVCodecContext.frame_sizeAnton Khirnov2015-12-121-5/+0
| | | | | | | | | | | | It will not be set unless the muxing codec context is also the encoding context, which is discouraged. When the frame size is not known from av_get_audio_frame_duration(), the fallback should still be good enough.
* | Merge commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666'Hendrik Leppkes2016-01-011-2/+5
|\| | | | | | | | | | | | | * commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666': rmenc: do not use AVCodecContext.frame_size Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * rmenc: do not use AVCodecContext.frame_sizeAnton Khirnov2015-12-121-2/+5
| | | | | | | | | | | | It will not be set if the stream codec context is not the encoding context. Use av_get_audio_frame_duration() instead, it should work for all audio codecs supported by the muxer.
* | avformat/mov: support cenc (common encryption)erankor2015-12-312-0/+194
| | | | | | | | | | | | | | | | | | | | support reading encrypted mp4 using aes-ctr, conforming to ISO/IEC 23001-7. a new parameter was added: - decryption_key - 128 bit decryption key (hex) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: Use strict_std_compliance from the muxer layer instead of ↵Michael Niedermayer2015-12-301-1/+1
| | | | | | | | | | | | the encoder layer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | oggparsedaala: check number of planes in pixel format mapAndreas Cadhalpun2015-12-291-0/+6
| | | | | | | | | | | | | | This fixes crashes caused by out-of-bounds writes. Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavf/qtpalette: Treat 1-bit video as palettizedMats Peterson2015-12-292-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit for qtpalette.c and qtpalette.h adds 1-bit video to the "palettized video" category, since if the video sample description contains a palette, the two colors in the palette can be any color, not necessarily black & white. Unfortunately, I've noticed that the qtrle (QuickTime Animation) decoder blindly assumes that 1-bit video is black & white. I don't have enough knowledge about the decoder to fix this, though. Below is a link to a sample 1-bit QuickTime Animation clip of a rotating earth that uses blueish colors, and they will be correctly rendered in QuickTime, but not in FFmpeg (which will use black & white). https://drive.google.com/open?id=0B3_pEBoLs0faUlItWm9KaGJSTEE Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mpegtsenc: add automatic bitstream filteringRodger Combs2015-12-281-30/+35
| |
* | lavf/matroskaenc: add automatic bitstream filteringRodger Combs2015-12-281-8/+35
| |