From patchwork Sat Apr 22 09:04:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Faiz X-Patchwork-Id: 3466 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp650749vsd; Sat, 22 Apr 2017 02:05:37 -0700 (PDT) X-Received: by 10.28.104.195 with SMTP id d186mr2163579wmc.111.1492851937448; Sat, 22 Apr 2017 02:05:37 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u23si18172110wru.73.2017.04.22.02.05.36; Sat, 22 Apr 2017 02:05:37 -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; 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 7E0DB689A53; Sat, 22 Apr 2017 12:05:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f66.google.com (mail-it0-f66.google.com [209.85.214.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A94A66899C6 for ; Sat, 22 Apr 2017 12:05:12 +0300 (EEST) Received: by mail-it0-f66.google.com with SMTP id e132so3430019ite.2 for ; Sat, 22 Apr 2017 02:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ADTJI97v9shF0Ksk5b16II1eySD0KHrq52Avw2RdUKY=; b=MPzlMehkq4kV7Jq5ZigdDEHoKja//JwyUshFs7FvQeEVllATXdywCVIB5hwxvI9wpi YO4tmWNlHw6X+wgQJjT5OpDYgaeWG25d4n3OMaGasoBtujuDFBLJ/Eg6Nr3RK0Vlejcs vzcb2V6dQ+f6is4yz03vs80wKetNYyQm3OcZ78UbWc+XrW4B0kGrFKn4olYnRjA0tifR nioUW1/AwTcVdp42spTEpyyg8iL6SQkjlhCgk+Og6VE9vsTyvO+W20RwWOXyTe0srTMR P9GYkqqMtZh1hUKoYDdziQLCnSzf3SboFGSLHn+Mu+5SLAFCm3zIshNtN3AwSha3NcVv 1MpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ADTJI97v9shF0Ksk5b16II1eySD0KHrq52Avw2RdUKY=; b=UN/XKVDZTar5oZ7wno+15UXIaXdqfO4tc25LnHsTL2nVWMvn/azTe2aC12NKLq+VXZ djHOycXR/oFUqHMlY9vSyM9eyr/HGeTcqd+nUMRNoIhCBl18yOHQwoqob91KhizeNuhT 9jzKWrqy/5zo+nOBBTZn2AKAhyoDzENZVvkrrXJf3Nfks0GkzXq7wKzovw0aeDYDQ7B0 WRhUZ5+9Fisu/VOvdAD6joLEjrbf0wkAlMV/YFXxp3sQeTlXdQMEu08ycfQQqLoID0B8 FmF6ZNenep7cuIrvwjZZeT5dmOIUp6lDCiXA+8Amlmk/Bsjcem99pFQ0Qu+rsImLhxs7 WS1Q== X-Gm-Message-State: AN3rC/7uMqcUhUVy+A3F0ahlCLwxjZ0X8L/+uMbBVhfjiORlpRwOXO6N MRRTIisWYD8uX/qhBDw= X-Received: by 10.84.179.99 with SMTP id a90mr20580516plc.26.1492851911436; Sat, 22 Apr 2017 02:05:11 -0700 (PDT) Received: from localhost.localdomain ([114.120.232.5]) by smtp.gmail.com with ESMTPSA id o10sm20296935pgc.18.2017.04.22.02.05.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Apr 2017 02:05:10 -0700 (PDT) From: Muhammad Faiz To: ffmpeg-devel@ffmpeg.org Date: Sat, 22 Apr 2017 16:04:28 +0700 Message-Id: <20170422090428.6459-7-mfcc64@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170422090428.6459-1-mfcc64@gmail.com> References: <20170422090428.6459-1-mfcc64@gmail.com> Subject: [FFmpeg-devel] [PATCH 7/7] tests: do not use AVFrame accessor 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 Cc: Muhammad Faiz MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Muhammad Faiz --- tests/api/api-flac-test.c | 4 ++-- tests/api/api-seek-test.c | 2 +- tests/api/api-threadmessage-test.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c index 7b48059..c5a37f0 100644 --- a/tests/api/api-flac-test.c +++ b/tests/api/api-flac-test.c @@ -156,7 +156,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, generate_raw_frame((uint16_t*)(in_frame->data[0]), i, enc_ctx->sample_rate, enc_ctx->channels, enc_ctx->frame_size); - in_frame_bytes = in_frame->nb_samples * av_frame_get_channels(in_frame) * sizeof(uint16_t); + in_frame_bytes = in_frame->nb_samples * in_frame->channels * sizeof(uint16_t); if (in_frame_bytes > in_frame->linesize[0]) { av_log(NULL, AV_LOG_ERROR, "Incorrect value of input frame linesize\n"); return 1; @@ -197,7 +197,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different sample format\n"); return AVERROR_UNKNOWN; } - out_frame_bytes = out_frame->nb_samples * av_frame_get_channels(out_frame) * sizeof(uint16_t); + out_frame_bytes = out_frame->nb_samples * out_frame->channels * sizeof(uint16_t); if (out_frame_bytes > out_frame->linesize[0]) { av_log(NULL, AV_LOG_ERROR, "Incorrect value of output frame linesize\n"); return 1; diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c index 4fd1e6e..2b32cb9 100644 --- a/tests/api/api-seek-test.c +++ b/tests/api/api-seek-test.c @@ -145,7 +145,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream, } av_packet_unref(&pkt); av_init_packet(&pkt); - } while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + av_frame_get_pkt_duration(fr) <= ts_end))); + } while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + fr->pkt_duration <= ts_end))); av_packet_unref(&pkt); av_freep(&byte_buffer); diff --git a/tests/api/api-threadmessage-test.c b/tests/api/api-threadmessage-test.c index 3e0ac5c..05a8062 100644 --- a/tests/api/api-threadmessage-test.c +++ b/tests/api/api-threadmessage-test.c @@ -95,7 +95,7 @@ static void *sender_thread(void *arg) av_frame_free(&msg.frame); break; } - av_frame_set_metadata(msg.frame, meta); + msg.frame->metadata = meta; /* allocate a real frame in order to simulate "real" work */ msg.frame->format = AV_PIX_FMT_RGBA; @@ -141,7 +141,7 @@ static void *receiver_thread(void *arg) if (ret < 0) break; av_assert0(msg.magic == MAGIC); - meta = av_frame_get_metadata(msg.frame); + meta = msg.frame->metadata; e = av_dict_get(meta, "sig", NULL, 0); av_log(NULL, AV_LOG_INFO, "got \"%s\" (%p)\n", e->value, msg.frame); av_frame_free(&msg.frame);