1. 18 Apr, 2020 1 commit
  2. 13 Apr, 2020 1 commit
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Make output more deterministic · ccadd00a
      Andreas Rheinhardt authored
      Using random values for TrackUID and FileUID (as happens when the
      AVFMT_FLAG_BITEXACT flag is not set) has the obvious downside of making
      the output indeterministic. This commit mitigates this by writing the
      potentially random values with a fixed size of eight byte, even if their
      actual values would fit into less than eight bytes. This ensures that
      even in non-bitexact mode, the differences between two files generated
      with the same settings are restricted to a few bytes in the header.
      (Namely the SegmentUID, the TrackUIDs (in Tracks as well as when
      referencing them via TagTrackUID), the FileUIDs (in Attachments as
      well as in TagAttachmentUID) as well as the CRC-32 checksums of the
      Info, Tracks, Attachments and Tags level-1-elements.) Without this
      patch, there might be an offset/a size difference between two such
      files.
      
      The FATE-tests had to be updated because the fixed-sized UIDs are also
      used in bitexact mode.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      ccadd00a
  3. 02 Apr, 2020 2 commits
  4. 26 Mar, 2020 1 commit
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Avoid allocations for SeekHead · dc2f6b54
      Andreas Rheinhardt authored
      Up until e7ddafd5, the Matroska muxer wrote two SeekHeads: One at the
      beginning referencing the main level 1 elements (i.e. not the Clusters)
      and one at the end, referencing the Clusters. This second SeekHead was
      useless and has therefore been removed. Yet the SeekHead-related
      functions and structures are still geared towards this usecase: They
      are built around an allocated array of variable size that gets
      reallocated every time an element is added to it although the maximum
      number of Seek entries is a small compile-time constant, so that one should
      rather include the array in the SeekHead structure itself; and said
      structure should be contained in the MatroskaMuxContext instead of being
      allocated separately.
      
      The earlier code reserved space for a SeekHead with 10 entries, although
      we currently write at most 6. Reducing said number implied that every
      Matroska/Webm file will be 84 bytes smaller and required to adapt
      several FATE tests; furthermore, the reserved amount overestimated the
      amount needed for for the SeekHead's length field and how many bytes
      need to be reserved to write a EBML Void element, bringing the total
      reduction to 89 bytes.
      
      This also fixes a potential segfault: If !mkv->is_live and if the
      AVIOContext is initially unseekable when writing the header, the
      SeekHead is already written when writing the header and this used to
      free the SeekHead-related structures that have been allocated. But if
      the AVIOContext happens to be seekable when writing the trailer, it will
      be attempted to write the SeekHead again which will lead to segfaults
      because the corresponding structures have already been freed.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      dc2f6b54
  5. 29 Dec, 2019 2 commits
    • Andreas Rheinhardt's avatar
      avformat/matroskadec: Fix lzo decompression · 2ff687c1
      Andreas Rheinhardt authored
      When a Matroska Block is only stored in compressed form, the size of
      the uncompressed block is not explicitly coded and therefore not known
      before decompressing it. Therefore the demuxer uses a guess for the
      uncompressed size: The first guess is three times the compressed size
      and if this is not enough, it is repeatedly incremented by a factor of
      three. But when this happens with lzo, the decompression is neither
      resumed nor started again. Instead when av_lzo1x_decode indicates that x
      bytes of input data could not be decoded, because the output buffer is
      already full, the first (not the last) x bytes of the input buffer are
      resent for decoding in the next try; they overwrite already decoded
      data.
      
      This commit fixes this by instead restarting the decompression anew,
      just with a bigger buffer.
      
      This seems to be a regression since 935ec5a1.
      
      A FATE-test for this has been added.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
      2ff687c1
    • Andreas Rheinhardt's avatar
      fate/matroska: Add test for ProRes and bz2 compression · 6c735b96
      Andreas Rheinhardt authored
      This test tests that demuxing ProRes that is muxed like it should be in
      Matroska (i.e. with the first header ("icpf") atom stripped away) works;
      it also tests bz2 decompression as well as the handling of
      unknown-length clusters.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
      6c735b96
  6. 08 Dec, 2019 2 commits
  7. 07 Dec, 2019 2 commits
  8. 05 Dec, 2019 1 commit
  9. 08 May, 2019 3 commits
  10. 18 Jun, 2017 1 commit
    • Marton Balint's avatar
      fate: use do_md5sum instead of the md5 protocol for most md5 fate tests · 7ed6f916
      Marton Balint authored
      The md5 protocol has no seek support, but some tests use seeks. This changes
      the fate tests to actually create the output files and calculate the md5 on the
      written files, which also makes the tests independent of the size of the output
      buffers and output buffering in general.
      
      A new md5pipe fate test method is also introduced to keep the old functionality
      for tests where using a non-seekable output was intentional, and matroska md5
      tests are changed to use that.
      Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
      7ed6f916
  11. 28 Jan, 2017 1 commit
  12. 09 Dec, 2016 1 commit
  13. 22 Oct, 2016 1 commit
  14. 11 Oct, 2016 1 commit
  15. 06 Oct, 2016 1 commit
  16. 05 Oct, 2016 1 commit
  17. 06 Sep, 2016 1 commit
    • Rodger Combs's avatar
      lavf/matroskaenc: use mkv_check_tag_name consistently · 843e72ea
      Rodger Combs authored
      Previously, we used a different list of checks when deciding whether to
      write a set of tags at all than we did when deciding whether to write an
      individual tag in the set. This resulted in sometimes writing an empty
      tag master and seekhead. Now we use mkv_check_tag_name everywhere, so
      if a dictionary is entirely composed of tags we skip, we don't write a
      tag master at all.
      
      This affected the test file, since "language" was on one list but not
      the other, so we were writing an empty tag master there. The test hash
      is updated to reflect that change.
      843e72ea
  18. 10 May, 2016 1 commit
    • Ronald S. Bultje's avatar
      fate: add matroska-remux test. · 3ed5218b
      Ronald S. Bultje authored
      This tests automatic insertion of the vp9_superframe BSF as well as
      ensuring that the colorspace properties in the video header can be
      modified when remuxing (-c:v copy).
      3ed5218b