From patchwork Tue Jul 26 12:56:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anssi Hannula X-Patchwork-Id: 7 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.67 with SMTP id o64csp1280569vsd; Tue, 26 Jul 2016 05:56:43 -0700 (PDT) X-Received: by 10.28.211.10 with SMTP id k10mr24765329wmg.16.1469537802990; Tue, 26 Jul 2016 05:56:42 -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 j67si1231783wmi.35.2016.07.26.05.56.42; Tue, 26 Jul 2016 05:56:42 -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; 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 4380168A443; Tue, 26 Jul 2016 15:56:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from webmail.tpnet.fi (webmail.tpnet.fi [62.106.63.33]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 66F0168A3EA for ; Tue, 26 Jul 2016 15:56:29 +0300 (EEST) Received: from mail.onse.fi (host-109-204-145-182.tp-fne.tampereenpuhelin.net [109.204.145.182]) by webmail.tpnet.fi (Postfix) with ESMTPS id AB3B8232DB for ; Tue, 26 Jul 2016 15:56:32 +0300 (EEST) Received: by mail.onse.fi (Postfix, from userid 501) id 8EB93404C6; Tue, 26 Jul 2016 15:56:32 +0300 (EEST) From: Anssi Hannula To: ffmpeg-devel@ffmpeg.org Date: Tue, 26 Jul 2016 15:56:13 +0300 Message-Id: <1469537773-29853-1-git-send-email-anssi.hannula@iki.fi> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20160726120614.GL4887@nb4> References: <20160726120614.GL4887@nb4> Subject: [FFmpeg-devel] [PATCH] avformat/utils: Fix find_stream_info not considering the extradata it found 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" Commit 9200514ad8717c6 ("lavf: replace AVStream.codec with AVStream.codecpar") merged in commit 6f69f7a8bf6a0d01 changed avformat_find_stream_info() to put the extradata it got from st->parser->parser->split() to st->internal->avctx instead of st->codec (from where it will be later copied to st->codecpar). However, in the same function, the "is stream ready?" check was changed to check for extradata in st->codecpar instead of st->codec. Extradata retrieved from split() is therefore not considered anymore, and avformat_find_stream_info() will therefore needlessly continue probing in some cases. Fix that by checking for the extradata at st->internal->avctx where it is actually put. --- Michael Niedermayer wrote: > seems to break fate here: [...] Oops, seems I messed up running fate and missed the "warning: only a subset of the fate tests will be run because SAMPLES is not specified" warning it gave... Thanks for catching that. Seems this reverse fix is actually needed, as extradata is actually copied in the other direction (from st->internal->avctx to st->codecpar). Fate passes here now. libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index e5a99ff..5a902ea 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3432,7 +3432,7 @@ FF_ENABLE_DEPRECATION_WARNINGS break; } if (st->parser && st->parser->parser->split && - !st->codecpar->extradata) + !st->internal->avctx->extradata) break; if (st->first_dts == AV_NOPTS_VALUE && !(ic->iformat->flags & AVFMT_NOTIMESTAMPS) &&