Le quartidi 4 brumaire, an CCXXV, Clement Boesch a écrit : > > The framework will allocate a buffer and copy the data to it, > > that takes time.
> Sorry if this is a dumb question but: can you describe what happens if the
> previous packet still held the same pkt->data = c->buffer?
>
> That is, when and how the buffer copy does happen?
>
> (no need for a av_buffer_create with RO flag?)
Not dumb, but the answer was in the first sentence of the commit message.
The corresponding code is in ff_read_packet():
if (!pkt->buf) {
AVPacket tmp = { 0 };
ret = av_packet_ref(&tmp, pkt);
if (ret < 0)
return ret;
*pkt = tmp;
}
And av_packet_ref() creates a refcounted buffer if the given one is not
refcounted.
Regards,
--
Nicolas George
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
