1. 20 Apr, 2020 5 commits
  2. 19 Apr, 2020 7 commits
  3. 18 Apr, 2020 7 commits
  4. 17 Apr, 2020 17 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
    • Andreas Rheinhardt's avatar
      avformat/mux: Fix leak when adding packet to interleavement queue fails · a43120b6
      Andreas Rheinhardt authored
      When an error happened in ff_interleave_add_packet() when adding
      a packet to the packet queue, said packet would not be unreferenced
      in ff_interleave_add_packet(), but would be zeroed in
      av_interleaved_write_frame(), which results in a memleak.
      
      This has been fixed: ff_interleave_add_packet() now always unreferences
      the input packet on error; as a result, it always returns blank packets
      which has been documented. Relying on this a call to av_packet_unref()
      in ff_audio_rechunk_interleave() can be removed.
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      a43120b6
    • Andreas Rheinhardt's avatar
      avformat/mux: Fix leaks on error when writing noninterleaved uncoded frames · 1004a92c
      Andreas Rheinhardt authored
      If writing uncoded frames in noninterleaved mode fails at the preparatory
      steps (i.e. before it reaches write_packet()), the packet would not be
      unreferenced and the frame would leak. This is fixed by unreferencing
      the packet in write_uncoded_frame_internal() instead.
      
      This also makes it possible to remove the unreferencing in
      write_packet() itself: In noninterleaved mode frames are now freed in
      write_uncoded_frame_internal(), while they are freed in interleaved
      mode when their containing packet gets unreferenced (like normal
      packets).
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      1004a92c
    • Andreas Rheinhardt's avatar
      avformat/mux: Make uncoded frames av_packet_unref() compatible · ad1dc918
      Andreas Rheinhardt authored
      Currently uncoded frames (i.e. packets whose data actually points to an
      AVFrame) are not refcounted. As a consequence, calling av_packet_unref()
      on them will not free them, but may simply make sure that they leak by
      losing the pointer to the frame.
      
      This commit changes this by actually making uncoded frames refcounted.
      In order not to rely on sizeof(AVFrame) (which is not part of the public
      API and so must not be used here in libavformat) the packet's data is
      changed to a (padded) buffer containing just a pointer to an AVFrame.
      Said buffer is owned by an AVBuffer with a custom free function that
      frees the frame as well as the buffer. Thereby the pointer/the AVBuffer
      owns the AVFrame.
      
      Said ownership can actually be transferred by copying and resetting
      the pointer, as might happen when actually writing the uncoded frames
      in AVOutputFormat.write_uncoded_frame() (although currently no muxer
      makes use of this possibility).
      
      This makes packets containing uncoded frames compatible with
      av_packet_unref(). This already has three advantages in interleaved mode:
      1. If an error happens at the preparatory steps (before the packet is
      put into the interleavement queue), the frame is properly freed.
      2. If the trailer is never written, the frames still in the
      interleavement queue will now be properly freed by
      ff_packet_list_free().
      3. The custom code for moving the packet to the packet list in
      ff_interleave_add_packet() can be removed.
      
      It will also simplify fixing further memleaks in future commits.
      Suggested-by: 's avatarMarton Balint <cus@passwd.hu>
      Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
      ad1dc918
    • Marton Balint's avatar
      avcodec/bsf: use simplified algorithm for bsf_list chained filtering · 7d894454
      Marton Balint authored
      Based on the one in ffmpeg.c and it is not using an extra flush_idx variable.
      Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
      7d894454
    • Limin Wang's avatar
      403bee30
    • Paul B Mahol's avatar
      24db9372
    • Paul B Mahol's avatar
      715da295
    • Paul B Mahol's avatar
      avfilter/af_astats: measure noise floor · 87b4fb65
      Paul B Mahol authored
      87b4fb65
    • Peter Ross's avatar
      avcodec/mv30: use aandcttables · 1b59f3f8
      Peter Ross authored
      1b59f3f8
    • Peter Ross's avatar
      avcodec/mv30: remove unused table elements · 06dab51e
      Peter Ross authored
      06dab51e
    • Peter Ross's avatar
      avcodec/vp3: fix indentation · 3e5f0cf2
      Peter Ross authored
      3e5f0cf2
  5. 16 Apr, 2020 4 commits