1. 18 May, 2020 7 commits
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Don't reserve space for duration when unseekable · 81e39cf4
      Andreas Rheinhardt authored
      We won't be able to seek back to write the actual duration anyway.
      
      FATE-tests using the md5pipe command had to be updated due to this change.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      81e39cf4
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Remove inconsistencies wrt seekability handling · 1779f0b1
      Andreas Rheinhardt authored
      The Matroska muxer behaves differently in several ways when it thinks
      that it is in unseekable/livestreaming mode: It does not add Cue entries
      because they won't be written anyway for a livestream and it writes some
      elements only preliminarily (with the intention to overwrite them with
      an updated version at the end) when non-livestreaming etc.
      
      There are two ways to set the Matroska muxer into livestreaming mode:
      Setting an option or by providing an unseekable AVIOContext. Yet the
      actual checks were not consistent:
      
      If the AVIOContext was unseekable and no AAC extradata was available
      when writing the header, writing the header failed; but if the AVIOContext
      was seekable, it didn't, because the muxer expected to get the extradata
      via packet side-data. Here the livestreaming option has not been checked,
      although one can't use the updated extradata in case it is a livestream.
      
      If the reserve_index_space option was used, space for writing Cues would
      be reserved when writing the header unless the AVIOContext was
      unseekable. Yet Cues were only written if the livestreaming option was
      not set and the AVIOContext was seekable (when writing the trailer), so
      if the AVIOContext was seekable and the livestreaming option set, the
      reserved space would never be used at all.
      
      If the AVIOContext was unseekable and the livestreaming option was not
      set, it would be attempted to update the main length field at the end.
      After all, it might be possible that the file is so short that it fits
      into the AVIOContext's buffer in which case the seek back would work.
      Yet this is dangerous: It might be that we are not dealing with a
      simple output file, but that our output gets split into chunks and that
      each of these chunks is actually seekable. In this case some part of the
      last chunk (namely the eight bytes that have the same offset as the
      length field had in the header) will be overwritten with what the muxer
      wrongly believes to be the filesize.
      (The livestreaming option has been added to deal with this scenario,
      yet its documentation ("Write files assuming it is a live stream.")
      doesn't make this clear at all. At least the segment muxer does not
      set the option for live and given that the chances of successfully
      seeking when the output is actually unseekable are slim, it is best to
      not attempt to update the length field in the unseekable case at all.)
      
      All these inconsistencies were fixed by treating the output as seekable
      if the livestreaming option is not set and if the AVIOContext is
      seekable. A macro has been used to enforce consistency and improve code
      readability.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      1779f0b1
    • Andreas Rheinhardt's avatar
      avformat/matroskaenc: Don't segfault when seekability changes · 8aabcf6c
      Andreas Rheinhardt authored
      If the Matroska muxer's AVIOContext was unseekable when writing the
      header, but is seekable when writing the trailer, the code for writing
      the trailer presumes that a dynamic buffer exists and tries to update
      its content in order to overwrite data that has already been
      preliminarily written when writing the header, yet said buffer doesn't
      exist as it has been written finally and not preliminarily when writing
      the header (because of the unseekability it was presumed that one won't
      be able to update the data anyway).
      
      This commit adds a check for this and also for a similar situation
      involving updating extradata with new data from packet side-data.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      8aabcf6c
    • James Almer's avatar
      avcodec/frame_thread_encoder: check for frame threading codec cap instead of intra only · 6275a7ec
      James Almer authored
      It's the correct dedicated capability reported by supported encoders.
      Otherwise, the frame thread path will be used for unsupported encoders
      like r210 for no gain.
      Reviewed-by: 's avatarAnton Khirnov <anton@khirnov.net>
      Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
      6275a7ec
    • James Almer's avatar
      49220869
    • Linjie Fu's avatar
      lavc/qsvenc: add encode support for HEVC 4:2:2 8-bit and 10-bit · 8999a2f2
      Linjie Fu authored
      Enables HEVC Range Extension encoding support (Linux) for 4:2:2 8/10 bit
      on ICL+ (gen11 +) platform.
      
      Restricted to linux only for now.
      Signed-off-by: 's avatarLinjie Fu <linjie.fu@intel.com>
      8999a2f2
    • Linjie Fu's avatar
      lavc/qsvdec: add decode support for HEVC 4:2:2 8-bit and 10-bit · 9723d7d5
      Linjie Fu authored
      Enables HEVC Range Extension decoding support (Linux) for 4:2:2 8/10 bit
      on ICL+ (gen11 +) platform.
      
      Restricted to linux only for now.
      Signed-off-by: 's avatarLinjie Fu <linjie.fu@intel.com>
      9723d7d5
  2. 17 May, 2020 4 commits
    • Andreas Rheinhardt's avatar
      avformat/hlsenc: Don't segfault on uncommon names · 3ab6a923
      Andreas Rheinhardt authored
      The parsing process of the AVOpt-enabled string controlling the mapping
      of input streams to variant streams is roughly as follows: Space and tab
      separate variant stream group maps while the entries in each variant
      stream group map are separated by ','.
      
      The parsing process of each variant stream group proceeded as follows:
      At first the number of occurences of "a:", "v:" and "s:" in each variant
      stream group is calculated so that one can can allocate an array of
      streams with this number of entries. Then the string is split along ','
      and each substring is parsed. If such a substring starts with "a:", "s:"
      or "v:" it is treated as stream specifier and (if there is a correct
      number after ':') a stream of the variant stream is mapped to one of the
      actual input streams.
      
      Nothing actually guarantees that the number of streams allocated initially
      equals the number of streams that are mapped to an actual input stream.
      These numbers can differ if e.g. the name, the sgroup, agroup or ccgroup
      of the variant stream contain "a:", "s:" or "v:".
      
      The problem hereby is that the rest of the code presumes these numbers
      to be equal and segfaults if it isn't (because the corresponding input
      stream is NULL).
      
      This commit fixes this by modifying the initial counting process to only
      count occurences of "a:", "s:" or "v:" that are at the beginning or that
      immediately follow a ','.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      3ab6a923
    • James Almer's avatar
    • Michael Niedermayer's avatar
      avformat/mpegts: Shuffle avio_seek · cd74af14
      Michael Niedermayer authored
      This avoids accessing an old, no longer valid buffer.
      Fixes: out of array access
      Fixes: crash_audio-2020
      Found-by: 's avatarle wu <shoulewoba@gmail.com>
      Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      cd74af14
    • Derek Buitenhuis's avatar
      avformat/dump: Use int64_t for intermediate time values · 5d9ce445
      Derek Buitenhuis authored
      Prevents wrap-around to negative values while calculating the duration string.
      
      Before:
      
          Duration: -411422:-59:-42.17, start: 0.000000, bitrate: 0 kb/s
      
      After:
      
          Duration: 781623:28:34.17, start: 0.000000, bitrate: 0 kb/s
      Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
      5d9ce445
  3. 16 May, 2020 7 commits
  4. 15 May, 2020 19 commits
  5. 14 May, 2020 3 commits