ffmpeg: pass reference counted packet on codec copy when possible

Should prevent unnecessary copy of data in cases where new references
to the packet are created within the muxer or a bitstream filter.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
pull/283/head
James Almer 7 years ago
parent f5ceb15bb6
commit 231a73308f
  1. 5
      fftools/ffmpeg.c

@ -2049,6 +2049,11 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
opkt.flags = pkt->flags;
if (pkt->buf) {
opkt.buf = av_buffer_ref(pkt->buf);
if (!opkt.buf)
exit_program(1);
}
opkt.data = pkt->data;
opkt.size = pkt->size;

Loading…
Cancel
Save