From patchwork Tue Dec 27 18:02:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 1943 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1594412vsb; Tue, 27 Dec 2016 10:02:45 -0800 (PST) X-Received: by 10.194.0.70 with SMTP id 6mr19162282wjc.215.1482861765057; Tue, 27 Dec 2016 10:02:45 -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 r3si50768758wjs.183.2016.12.27.10.02.44; Tue, 27 Dec 2016 10:02:45 -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 68B96689D07; Tue, 27 Dec 2016 20:02:20 +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 7800E689CF4 for ; Tue, 27 Dec 2016 20:02:14 +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 uBRI2Gu1003072 for ; Tue, 27 Dec 2016 19:02:16 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id AB4C3E00F9; Tue, 27 Dec 2016 19:02:16 +0100 (CET) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Dec 2016 19:02:04 +0100 Message-Id: <20161227180210.23100-3-george@nsup.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161227180210.23100-1-george@nsup.org> References: <20161227180210.23100-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Tue, 27 Dec 2016 19:02:16 +0100 (CET) Subject: [FFmpeg-devel] [PATCH 3/9] 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(-) Unchanged. diff --git a/ffplay.c b/ffplay.c index bca2d5cbaa..967679e60b 100644 --- a/ffplay.c +++ b/ffplay.c @@ -2076,7 +2076,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; @@ -2184,7 +2184,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); @@ -2205,7 +2205,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); @@ -2642,7 +2642,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; @@ -2650,10 +2650,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;