mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 10:22:10 +00:00
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>
This commit is contained in:
parent
f5ceb15bb6
commit
231a73308f
@ -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…
Reference in New Issue
Block a user