You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02: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:
@@ -2049,6 +2049,11 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
|
|||||||
|
|
||||||
opkt.flags = pkt->flags;
|
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.data = pkt->data;
|
||||||
opkt.size = pkt->size;
|
opkt.size = pkt->size;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user