1. 19 May, 2020 1 commit
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Don't ignore tags of chapters written late · 4ebfc13c
      Andreas Rheinhardt authored
      The Matroska muxer writes the Chapters early when chapters were already
      available when writing the header; in this case any tags pertaining to
      these chapters get written, too.
      
      Yet if no chapters had been supplied before writing the header, Chapters
      can also be written when writing the trailer if any are supplied. Tags
      belonging to these chapters were up until now completely ignored.
      
      This commit changes this: Writing the tags belonging to chapters has
      been moved to mkv_write_chapters(). If mkv_write_tags() has not been
      called yet (i.e. when chapters are written when writing the header),
      the AVIOContext for writing the ordinary Tags element is used, but not
      output, as this is left to mkv_write_tags() in order to only write one
      Tags element. Yet if mkv_write_tags() has already been called,
      mkv_write_chapters() will output a Tags element of its own which only
      contains the tags for chapters.
      
      When chapters are available initially, the corresponding tags will now
      be the first tags in the Tags element; but the ordering of tags in Tags
      is irrelevant anyway.
      
      This commit also makes chapter_id_offset local to mkv_write_chapters()
      as it is used only there and not reused at all.
      
      Potentially writing a second Tags element means that the maximum number
      of SeekHead entries had to be incremented. All the changes to FATE
      result from the ensuing increase in the amount of space reserved for the
      SeekHead (21 bytes more).
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      4ebfc13c
  2. 18 May, 2020 1 commit
  3. 21 Apr, 2020 1 commit
  4. 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
  5. 02 Apr, 2020 1 commit
  6. 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
  7. 08 May, 2019 3 commits
  8. 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
  9. 06 Oct, 2016 1 commit
  10. 05 Oct, 2016 1 commit
  11. 02 Jul, 2016 1 commit
    • Anton Khirnov's avatar
      avconv: use avcodec_parameters_copy() with streamcopy · b55566db
      Anton Khirnov authored
      This preserves all the information in the codec parameters.
      
      The wavpack ref changes are caused by the fact that now the sample
      format is set, so matroskaenc can use it to set the bit depth.
      
      Bug-Id: 945, along with the previous commit
      b55566db
  12. 03 Apr, 2016 1 commit
  13. 05 Aug, 2015 1 commit
  14. 15 May, 2014 1 commit
    • Anton Khirnov's avatar
      lavf: add AVFMT_FLAG_BITEXACT. · 0c1959b0
      Anton Khirnov authored
      Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's
      codec context.
      
      Using codec options inside lavf is fragile and can easily break when the
      muxing codec context is not the encoding context.
      0c1959b0
  15. 18 Sep, 2013 1 commit
  16. 15 Sep, 2013 1 commit
  17. 27 Aug, 2013 1 commit
  18. 11 Jun, 2013 1 commit
  19. 28 May, 2013 2 commits
  20. 12 Jan, 2013 1 commit
  21. 28 Nov, 2012 1 commit
  22. 23 Oct, 2012 1 commit
  23. 19 May, 2012 1 commit
  24. 09 May, 2012 2 commits
  25. 13 Mar, 2012 1 commit
  26. 27 Feb, 2012 1 commit
  27. 25 Feb, 2012 1 commit