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 1C5E543A43 for ; Mon, 5 Sep 2022 10:40:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2EED868B88B; Mon, 5 Sep 2022 13:40:52 +0300 (EEST) Received: from out162-62-57-137.mail.qq.com (out162-62-57-137.mail.qq.com [162.62.57.137]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 16A3F68B6AF for ; Mon, 5 Sep 2022 13:40:44 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1662374440; bh=rSMNTsqFo7MY6VPBsEfhCwgNuPtJlsf8l9JDrIQmmnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wB1rl9T+3oXF8PaNj5juhITLKuApzqdcuAqXJbSX2zEUmpUakiu6PvPlp/YlIj09f ONTjswaapwl0DLl8P/sratqjgGm0Fr6HBVsKHR//x4u2bZiK+B4zT/OGAkQa22Dfmt ibduNrS2cV+3ZAJcNQHSY7bYLS/YBL9rv2EY3t+k= Received: from localhost.localdomain ([103.107.216.236]) by newxmesmtplogicsvrsza35.qq.com (NewEsmtp) with SMTP id A271AC85; Mon, 05 Sep 2022 18:40:39 +0800 X-QQ-mid: xmsmtpt1662374439t4f3qlnx5 Message-ID: X-QQ-XMAILINFO: Nfm/+M6ONQ575aA1GE9oHBkvLbFXf4j5Bmuxv55capgAMpvhfQTxNPMI0ZvTcl 8JA8WY5x6pGjL8Hi71ZWSyxrpKXbO/Vuls3aKNlJTyIUJ0GtaEUQOpn0g+LsDs8/cXEJgDhQw6Q4 IYu+IlAv8DW9c48V7j1uQLuCyEW6gh2ztwJZce7koZDT7B1S3H7OKB2bvgwWr+qUi6KPi8zUqT45 n14VMLCJ5Xi30D6lpqaXDDN7tM1kS3s2IarBr9q17FCoeH3b/1wUGRtqmCvG1oC/2PbtPZfDF18S OeiTQq2lRV28KyYJJfn0+guGhuxqeNI8evlAQZXWhuTSVWBWQBmjjG3jf+osucZUJZSVgsnjNLXo y3Yqn/OdXeH2ghflAfvS/oJpqQn8gk0K41awJbf+jgKcGYklf0GVxgQzMZ4ln+Ec1j3jRrK2x8IQ 8Qrd7+DdchXPEVN8hwC1uFniUfi9bio6rMOLh//PLKAx6POSW6mde+wPvQD/3lfvi7oFPwutO5c9 8rpzNcBPcPoxYR1BAZPcv6lDggQYa4rVPD56gT+plFMAt6R7FD5Dkw4azSJqcGH9CmoUfj/F7Bji /4lPKwaiV0BUgZX3vKjGpr8eArlgGmRFyYe4Ngm3WmMS5KDNqydpm72KmtASam6wPf+v/5r3QKjv kHKT3uEBFFcEQBRdc/S9vsKzS8FSS140IbUQUW2pOYfryvXuIyoYtUscwLfzsMi3hqa75Omk0v96 CaqKU7ceCRxVVRtVeJqCDLcBqj+uOqwgQiFF3JNDv0leuSG+Z8zy0HYem7txp7ZjcMquhfIUXbg+ VKEoipLdQ+qIlozWH6FvKXK3iMSUYoz4K1kvjxlSJWz8v5nK9SspzAk0BBq1skRfaFxixrv/IAL3 xFuaKo67yCM6x4+InVww8/CCy9s81Egnbc0e/xFtE4dkWRWVvPGME= From: 1035567130@qq.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Sep 2022 18:40:36 +0800 X-OQ-MSGID: <20220905104036.24578-1-1035567130@qq.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3] 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 9242047f5c..bcc00afe31 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -1915,8 +1915,14 @@ 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); - double theta = get_rotation(displaymatrix); + double theta = 0.0; + 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); + theta = get_rotation(displaymatrix); if (fabs(theta - 90) < 1.0) { INSERT_FILT("transpose", "clock"); -- 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".