From patchwork Fri Nov 4 21:27:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1301 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp39245vsb; Fri, 4 Nov 2016 14:27:33 -0700 (PDT) X-Received: by 10.28.74.133 with SMTP id n5mr310955wmi.132.1478294853851; Fri, 04 Nov 2016 14:27:33 -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 r143si7347280wmg.88.2016.11.04.14.27.33; Fri, 04 Nov 2016 14:27:33 -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=@googlemail.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=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2BA4E689E11; Fri, 4 Nov 2016 23:27:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E9024689D95 for ; Fri, 4 Nov 2016 23:27:21 +0200 (EET) Received: by mail-wm0-f68.google.com with SMTP id p190so5749257wmp.1 for ; Fri, 04 Nov 2016 14:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=prLFFLpwEw6l2eRkrEH60q6suzj4sTP9hwXqOcEhQI0=; b=u+1ctGkRU21cWHgQYQCYKcJn6atpEUIFd8ibjcWrIDw612vPWP3oAtU1ths9jqu9VZ tEtbq6yuLGMjITVZg3KEnh7RVtaJN89tzhJwSQ9E57EQAdmzUlOm0ndoMAFy0ibbbJne j2sv3qkn/53JhiiLGo0+CPRP5qQ3rycJy9Izm8avniLVDSnQVcJ++4ni2UzoijTcUlHw ycI5AnQ39Cb+/pZpWJKsMwytmb9Ttbm3VE/zkfdWH822eq3V/rHjHv72fGeV8bpWrsCz Gbv+HS+//kWt/z1IvcGWdwKnJsmdcshAZmz1a34moTiAV108IDl+xz+XD0EExTxGIeqI wReg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=prLFFLpwEw6l2eRkrEH60q6suzj4sTP9hwXqOcEhQI0=; b=FZe3O41HyqiGBvkAxbIQT1Loo61m0JJ6FucekBmFDHM0zJYuSKNM5Uj0rqYtz+caE6 JbN/PAy7PnrhQnLTmPlfigpwseBd9rAxPApSl80vShEtVGPWEL7TQ02yDStKIeTID1yk sEjDUZSdy2KVd8KZghpFyOxEkavfjLnvl3CnWvZWdZ+oqZluYIzNVLQIU4zY29eHM5Hj +cDCYO5vZuJCaEXhyNMcnbNIIyGieSyLGk2km2tx/54sgzKB8ftsUArQ2LPlTap8vPgK B3IBNx3sXasCE2qtoDMd1kPvifM0do2ck2ABewTb0XIBG/ax572U9t7KGHF2emIsIdhG QeWw== X-Gm-Message-State: ABUngvcaP57vfOdfPzFn/DyloK8ghNNtRSG9Kg40AhFD3FqMx2KIfONBuJs7Y1SQfCZevA== X-Received: by 10.28.175.77 with SMTP id y74mr284445wme.114.1478294844917; Fri, 04 Nov 2016 14:27:24 -0700 (PDT) Received: from [192.168.2.21] (p5B09506C.dip0.t-ipconnect.de. [91.9.80.108]) by smtp.googlemail.com with ESMTPSA id c4sm6602723wmh.4.2016.11.04.14.27.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 14:27:24 -0700 (PDT) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: Date: Fri, 4 Nov 2016 22:27:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] oggparsetheora: set need_context_update when changing codec id 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Otherwise the codec context and codecpar might disagree on the codec id, triggering asserts in av_parser_parse2. Signed-off-by: Andreas Cadhalpun --- libavformat/oggparsetheora.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index b14f9f0..078d827 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -111,6 +111,8 @@ static int theora_header(AVFormatContext *s, int idx) thp->gpmask = (1U << thp->gpshift) - 1; st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + if (st->codecpar->codec_id != AV_CODEC_ID_THEORA) + st->internal->need_context_update = 1; st->codecpar->codec_id = AV_CODEC_ID_THEORA; st->need_parsing = AVSTREAM_PARSE_HEADERS; }