[FFmpeg-devel] [PATCH 1/6] lavc/pthread: copy packet side data.

Michael Niedermayer michaelni at gmx.at
Sun Feb 23 01:44:10 CET 2014


On Fri, Feb 21, 2014 at 08:50:13PM +0100, Nicolas George wrote:
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavcodec/pthread_frame.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index 42a3c9b..f885e9f 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -317,6 +317,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
>      FrameThreadContext *fctx = p->parent;
>      PerThreadContext *prev_thread = fctx->prev_thread;
>      const AVCodec *codec = p->avctx->codec;
> +    int ret;
>  
>      if (!avpkt->size && !(codec->capabilities & CODEC_CAP_DELAY)) return 0;
>  
> @@ -340,6 +341,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
>          }
>      }
>  
> +    av_packet_free_side_data(&p->avpkt);
>      av_buffer_unref(&p->avpkt.buf);
>      p->avpkt = *avpkt;
>      if (avpkt->buf)
> @@ -354,6 +356,8 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
>          memcpy(p->buf, avpkt->data, avpkt->size);
>          memset(p->buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
>      }
> +    if ((ret = av_copy_packet_side_data(&p->avpkt, avpkt)) < 0)
> +        return ret;

patch LGTM but why isnt the code using av_copy_packet() ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140223/b89678c1/attachment.asc>


More information about the ffmpeg-devel mailing list