summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAge
* avformat/matroskadec: fix resource leakSteven Liu2017-05-07
| | | | | | | | Fixes Coverity CID: 1405453 Reviewed-by: wm4 <nfxjfg@googlemail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/matroskadec: export Content Light Level metadataJames Almer2017-04-30
| | | | | | Based on a patch by Hendrik Leppkes Signed-off-by: James Almer <jamrial@gmail.com>
* webm_dash_manifest_demuxer: Fix initialization range for files with cues at ↵Derek Buitenhuis2017-04-23
| | | | | | | | | | | | the front The WebM DASH spec states: The Initialization Segment shall not contain Clusters or Cues. The Segment Index corresponds to the Cues. Previously, it included the cues if they were at the front. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* webm_dash_manifest_demuxer: Fix UB in cue timestamp string code and make it ↵Derek Buitenhuis2017-04-23
| | | | | | | | | | | actually work Output was apparently not tested for correctness. Passing overlapping memory to snprintf causes undefined behavior, and usually resulted in only the very last timestamp being written to metadata, and not a list at all. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* matroskadec,cosmetics: fix a couple typosJames Zern2017-04-17
| | | | Signed-off-by: James Zern <jzern@google.com>
* webm_dash_manifest: Add option to specify bandwidthVignesh Venkatasubramanian2017-04-17
| | | | | | | | | Add an option to webm_dash_manifest demuxer to specify a value for "bandwidth" field in the DASH manifest. The value is then used by the muxer. Fixes an existing FIXME in the code. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: James Zern <jzern@google.com>
* Merge commit '67deba8a416d818f3d95aef0aa916589090396e2'Clément Bœsch2017-03-31
|\ | | | | | | | | | | | | * commit '67deba8a416d818f3d95aef0aa916589090396e2': Use avpriv_report_missing_feature() where appropriate Merged-by: Clément Bœsch <cboesch@gopro.com>
| * Use avpriv_report_missing_feature() where appropriateDiego Biurrun2016-11-08
| |
* | lavf: fix usages of av_get_codec_tag_string()Clément Bœsch2017-03-29
| |
* | Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'James Almer2017-03-21
|\| | | | | | | | | | | | | * commit '83548fe894cdb455cc127f754d09905b6d23c173': lavf: fix usage of AVIOContext.seekable Merged-by: James Almer <jamrial@gmail.com>
| * lavf: fix usage of AVIOContext.seekableAnton Khirnov2016-09-30
| | | | | | | | | | | | | | | | It is supposed to be a flag. The only currently defined value is AVIO_SEEKABLE_NORMAL, but other ones may be added in the future. However all the current lavf code treats this field as a bool (mainly for historical reasons). Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
| * matroskadec: export CodecDelayAnton Khirnov2016-07-03
| |
| * Mark read-only tables as staticDiego Biurrun2016-05-05
| |
* | spherical: Change types of bounding and pad to uint32_tVittorio Giovara2017-03-17
| | | | | | | | | | | | | | | | | | These values are defined to be 32bit in the specification, so it makes more sense to store them as fixed width. Based on a patch by Micahel Niedermayer <michael@niedermayer.cc>. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | matroskadec: cosmetics: Rearrange checks for projection-depedendent propertiesVittorio Giovara2017-03-07
| |
* | mkv: Export bounds and padding from spherical metadataVittorio Giovara2017-03-07
| | | | | | | | Update the fate test as needed.
* | lavf/matroskadec: Fix demuxing sipr.Carl Eugen Hoyos2017-02-28
| | | | | | | | Regression since 2c8d876d
* | lavf/matroskadec: fix is_keyframe for early BlocksChris Cunningham2017-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blocks are marked as key frames whenever the "reference" field is zero. This breaks for non-keyframe Blocks with a reference timestamp of zero. The likelihood of reference timestamp being zero is increased by a longstanding bug in muxing that encodes reference timestamp as the absolute time of the referenced frame (rather than relative to the current Block timestamp, as described in MKV spec). Now using INT64_MIN to denote "no reference". Reported to chromium at http://crbug.com/497889 (contains sample)
* | avformat/matroskadec: ProjectionPrivate is optional on Equirectangular ↵James Almer2017-01-26
| | | | | | | | | | | | | | | | projections This reflects a recent change to the spec draft. Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: Fix OOM on long streamsMichael Niedermayer2016-12-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/matroskadec: remove the strict unofficial check for Colour elementsJames Almer2016-12-10
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: allocate Colour related fields only if the file ↵James Almer2016-12-10
| | | | | | | | | | | | | | | | | | | | contains the relevant master The demuxer doesn't fill the defaults if the master isn't present. This results in codecpar->color_space being set with a value of zero (RGB) on such files. Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: remove unused variableJames Almer2016-12-08
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: fix memleak on stream side data failureJames Almer2016-12-08
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: add support for Spherical Video elementsJames Almer2016-12-07
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | matroskadec: partly revert "demux relevant subtitle packets after a seek"Rainer Hochecker2016-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts parts of c16582579b1c6f66a86615c5808cd5b2bf17be73. The hard coded 30 seconds are a lot, and finishing the seek can takes several seconds when the source is on a network share. Remove this code entirely, because it does more bad than good. (Commit message provided by committer, based on the original messages by the patch author.) Signed-off-by: Rainer Hochecker <fernetmenta@online.de> Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | matroskadec: prevent access of elements after freeingMichael Schenk2016-11-30
| | | | | | | | | | | | | | | | | | | | Using the decode interrupt feature of ffmpeg may cause crashes by accessing previously freed pointers in matroska_read_close. To prevent this reset nb_elem to zero after freeing the elements, because ffmpeg normally tests for nb_elem. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_headerAndreas Cadhalpun2016-11-08
| | | | | | | | | | | | | | The code assumes that s->streams[0] is valid. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/matroskadec: fix DiscardPadding element parsingJames Almer2016-11-08
| | | | | | | | | | | | | | | | | | | | If the value is negative then it means padding at the start of the packet instead of at the end. Based on a patch by Hendrik Leppkes. Reviewed-by: James Zern <jzern-at-google.com@ffmpeg.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: fix BitsPerChannel element's default valueJames Almer2016-10-18
| | | | | | | | | | | | | | The element is currently ignored, so there's no effective functionality change with this. Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: clarify some Colour element defaults using enum valuesJames Almer2016-10-18
| | | | | | | | | | | | | | This way it's more clear what the default values refer to, as Undetermined/Unspecified is 0 for some, 2 for others. Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: support parsing Chroma Location elementsJames Almer2016-10-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | matroskadec: fix NULL pointer dereferenceAndreas Cadhalpun2016-10-17
| | | | | | | | | | | | | | The problem was introduced in commit 1273bc6. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Partially revert "avformat/matroskadec: set aspect ratio only when ↵James Almer2016-10-16
| | | | | | | | | | | | | | | | | | | | | | DisplayWidth and DisplayHeight are in pixels" The code works just fine regardless of unit, so only make sure DisplayUnit is not "unknown". Found-by: Nicolas George <george@nsup.org> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: set aspect ratio only when DisplayWidth and ↵James Almer2016-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | DisplayHeight are in pixels A missing DisplayUnit element or one with the default value of 0 means DisplayWidth and DisplayHeight should be interpreted as pixels. The current code setting st->sample_aspect_ratio is wrong when DisplayUnit is anything else. Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: workaround the field_order bug in the Matroska muxerJames Almer2016-10-13
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: check for more reserved values on some Colour elementsJames Almer2016-10-06
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: set AVCodecParameters.field_order on progressive videoJames Almer2016-09-27
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: retain error codes in matroska_resync() and ↵Sophia Wang2016-09-28
| | | | | | | | | | | | | | matroska_read_packet() Signed-off-by: Sophia Wang <skw@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: fix decoded creation_time timestampsMarton Balint2016-08-28
| | | | | | | | | | | | | | | | | | | | | | Use proper ISO 8601 timestamps which also signal that they are in UTC. This changes the format of creation_time and modification_date metadata values from 2016-06-01 22:30:00 to 2016-01-01T22:30:00.000000Z Fixes ticket #5673. Signed-off-by: Marton Balint <cus@passwd.hu>
* | libavformat/matroskadec: Add test for seeking with codec delay.Chris Cunningham2016-07-30
| | | | | | | | | | | | Also cleanup parens for the skip_to_timecode check. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/matroskadec: fix unsigned overflow to improve seekingChris Cunningham2016-07-23
| | | | | | | | | | | | | | | | | | When seeking a file where codec delay is greater than 0, the timecode can become negative after offsetting by the codec delay. Failing to cast to a signed int64 will cause the check against skip_to_timecode to evaluate true for these negative values. This breaks the "skip_to" seek mechanism. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/matroskadec: Call matroska_read_close() on header parsing errorMichael Niedermayer2016-06-24
| | | | | | | | | | | | | | Fixes memleak Fixes Ticket5169 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/matroskadec: force 48kHz sample rate when rescaling Opus inital paddingJames Almer2016-06-07
| | | | | | | | | | | | | | | | | | | | | | Mkvtoolnix stores the sample rate of the original stream as reported by the "OpusHead" stream header instead of 48kHz, the actual sample rate of the Opus stream. Ignoring the stored sample rate and forcing 48kHz preserves the correct initial padding when remuxing such files. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/matroskadec: Fix rounding error with codec_delayMichael Niedermayer2016-06-06
| | | | | | | | | | | | Fixes Ticket5509 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '5f0226668124aa7ae4db501ba7f4ace4c770f3d1'Derek Buitenhuis2016-05-08
|\| | | | | | | | | | | | | * commit '5f0226668124aa7ae4db501ba7f4ace4c770f3d1': matroska: Support interlaced content correctly Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * matroska: Support interlaced content correctlyLuca Barbato2016-03-31
| | | | | | | | The matroska specification now has two elements for it.
| * matroska: Support V_QUICKTIME as written in the specificationLuca Barbato2016-03-15
| | | | | | | | | | | | | | | | | | | | | | | | Check if the size is written the first 4 bytes and read the next 4 as fourcc candidate, fallback checking the initial for 4 bytes. "The CodecPrivate contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory video descriptor structure (starting with the size and FourCC fields)" CC: libav-stable@libav.org
* | 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.