From patchwork Fri Aug 31 16:00:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stebbins X-Patchwork-Id: 10196 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp935182jap; Fri, 31 Aug 2018 09:00:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaSoRBeeaafz9XWxRYf3ygU95m266h7tH+GXBdwUq3OqMKAf/Hkn2JgWwgBlSDKJXyVBtA7 X-Received: by 2002:a1c:93d2:: with SMTP id v201-v6mr943927wmd.77.1535731251176; Fri, 31 Aug 2018 09:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535731251; cv=none; d=google.com; s=arc-20160816; b=R9r6B0pw1T7y5HtFF7F+5dNeJw/O4cN+VcHV3eas6cf22kMUIG5wSYtw+t/9gDfXUA h5/DZJA/Aec6pRH2/De4THS7oeFQT8RrzypkDtVVbqJvcPi32WapWtuq7XX5M04lmcZi nvocNi//JBUbOxA4Sr1MfiMwoIVcMVL99JbRzod/49cEav5CvS7H4HGS+r34nzlouHs+ 5f1ppm7DuFRRZsNDmpvVpJEmT82ShuRLjAyAtA+uFbaNtFbjEIQX7TcW5jelV0b8YDYZ fV+H/rYnF+Arw4GbyK9f3mFJrAqgMuDXQYOL0Ef1qzzFHISZVrU76/mGc6dzXZXuSjlx OpMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to:arc-authentication-results; bh=tbGWYFgUx6jGaktZrdNllOZULk0ebyT/qRxnis398Hc=; b=ZGKr2gMb0KggGzCjFvgaobldnTKgrDoUyWhsI6ll1xzOuxTAmqFh1vhu30r9ISpP7l rFGry2KeBqHd+svEzD/lgEQ3hnzCbzKbwZ+Bkelt9vNRw9bNIM7FX4KZavUVd+FwN9LJ +uJZmjtHO/WUEhSuDJwukfeSN+qCJsFDaBPBn3zfdknxn6OuEY6Qg4yDvCLcFUabuIU8 sGl18KumxZNeA36hQOJDVFfiP0Vi3qYq9F12Heo/GNNT81A6AoTb9prlOaml625wTKtD +lYqt1g0NO1jp9+4TLsNzhNIYL9rlYbWgb/DXcYrS/PVDUf5/d79MGD66CunfqqFBnG+ FBQg== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 15-v6si3376111wmj.25.2018.08.31.09.00.50; Fri, 31 Aug 2018 09:00:51 -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 743AA689EA1; Fri, 31 Aug 2018 19:00:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.jetheaddev.com (mail.jetheaddev.com [70.164.99.34]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 89BF4689E62 for ; Fri, 31 Aug 2018 19:00:38 +0300 (EEST) Received: from dionysus.jetheaddev.com (10.13.12.63) by cas.jetheaddev.com (192.168.13.27) with Microsoft SMTP Server (TLS) id 14.3.351.0; Fri, 31 Aug 2018 09:00:42 -0700 Received: from dionysus.jetheaddev.com (localhost [127.0.0.1]) by dionysus.jetheaddev.com (8.15.2/8.14.7) with ESMTP id w7VG0gtw025203 for ; Fri, 31 Aug 2018 09:00:42 -0700 Received: (from jstebbins@localhost) by dionysus.jetheaddev.com (8.15.2/8.15.2/Submit) id w7VG0fPL025202 for ffmpeg-devel@ffmpeg.org; Fri, 31 Aug 2018 09:00:41 -0700 From: John Stebbins To: Date: Fri, 31 Aug 2018 09:00:39 -0700 Message-ID: <20180831160039.25156-1-jstebbins@jetheaddev.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.13.12.63] Subject: [FFmpeg-devel] [PATCH] lavf/mov: factor out setting 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" Since it is performed in all cases now. --- libavformat/mov.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 3d4f6bcb21..4ee67cf500 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2508,22 +2508,19 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) "size=%"PRId64" 4CC=%s codec_type=%d\n", size, av_fourcc2str(format), st->codecpar->codec_type); + st->codecpar->codec_id = id; if (st->codecpar->codec_type==AVMEDIA_TYPE_VIDEO) { - st->codecpar->codec_id = id; mov_parse_stsd_video(c, pb, st, sc); } else if (st->codecpar->codec_type==AVMEDIA_TYPE_AUDIO) { - st->codecpar->codec_id = id; mov_parse_stsd_audio(c, pb, st, sc); if (st->codecpar->sample_rate < 0) { av_log(c->fc, AV_LOG_ERROR, "Invalid sample rate %d\n", st->codecpar->sample_rate); return AVERROR_INVALIDDATA; } } else if (st->codecpar->codec_type==AVMEDIA_TYPE_SUBTITLE){ - st->codecpar->codec_id = id; mov_parse_stsd_subtitle(c, pb, st, sc, size - (avio_tell(pb) - start_pos)); } else { - st->codecpar->codec_id = id; ret = mov_parse_stsd_data(c, pb, st, sc, size - (avio_tell(pb) - start_pos)); if (ret < 0)