1. 20 Apr, 2020 20 commits
  2. 19 Apr, 2020 7 commits
  3. 18 Apr, 2020 7 commits
  4. 17 Apr, 2020 6 commits
    • Andreas Rheinhardt's avatar
      avformat/flacenc: Don't allocate updated streaminfo separately · 1d15e420
      Andreas Rheinhardt authored
      It is a small buffer of a known, fixed size and so it should simply be
      put into the muxer's context.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      1d15e420
    • Andreas Rheinhardt's avatar
      avformat/flacenc: Only update streaminfo if it has changed · 9311ece7
      Andreas Rheinhardt authored
      An AVStream's codecpar is supposed to be filled by the caller before
      avformat_write_header(); if the CodecParameters change, the caller
      should signal this via packet side data, but not touch the AVStream's
      codecpar.
      
      The FLAC muxer checks for packet side data containing updated extradata,
      yet if nothing has arrived by the time the trailer is written, the
      already written extradata is overwritten by the very same extradata
      again, unless the output is unseekable, in which case a warning that the
      FLAC header can't be rewritten is emitted.
      
      This commit changes this by only trying to rewrite the extradata if a
      new streaminfo arrived via packet side data. Only then is a warning
      emitted in case the output is unseekable.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      9311ece7
    • Andreas Rheinhardt's avatar
      libavformat/mux, mxfenc: Don't initialize unnecessarily · e79309fd
      Andreas Rheinhardt authored
      When no packet could be output, the interleavement functions
      nevertheless initialized the packet destined for output (with the
      exception of the data and size fields, making the initialization
      pointless), although it will not be used at all. So remove the
      initializations.
      Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      e79309fd
    • Andreas Rheinhardt's avatar
      avformat/mux: Remove pointless timestamp backups · 148bcc0b
      Andreas Rheinhardt authored
      write_packet() currently saves the original timestamps of the packet it
      got and restores them in case writing fails. This is unnecessary as we
      are no longer working directly with the user-supplied AVPacket here; and
      it is also pointless because the timestamps may already have been
      altered before write_packet().
      
      So remove this and add a general comment to the function that timestamps
      may be modified; also remove a long outdated comment about side data.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      148bcc0b
    • Andreas Rheinhardt's avatar
      avformat/mux: Don't modify packets we don't own · fe251f77
      Andreas Rheinhardt authored
      The documentation of av_write_frame() explicitly states that the function
      doesn't take ownership of the packets sent to it; while av_write_frame()
      does not directly unreference the packets after having written them, it
      nevertheless modifies the packet in various ways:
      1. The timestamps might be modified either by prepare_input_packet() or
      compute_muxer_pkt_fields().
      2. If a bitstream filter gets applied, it takes ownership of the
      reference and the side-data in the packet sent to it.
      In case of do_packet_auto_bsf(), the end result is that the returned packet
      contains the output of the last bsf in the chain. If an error happens,
      a blank packet will be returned; a packet may also simply not lead to
      any output (vp9_superframe).
      This also implies that side data needs to be really copied and can't be
      shared with the input packet.
      The method choosen here minimizes copying of data: When the input isn't
      refcounted and no bitstream filter is applied, the packet's data will
      not be copied.
      
      Notice that packets that contain uncoded frames are exempt from this
      because these packets are not owned by and returned to the user. This
      also moves unreferencing the packets containing uncoded frames to
      av_write_frame() in the noninterleaved codepath; in the interleaved
      codepath, these packets are already freed in av_interleaved_write_frame(),
      so that unreferencing the packets in write_uncoded_frame_internal() is
      no longer needed. It has been removed.
      Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      fe251f77
    • Andreas Rheinhardt's avatar
      avformat/mux: Remove redundant resetting · 00aa6dea
      Andreas Rheinhardt authored
      Now that ff_interleave_add_packet() always returns blank packets, the
      input packet to ff_interleave_packet_per_dts() will always be blank on
      return as well (if supplied) and the same goes for interleave_packet()
      in mux.c. Document these facts and remove the redundant resetting that
      happened in av_interleaved_write_frame().
      
      The last reference to the (long removed) destruct field that AVPackets
      once had has been removed as well when updating the documentation of
      ff_interleave_packet_per_dts().
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      00aa6dea