From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3AA1B441D1 for ; Thu, 1 Sep 2022 04:53:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E0B8168BA0D; Thu, 1 Sep 2022 07:53:23 +0300 (EEST) Received: from out203-205-251-80.mail.qq.com (out203-205-251-80.mail.qq.com [203.205.251.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 35E1368B9ED for ; Thu, 1 Sep 2022 07:53:17 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1662007993; bh=v+naqyBclKCYuoPgCmfFAR0GJeZPedXnbYX1AoeAjJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hVD065yYy5IIjLP6apMFf5UDRUdghVEQfrc/LCAyxVzBGvRrDMqAyrlXNl2uJjhBR SRZ13QowfxqxiigyKa0PVhRHxusTBFFLbFg33RquYSyFtGMC9lgHuKQB5E65LJprPV pcfTAG4dOM6/R4zEmGyg7W3d4jbKtqwskV+o8PMg= Received: from localhost.localdomain ([103.107.217.225]) by newxmesmtplogicsvrsza30.qq.com (NewEsmtp) with SMTP id D4C01C61; Thu, 01 Sep 2022 12:53:12 +0800 X-QQ-mid: xmsmtpt1662007992tx2l8h7hz Message-ID: X-QQ-XMAILINFO: NNoVXaH09J17b2Hk/tf+5XE/2/ucQjkH0xuwi6dpJoGhKU2NXoFWhl7RoeDMbq hMIYG7U0D/oU64OLoG6BpVqyny56jY/zsBCfGnoPjYvvpjUlzTKpyz5SUzsNmCYN/gZU8AYK/EYS +uaG9eitKtnjM3s3DgLbk91j2zkVlmAOLs5BIoe4oG/EolYn/4Etql5tfyBeJuaDbQtBzJItLeDZ szFbHcxIsJwBxU66g2BNqUTVw8uhs3dj6GNd9DrYPjx0isH3s1BrNMcb5J09VmTaJdClUPn0kVIj DZv0HbuS09laFyv1sdDes9JMU9k8CTPiiqfWK0HEUq7py3a2ZWDDq0v5tZPL2jpiMA5z//LW94MV Dnt7nu/NeWo0jndvgq8cPKWYZJ0dV8yvGa0cTH57HkA+WDgm92f8xPOMeu6eYfvRbdDn2a6LQ2UR oOO/uK5yV2bBB37Cpy+s115W4jXL6OIK6GzSUu4Pmiru+TuFZwxhusg7LjLnMnaKNw5ReXbIWn6c eBMou2ZjBivrAev1gIAuUki9dO8ygxIkh/7s+TVAvANLeSQo4ZDQ8N+AB2fKxzV6F2//J4UEo6Zl Ixu+hR1FnbaBlPtJvKwHOXuUcaQ5lUrcXi8vmeI7trBWpf6jhuVUwl2KvvhujkwqKeJLMTYWmsDw odoBNDAsDzu6BiLi2612hvz0qhtb9AOwnOJk5IGsngnf05suzUc0nvQuNhpcLfwiqc5gdG4Z59Dh zjo8ntj0PRSe7tAUYO+SxQQaAktaZEIMRHC3LEhMtqDflrD26stZC1cr0qihJJF5Z1Eq5kHHpA8n vJiSIv5wi5GaKZ1+271G8cmeOhYGVGL1mRXyLTg3FMjJdunVp2NDBjqD9ApalOBPNJPfp6JpnjGV JHYRhXzinIenofsFR0Ob4WkwK3MdKQ9NOIhWJrZCyB From: 1035567130@qq.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Sep 2022 12:53:03 +0800 X-OQ-MSGID: <20220901045303.59009-1-1035567130@qq.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] fftools/ffplay: fix rotation incorrect when frame contains the displaymatrix X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Wang Yaqiang Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wang Yaqiang For example, if the jpeg contains exif information and the rotation direction is included in the exif, the displaymatrix will be set on the side_data of the frame when decoding. However, when ffplay is used to play the image, only the side data in the stream will be determined. It does not check whether the frame also contains rotation information, causing it to play in the wrong direction Signed-off-by: Wang Yaqiang --- fftools/ffplay.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 9242047f5c..5bda29169d 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -1915,7 +1915,12 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c } while (0) if (autorotate) { - int32_t *displaymatrix = (int32_t *)av_stream_get_side_data(is->video_st, AV_PKT_DATA_DISPLAYMATRIX, NULL); + int32_t *displaymatrix = NULL; + AVFrameSideData *sd = av_frame_get_side_data(frame,AV_FRAME_DATA_DISPLAYMATRIX); + if (sd) + displaymatrix = (int32_t *)sd->data; + if (!displaymatrix) + displaymatrix = (int32_t *)av_stream_get_side_data(is->video_st, AV_PKT_DATA_DISPLAYMATRIX, NULL); double theta = get_rotation(displaymatrix); if (fabs(theta - 90) < 1.0) { -- 2.33.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".