From patchwork Mon Mar 27 15:03:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ronald S. Bultje" X-Patchwork-Id: 3129 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.44.195 with SMTP id s186csp206058vss; Mon, 27 Mar 2017 08:04:08 -0700 (PDT) X-Received: by 10.28.203.204 with SMTP id b195mr10423545wmg.51.1490627048132; Mon, 27 Mar 2017 08:04:08 -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 f18si1098062wrc.171.2017.03.27.08.04.06; Mon, 27 Mar 2017 08:04:08 -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; 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 508E068836C; Mon, 27 Mar 2017 18:03:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f178.google.com (mail-qt0-f178.google.com [209.85.216.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 208666882F2 for ; Mon, 27 Mar 2017 18:03:36 +0300 (EEST) Received: by mail-qt0-f178.google.com with SMTP id i34so39881945qtc.0 for ; Mon, 27 Mar 2017 08:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R9zXMbz0mk+jI/6vl/XP0HOALM6ZLuWmhgLNDqeKAEk=; b=DfT7Tfp2ASc8K7hfKQwiUeJwO2LpoNqoTozKc17GvQDssg4wtXFTkxQnIoWd++eNgV jT4eTO8GkJmB21kmPfhBXFiV1oWFo/QJLMT4nf6L8dEeX60MxhLXHdbP74cIUHoB9QC9 /iC6n0YU85b80zsJvHiE2/82JDho2vn/QrsqxtA5QmYo7hkKXxFq5BpRIsrz1w4f33C+ Gx97OvOrVVoY4KvUIVZg4EBxkyyE4txzlJRM8Hj5toud+T9/KbXULRvMnPAfEDoXOimr p18MjtLwg28E1ihPfescmx0LJGazZ1yNAuHaUQAAnByuPS00WYlu7D6Z7gYX9JcRYgpx Z4Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R9zXMbz0mk+jI/6vl/XP0HOALM6ZLuWmhgLNDqeKAEk=; b=DzzJA76C7GAXxD5x6TW4SFbO/Xx88oIkH/ughUmw2PxoeSKW6wxlf8joJoe4Pxp6re /JzF/FHNpnD4WA6Q7h8LU5vu5r4nT2mnc8+100oynTqgiKxG0g8c+Xhe7JG6JFjgLtSl RNeop9tTuAXfyEIU/gknEjnIBd5gunXgKNLc+7uLQT7NDzmgp04Wpa1M8MQv1MV/arnG 1SMdGOznHck0piwoFeqrCW0sMuYCFC8+QKXju+krVPpHpZSyiP4KtWopbVobqMK3Oxf/ QHfKLgX3OzIRxL7MwoUHjj7OhzBAnYtU4VuywpMFVJ7Q/nEIy7jF5WPxmcP8ROcg5mgC 9Yog== X-Gm-Message-State: AFeK/H3P2787nQji4fKtmgJAijOb/xh8GrVgcYzXSP1Ny8eCYEq3g5rr+BF279uHDtm7Fg== X-Received: by 10.237.47.71 with SMTP id l65mr15037338qtd.177.1490627036714; Mon, 27 Mar 2017 08:03:56 -0700 (PDT) Received: from localhost.localdomain ([65.206.95.146]) by smtp.gmail.com with ESMTPSA id z29sm515224qtz.67.2017.03.27.08.03.56 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 27 Mar 2017 08:03:56 -0700 (PDT) From: "Ronald S. Bultje" To: ffmpeg-devel@ffmpeg.org Date: Mon, 27 Mar 2017 11:03:53 -0400 Message-Id: <1490627033-49292-1-git-send-email-rsbultje@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <20170327144903.GP4714@nb4> References: <20170327144903.GP4714@nb4> Subject: [FFmpeg-devel] [PATCH] h264: revert 1189af429211ac650aac730368a6cf5b23756605. 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 Cc: "Ronald S. Bultje" MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The patch introduces race conditions. --- libavcodec/h264_slice.c | 3 --- libavcodec/h264dec.c | 24 ------------------------ libavcodec/h264dec.h | 8 -------- 3 files changed, 35 deletions(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index a703853..fa1e9ae 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -383,9 +383,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->picture_structure = h1->picture_structure; h->mb_aff_frame = h1->mb_aff_frame; h->droppable = h1->droppable; - h->backup_width = h1->backup_width; - h->backup_height = h1->backup_height; - h->backup_pix_fmt = h1->backup_pix_fmt; for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) { ff_h264_unref_picture(h, &h->DPB[i]); diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 9042169..5f37618 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -307,9 +307,6 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) int i; h->avctx = avctx; - h->backup_width = -1; - h->backup_height = -1; - h->backup_pix_fmt = AV_PIX_FMT_NONE; h->cur_chroma_format_idc = -1; h->picture_structure = PICT_FRAME; @@ -861,14 +858,6 @@ static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp) av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(&h->sei.frame_packing), 0); - h->backup_width = h->avctx->width; - h->backup_height = h->avctx->height; - h->backup_pix_fmt = h->avctx->pix_fmt; - - h->avctx->width = dst->width; - h->avctx->height = dst->height; - h->avctx->pix_fmt = dst->format; - if (srcp->sei_recovery_frame_cnt == 0) dst->key_frame = 1; if (!srcp->crop) @@ -1003,19 +992,6 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data, h->setup_finished = 0; h->nb_slice_ctx_queued = 0; - if (h->backup_width != -1) { - avctx->width = h->backup_width; - h->backup_width = -1; - } - if (h->backup_height != -1) { - avctx->height = h->backup_height; - h->backup_height = -1; - } - if (h->backup_pix_fmt != AV_PIX_FMT_NONE) { - avctx->pix_fmt = h->backup_pix_fmt; - h->backup_pix_fmt = AV_PIX_FMT_NONE; - } - ff_h264_unref_picture(h, &h->last_pic_for_ec); /* end of stream, output what is still in the buffers */ diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 5f868b7..e994f7e 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -363,14 +363,6 @@ typedef struct H264Context { int width, height; int chroma_x_shift, chroma_y_shift; - /** - * Backup frame properties: needed, because they can be different - * between returned frame and last decoded frame. - **/ - int backup_width; - int backup_height; - enum AVPixelFormat backup_pix_fmt; - int droppable; int coded_picture_number;