[FFmpeg-devel] [PATCH v1 3/3] avformat/movenc: replace the deprecated av_copy_packet_side_data

James Almer jamrial at gmail.com
Wed Sep 4 18:36:16 EEST 2019


On 9/4/2019 12:27 PM, lance.lmwang at gmail.com wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavformat/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index edddfee..503f099 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -518,7 +518,7 @@ concatenate:
>          memcpy(info->pkt.data + info->pkt.size - pkt->size, pkt->data, pkt->size);
>          info->num_blocks += num_blocks;
>          info->pkt.duration += pkt->duration;
> -        if ((ret = av_copy_packet_side_data(&info->pkt, pkt)) < 0)
> +        if ((ret = av_packet_copy_props(&info->pkt, pkt)) < 0)

av_packet_copy_props() will overwrite almost every info->pkt field,
which in this case will result in lost information. Just look at the
line above accumulating packet durations before this call.

I don't know what could be the cleanest solution for this. I suggested
adding a replacement for av_copy_packet_side_data() using the
av_packet_* namespace, but the idea was rejected.

>              goto end;
>          if (info->num_blocks != 6)
>              goto end;
> 



More information about the ffmpeg-devel mailing list