1. 23 Apr, 2020 2 commits
  2. 22 Apr, 2020 15 commits
  3. 21 Apr, 2020 16 commits
  4. 20 Apr, 2020 7 commits
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Improve Cues in case of no video · 945b9287
      Andreas Rheinhardt authored
      The Matroska muxer currently only adds CuePoints in three cases:
      a) For video keyframes. b) For the first audio frame in a new Cluster if
      in DASH-mode. c) For subtitles. This means that ordinary Matroska audio
      files won't have any Cues which impedes seeking.
      
      This commit changes this. For every track in a file without video track
      it is checked and tracked whether a Cue entry has already been added
      for said track for the current Cluster. This is used to add a Cue entry
      for each first packet of each track in each Cluster.
      
      Implements #3149.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      945b9287
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Remove limit on the number of tracks · 13c12cd4
      Andreas Rheinhardt authored
      The Matroska file format has practically no limit on the number of
      tracks (the current limit is 2^56 - 1); yet because they are encoded in
      a variable length format in (Simple)Blocks this muxer has simply imposed
      a limit on the number of tracks in order to ensure that they can always
      be written on one byte in order to simplify the muxing process.
      
      This commit removes said limit.
      
      Also, zero is an invalid TrackNumber, so disallow this value in the
      dash_track_number option.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      13c12cd4
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Refactor writing EBML lengths · 112afacc
      Andreas Rheinhardt authored
      This commit factors the ability to write ordinary EBML numbers out of
      the functions for writing EBML lengths. This is in preparation for
      future commits.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      112afacc
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Rename functions to better reflect what they do · 40d038a6
      Andreas Rheinhardt authored
      EBML uses variable length integers both for the EBML IDs as well as for
      the EBML lengths; Matroska also uses them for the TrackNumber in
      (Simple)Blocks and for the lengths of laces when EBML lacing is used.
      
      When encoding EBML lengths, certain encodings have a special meaning,
      namely that the element has an unknown length. This is not so when
      encoding general EBML variable length integers.
      
      Yet the functions called ebml_num_size() and put_ebml_num() had this
      special meaning hardcoded, i.e. they are there to write EBML lengths and
      not general EBML numbers. So rename them.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      40d038a6
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Make ebml_num_size() more robust · 9b0f9003
      Andreas Rheinhardt authored
      Matroska (or actually EBML) uses variable-length numbers where only
      seven bits of every byte is usable for the length; the other bits encode
      the length of the variable-length number. So in order to find out how
      many bytes one needs to encode a given number one can use a loop like
      while (num >> 7 * bytes) bytes++; the Matroska muxer effectively did this.
      
      Yet it has a disadvantage: It is impossible for the result of a single
      right shift of an unsigned number with most significant bit set to be
      zero, because one can only shift by 0..(width - 1). On some
      architectures like x64 it is not even possible to do it with undefined
      right shifts in which case this leads to an infinite loop.
      
      This can be easily avoided by switching to a loop whose condition is
      (num >>= 7). The maximum value the so modified function can return
      is 10; any value > 8 is invalid and will now lead to an assert in
      put_ebml_num() or in start_ebml_master() (or actually in
      put_ebml_size_unknown()).
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      9b0f9003
    • Andreas Rheinhardt's avatar
      avformat/matroska: Move mime_tag lists to matroskadec · 67e957b4
      Andreas Rheinhardt authored
      They are not used any more by the muxer.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      67e957b4
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Improve mimetype search · 3589b3f2
      Andreas Rheinhardt authored
      Use the mime_types of the corresponding AVCodecDescriptor instead of
      tables specific to Matroska. The former are generally more encompassing:
      They contain every item of the current lists except "text/plain" for
      AV_CODEC_ID_TEXT and "binary" for AV_CODEC_ID_BIN_DATA.
      
      The former has been preserved by special-casing it while the latter is
      a hack added in c9212abf so that the demuxer (which uses the same tables)
      sets the appropriate CodecID for broken files ("binary" is not a correct
      mime type at all); using it for the muxer was a mistake. The correct
      mime type for AV_CODEC_ID_BIN_DATA is "application/octet-stream" and
      this is what one gets from the AVCodecDescriptor.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      3589b3f2