From patchwork Sun Dec 18 12:22:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 1852 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp684679vsa; Sun, 18 Dec 2016 04:22:50 -0800 (PST) X-Received: by 10.28.175.195 with SMTP id y186mr10492105wme.68.1482063770464; Sun, 18 Dec 2016 04:22:50 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x7si14791662wjf.26.2016.12.18.04.22.50; Sun, 18 Dec 2016 04:22:50 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEB2A689E56; Sun, 18 Dec 2016 14:22:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 27C1C689E42 for ; Sun, 18 Dec 2016 14:22:18 +0200 (EET) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id uBICMPmd091900 for ; Sun, 18 Dec 2016 13:22:25 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id 045A1E0087; Sun, 18 Dec 2016 13:22:25 +0100 (CET) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Dec 2016 13:22:18 +0100 Message-Id: <20161218122221.23688-3-george@nsup.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161218122221.23688-1-george@nsup.org> References: <20161218122221.23688-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Sun, 18 Dec 2016 13:22:25 +0100 (CET) Subject: [FFmpeg-devel] [PATCH 3/6] ffplay: use buffersink accessors. 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: Nicolas George --- ffplay.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ffplay.c b/ffplay.c index 911fd7f..90bd97b 100644 --- a/ffplay.c +++ b/ffplay.c @@ -2075,7 +2075,7 @@ static int audio_thread(void *arg) goto the_end; while ((ret = av_buffersink_get_frame_flags(is->out_audio_filter, frame, 0)) >= 0) { - tb = is->out_audio_filter->inputs[0]->time_base; + tb = av_buffersink_get_time_base(is->out_audio_filter); #endif if (!(af = frame_queue_peek_writable(&is->sampq))) goto the_end; @@ -2183,7 +2183,7 @@ static int video_thread(void *arg) last_format = frame->format; last_serial = is->viddec.pkt_serial; last_vfilter_idx = is->vfilter_idx; - frame_rate = filt_out->inputs[0]->frame_rate; + frame_rate = av_buffersink_get_frame_rate(filt_out); } ret = av_buffersrc_add_frame(filt_in, frame); @@ -2204,7 +2204,7 @@ static int video_thread(void *arg) is->frame_last_filter_delay = av_gettime_relative() / 1000000.0 - is->frame_last_returned_time; if (fabs(is->frame_last_filter_delay) > AV_NOSYNC_THRESHOLD / 10.0) is->frame_last_filter_delay = 0; - tb = filt_out->inputs[0]->time_base; + tb = av_buffersink_get_time_base(filt_out); #endif duration = (frame_rate.num && frame_rate.den ? av_q2d((AVRational){frame_rate.den, frame_rate.num}) : 0); pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(tb); @@ -2641,7 +2641,7 @@ static int stream_component_open(VideoState *is, int stream_index) case AVMEDIA_TYPE_AUDIO: #if CONFIG_AVFILTER { - AVFilterLink *link; + AVFilterContext *sink; is->audio_filter_src.freq = avctx->sample_rate; is->audio_filter_src.channels = avctx->channels; @@ -2649,10 +2649,10 @@ static int stream_component_open(VideoState *is, int stream_index) is->audio_filter_src.fmt = avctx->sample_fmt; if ((ret = configure_audio_filters(is, afilters, 0)) < 0) goto fail; - link = is->out_audio_filter->inputs[0]; - sample_rate = link->sample_rate; - nb_channels = avfilter_link_get_channels(link); - channel_layout = link->channel_layout; + sink = is->out_audio_filter; + sample_rate = av_buffersink_get_sample_rate(sink); + nb_channels = av_buffersink_get_channels(sink); + channel_layout = av_buffersink_get_channel_layout(sink); } #else sample_rate = avctx->sample_rate;