From patchwork Sat Sep 23 23:35:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 5248 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp1090324jaa; Sat, 23 Sep 2017 16:35:35 -0700 (PDT) X-Received: by 10.223.136.43 with SMTP id d40mr2325093wrd.121.1506209735037; Sat, 23 Sep 2017 16:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506209735; cv=none; d=google.com; s=arc-20160816; b=AN9G1WxLvXmB90Xb8hOtxQqAXuQVsMr7Rg8dXI45TuHTOCcmUNlBuyV4b/YAqxRkC/ wlDi7kmp65ZdcMNrnAILTtm5DpbpnJdo6kRJBSVFblYX4OHBqiMCTSbB0rLtMgsOhsl7 mB7buceVMq1DdP0/glo5rExRlwoShI3DthNYYijqUe+hFU0pJ7jFAurKVtDy0XKADNvX dl5B/gsz4YGtmkDvAwMOjSfTXaw8X/XiL0OhtjyDtq9HskvN3W4APFISrKo+ZM/uYh22 MoI3CT1crd/KKx8YRV5/QNl5mvWIpMuVvxYaga6nVYLXhmx4TteI0A0DtzW97mK6oOvh yVSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ez6xVCP+kVe+gOav7bcNgzvkF8EUvbGnmUwXfLLVxbM=; b=iw9cWR1wJS4lGcNMJY9xYWYQ1zyG6U+cYOYO6+xtR3IiHeCbnnME1SyuNxmIXejwy/ kP/5qO+nhAp6EMlsLtQqPqNzc8tTKHqcPBk7hbcCDONuUvR4iscJL0bKqtzvN+9yAiqZ oTzUrHqaGRRKKwc+o/QHV108qVAoKyg/5E+Jpx0THzVQkgqxMYl/GT8IFG4CqydDvvek ocrM29BL/H1PKMAY8Kq/ebYpPhgdpkak9nW27+3Cvmmkz83maSbw2gO75YkwyNPeG3+g d+XRYSORqesAbEAdInhbW5e6yJwPPNWJnX1SM4cNGvZt8kfvl6buUx4a9YRcFWozSmqq PErw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=MqkT+zix; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a4si2217476wrh.529.2017.09.23.16.35.34; Sat, 23 Sep 2017 16:35:35 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=MqkT+zix; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6D92B688387; Sun, 24 Sep 2017 02:35:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 48A44687EE5 for ; Sun, 24 Sep 2017 02:35:08 +0300 (EEST) Received: by mail-qk0-f194.google.com with SMTP id c69so2846634qke.5 for ; Sat, 23 Sep 2017 16:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=/9lJUYxA/Uj/LRNnUwWlwAblf+rO4TmDdO2x7BLq9qE=; b=MqkT+zixgK28srGGNxBO9UkpkzamxfTxTAwRBAD9GGMPbiWX+DnLC9RiJ7ptVdMIDW c2dcb4ywYS9P35ScgMGnxMo4f5ujGd0Fucx4yjbqzNkgHT0IW1B+BAnEdJQSTcGjl3y3 kdgXUDD0WIFsxwEbD1jzyl4UqRyw+uY0t9RpiMnBmsxoXP3NdDgT6rr9To6EYJlUxsTT fau/Yj5dgP3fQrxKFO2/BlIO974Nc/bB54M6vvKW3veBiT1qhvq81fW5Of/jtYcGurNG 0qwiDmnJQu1bQiCyur2zJERqaK8VDcd7GxV5OTfNsZoSOOeqkQDbR4PGbH9VsFCm+g68 OG1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/9lJUYxA/Uj/LRNnUwWlwAblf+rO4TmDdO2x7BLq9qE=; b=Q8ATbBuEcneuTJlOJoq//vflVDtnTsP0WPiM1Qjdr+GlR46XKcKL2v5sjPEZawNlDB LdSi8vquFcZZjMwEp5+7psdaH9Rm1/9RUcqy/VVANViR94VGoY4tvzA91c7bDotZjEdJ L7VaLwGoed64NXEWG2HBygDoCha6EG7oWdTxqqDSAN8Xc452inlCBFjhfnIekR2p0YFd wt/gocwBoTgOqpwSVIdK817I/wUKJf6ApHbs+UZsdgnQMsNnsvy7czxo/7DQuYXrNc3N HEHr210u8dWLxdyHaDXq3EEbPwAZVWwCTsXehoCYW9Yoh0trT/1qgkYKWu+JBpK7+4qY 4Vjg== X-Gm-Message-State: AHPjjUhUrZErqBpkFqwnP7XYSfGnB+O8sySzrsmZh+N03EOYV4yiBZZX h/po/9tnbKEZED7MYlmTpQ2UdQ== X-Google-Smtp-Source: AOwi7QCWDuLuU2uaeBiqcnTssuZBYJ9SrSZ8mTa33CjsQnBZpXsB9yi/CnBg1Penvf0NcbRN/Pr3+Q== X-Received: by 10.55.104.138 with SMTP id d132mr5069837qkc.151.1506209718039; Sat, 23 Sep 2017 16:35:18 -0700 (PDT) Received: from localhost.localdomain ([181.231.68.242]) by smtp.gmail.com with ESMTPSA id w23sm2630030qtj.0.2017.09.23.16.35.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 23 Sep 2017 16:35:17 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Sep 2017 20:35:02 -0300 Message-Id: <20170923233503.364-2-jamrial@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170923233503.364-1-jamrial@gmail.com> References: <20170923233503.364-1-jamrial@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/3] avformat: replace all uses of av_copy_packet() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: James Almer --- libavformat/aiffenc.c | 2 +- libavformat/apngenc.c | 4 ++-- libavformat/gif.c | 4 ++-- libavformat/img2enc.c | 2 +- libavformat/movenc.c | 4 ++-- libavformat/mp3enc.c | 2 +- libavformat/subtitles.c | 2 +- libavformat/webpenc.c | 2 +- libavformat/wtvenc.c | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c index fcadf149a0..7687e71b76 100644 --- a/libavformat/aiffenc.c +++ b/libavformat/aiffenc.c @@ -233,7 +233,7 @@ static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt) if (!pict_list) return AVERROR(ENOMEM); - if ((ret = av_copy_packet(&pict_list->pkt, pkt)) < 0) { + if ((ret = av_packet_ref(&pict_list->pkt, pkt)) < 0) { av_freep(&pict_list); return ret; } diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c index d4191c02cc..77c1c916c2 100644 --- a/libavformat/apngenc.c +++ b/libavformat/apngenc.c @@ -218,7 +218,7 @@ static int flush_packet(AVFormatContext *format_context, AVPacket *packet) av_packet_unref(apng->prev_packet); if (packet) - av_copy_packet(apng->prev_packet, packet); + av_packet_ref(apng->prev_packet, packet); return 0; } @@ -232,7 +232,7 @@ static int apng_write_packet(AVFormatContext *format_context, AVPacket *packet) if (!apng->prev_packet) return AVERROR(ENOMEM); - av_copy_packet(apng->prev_packet, packet); + av_packet_ref(apng->prev_packet, packet); } else { ret = flush_packet(format_context, packet); if (ret < 0) diff --git a/libavformat/gif.c b/libavformat/gif.c index d6113dbc85..01d98a27b0 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -175,7 +175,7 @@ static int flush_packet(AVFormatContext *s, AVPacket *new) av_packet_unref(gif->prev_pkt); if (new) - av_copy_packet(gif->prev_pkt, new); + av_packet_ref(gif->prev_pkt, new); return 0; } @@ -206,7 +206,7 @@ static int gif_write_packet(AVFormatContext *s, AVPacket *pkt) gif_image_write_header(s->pb, video_st, gif->loop, palette); } - return av_copy_packet(gif->prev_pkt, pkt); + return av_packet_ref(gif->prev_pkt, pkt); } return flush_packet(s, pkt); } diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c index 87b5ec2317..9b60bfc75c 100644 --- a/libavformat/img2enc.c +++ b/libavformat/img2enc.c @@ -161,7 +161,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) st->id = pkt->stream_index; fmt->pb = pb[0]; - if ((ret = av_copy_packet(&pkt2, pkt)) < 0 || + if ((ret = av_packet_ref(&pkt2, pkt)) < 0 || (ret = av_dup_packet(&pkt2)) < 0 || (ret = avcodec_parameters_copy(st->codecpar, s->streams[0]->codecpar)) < 0 || (ret = avformat_write_header(fmt, NULL)) < 0 || diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 10b959ad02..aa0b60c345 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -438,7 +438,7 @@ concatenate: if (!info->num_blocks) { int ret; - if ((ret = av_copy_packet(&info->pkt, pkt)) < 0) + if ((ret = av_packet_ref(&info->pkt, pkt)) < 0) return ret; info->num_blocks = num_blocks; return 0; @@ -454,7 +454,7 @@ concatenate: if (info->num_blocks != 6) return 0; av_packet_unref(pkt); - if ((ret = av_copy_packet(pkt, &info->pkt)) < 0) + if ((ret = av_packet_ref(pkt, &info->pkt)) < 0) return ret; av_packet_unref(&info->pkt); info->num_blocks = 0; diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 3cbf7bd137..826878eca1 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -523,7 +523,7 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt) return mp3_write_audio_packet(s, pkt); } - ret = av_copy_packet(&pktl->pkt, pkt); + ret = av_packet_ref(&pktl->pkt, pkt); if (ret < 0) { av_freep(&pktl); return ret; diff --git a/libavformat/subtitles.c b/libavformat/subtitles.c index 108f909c84..93c9ef05cf 100644 --- a/libavformat/subtitles.c +++ b/libavformat/subtitles.c @@ -211,7 +211,7 @@ int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt) if (q->current_sub_idx == q->nb_subs) return AVERROR_EOF; - if (av_copy_packet(pkt, sub) < 0) { + if (av_packet_ref(pkt, sub) < 0) { return AVERROR(ENOMEM); } diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c index 2e0147cefd..9fb472257d 100644 --- a/libavformat/webpenc.c +++ b/libavformat/webpenc.c @@ -158,7 +158,7 @@ static int webp_write_packet(AVFormatContext *s, AVPacket *pkt) int ret; if ((ret = flush(s, 0, pkt->pts)) < 0) return ret; - av_copy_packet(&w->last_pkt, pkt); + av_packet_ref(&w->last_pkt, pkt); } ++w->frame_count; diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c index 4925a60049..4a68b8133f 100644 --- a/libavformat/wtvenc.c +++ b/libavformat/wtvenc.c @@ -464,7 +464,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) AVStream *st = s->streams[pkt->stream_index]; if (st->codecpar->codec_id == AV_CODEC_ID_MJPEG && !wctx->thumbnail.size) { - av_copy_packet(&wctx->thumbnail, pkt); + av_packet_ref(&wctx->thumbnail, pkt); return 0; } else if (st->codecpar->codec_id == AV_CODEC_ID_H264) { int ret = ff_check_h264_startcode(s, st, pkt);