From patchwork Thu Aug 10 02:43:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 4669 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp1811407vsu; Wed, 9 Aug 2017 19:49:45 -0700 (PDT) X-Received: by 10.28.238.71 with SMTP id m68mr6655584wmh.130.1502333384977; Wed, 09 Aug 2017 19:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502333384; cv=none; d=google.com; s=arc-20160816; b=pegOXDxykOB3OEIEBEYVpnlXoy6RC/qOqeZcXuE5GGao7rnFMIvTcaG+CbcbY20FOE cHbckVNfFhhXgYc0H5DGyWcMUIKZyHmUWzj3DT+UHDj2EkdOb3fHcdlVmR7J6qFYbF92 Us9wpP1ZF482rUpZgU6rrn8ovE9u4po2hmwkJv6clHY61tBUFwQfut/c7O2OukyKkiJF l8SqHdqYsorB7HSL530+oeJ1qn51Ed6zGep6ezX32aLwWBGa7Tt3c5UJ5M+sP+Y41I1Z YitleA1e3/aZSzO2QUNVMW5kI3B7QL9y7CouO9cDyLw1Xv71pgI6JoL3AAh/kf3/zvWl RNQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=3kDUn25gw7m0a4+zNS5YvkBEylCjzV3WBMBqXA/wsw8=; b=ENbGc3U9JK/0ifZx5nDUKVSZ9v6y+la8ycrQLv5kKyaORs4y0mxDUnu0Un59h+Os7T EcqswVvrAhk2wZ73gvlE1LhYQ0B2aC2ry2lWFWGDhzakDzJV2xmubHF5skyW1MvdW8Xs ZRgnRL58LOypFsOFb+PjSB+YXCf1DxJ0YtkIc1AaeyRm9nKOQqiQSxFbK/q42aflbvDD NZSucpexKXovJ7KX1j80600LeGH99/CpWzeiwxGoiaauQjNbAN3AiLnbQiAURChVYfXD tA9xl0gSaqy3UVhbWepwscgrxgXNUUi/m8jKT8qC3RwaFpPnA0Q+rEbkb7GMXeFjTQff n8og== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=XQ8/PryA; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i57si4420254wra.459.2017.08.09.19.49.44; Wed, 09 Aug 2017 19:49:44 -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=@gmail.com header.s=20161025 header.b=XQ8/PryA; 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=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4357F689B3A; Thu, 10 Aug 2017 05:49:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D0D3F6891FB for ; Thu, 10 Aug 2017 05:49:32 +0300 (EEST) Received: by mail-qk0-f196.google.com with SMTP id q66so7423808qki.1 for ; Wed, 09 Aug 2017 19:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=NA7mxEpvjrL3ZCEQ9grNDi/dnfXnr7f4pAqeZLHkdsA=; b=XQ8/PryA0SzlTEU7PWN5xGxQDYrLsyIsnOaMxYIVSeylSX/hKNDbLNDxZMDJFNZSXn xyknJ1q7jB6KgzuwSUvu1tpQFtHknLRpJ64yxOrkzSz71sUGELscLMLZ6O+ETtiRSOdB bRWxMz9bKylJsSEXeAJTTv5mis2h3Uya9YGUhHEAS3nvxSo6/5MDWLG2b9h+GPLpkhk5 ZXVuPKzw+Hy3/j0l+MOwNLfTUSYDezsGhG0jxUCuf+4u6frc+6RTl39kc78kMAgR6+1P PR6t+RX4AfYQqhb1KMsm+hsxGlM9+27+gPtPEmFYTwZW/yYF575vXXpijd79Qmup7ETy e94w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=NA7mxEpvjrL3ZCEQ9grNDi/dnfXnr7f4pAqeZLHkdsA=; b=EXlrAfWwYdpjCQdMxrD4z7/vv1ThPlL+7O5YTLGJp9t3jM3XBz0PMlUzBK4faFCtK2 XLwp5AdD85NSJFU1IUkfxnXo88OEbXa964DqaYVdpWYL1zKEILc5IKH2DGXEf6qr14HK YyNhSfzON3+JAAqTzz8F1TkXHDwvZHqdSMCQ4f30cspV3LwvzGMMVyFEkskgnAOIiFMw iOf88BzFz6qgGf6SUvShA0RYoW6PpZJ6PFnwPbVHdJfVR4t6RoctBxwAj8dElxOYu4Pc WLSVrz9n1CEIlUjv3OHaWVTHbyERtL4Ql3NadO7jv5oGCNBg61/ehq4wcmdqujvT3rkR 7L3g== X-Gm-Message-State: AHYfb5ieXhXh4/TknIL4PHXBpRWyXgG6hB1WDEvIKiuoDVUGxeiA1zvW qrHDit/MJ+X1Jygf X-Received: by 10.55.24.160 with SMTP id 32mr13353650qky.297.1502333045272; Wed, 09 Aug 2017 19:44:05 -0700 (PDT) Received: from localhost.localdomain ([181.231.116.134]) by smtp.gmail.com with ESMTPSA id j62sm2848741qkc.28.2017.08.09.19.44.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Aug 2017 19:44:04 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Aug 2017 23:43:36 -0300 Message-Id: <20170810024336.7540-1-jamrial@gmail.com> X-Mailer: git-send-email 2.13.3 Subject: [FFmpeg-devel] [PATCH] ffmpeg: fix setting field_order during muxing 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" AVFrame.top_field_first doxy states "If the content is interlaced, is top field displayed first." And AVFieldOrder doxy defines: AV_FIELD_TB, //< Top coded first, bottom displayed first AV_FIELD_BT, //< Bottom coded first, top displayed first Fixes ticket #6577 Signed-off-by: James Almer --- ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 888d19a647..a08db61ea3 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1206,7 +1206,7 @@ static void do_video_out(OutputFile *of, avoid any copies. We support temporarily the older method. */ if (in_picture->interlaced_frame) - mux_par->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; + mux_par->field_order = in_picture->top_field_first ? AV_FIELD_BT:AV_FIELD_TB; else mux_par->field_order = AV_FIELD_PROGRESSIVE; pkt.data = (uint8_t *)in_picture; @@ -1229,7 +1229,7 @@ static void do_video_out(OutputFile *of, if (enc->codec->id == AV_CODEC_ID_MJPEG) mux_par->field_order = in_picture->top_field_first ? AV_FIELD_TT:AV_FIELD_BB; else - mux_par->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; + mux_par->field_order = in_picture->top_field_first ? AV_FIELD_BT:AV_FIELD_TB; } else mux_par->field_order = AV_FIELD_PROGRESSIVE;