On Tue, Oct 25, 2016 at 07:58:56PM +0200, Nicolas George wrote: > 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. >
I was wondering where and how, > 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. I see, that makes sense. Thanks for clarifying. -- Clément B. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel