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 7FEB248042 for ; Wed, 8 Nov 2023 23:33:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 85ABC68CB85; Thu, 9 Nov 2023 01:33:56 +0200 (EET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 78B4668C5D4 for ; Thu, 9 Nov 2023 01:33:50 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id DCF0AE0004 for ; Wed, 8 Nov 2023 23:33:49 +0000 (UTC) Date: Thu, 9 Nov 2023 00:33:49 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231108233349.GU3543730@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffplay: use SDL_WaitEvent instead of SDL_PeepEvents while paused 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 Content-Type: multipart/mixed; boundary="===============6030773670973655139==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6030773670973655139== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JWzqRxeJFOoryc0B" Content-Disposition: inline --JWzqRxeJFOoryc0B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 07, 2023 at 08:57:57PM +0000, Bolshoy Toster wrote: > Currently, when ffplay is paused, it still constantly polls for events at > the > REFRESH_RATE (100 times per second). This leads to a high (5-10% on the > latest > commit, using SDL2 2.28.5-1) CPU usage, when it should be idle. >=20 > This commit changes this behavior to use SDL_WaitEvent while paused, > allowing > ffplay to use less (0-5% under X11) CPU time while paused on supported > platforms > (windows, X11 and wayland) with SDL versions >=3D2.0.16. >=20 > This has the side effect of only running the refresh loop when there's an > event, > preventing the cursor from being hidden while paused. >=20 > Signed-off-by: bolshoytoster > --- > fftools/ffplay.c | 31 ++++++++++++++++++++----------- > 1 file changed, 20 insertions(+), 11 deletions(-) >=20 > diff --git a/fftools/ffplay.c b/fftools/ffplay.c > index d8c69e1..7814589 100644 > --- a/fftools/ffplay.c > +++ b/fftools/ffplay.c > @@ -3221,20 +3221,29 @@ static void toggle_audio_display(VideoState *is) > } > } > +static void refresh(VideoState *is, double *remaining_time) { > + if (!cursor_hidden && av_gettime_relative() - cursor_last_shown > > CURSOR_HIDE_DELAY) { > + SDL_ShowCursor(0); patch corupted by line breaks Applying: fftools/ffplay: use SDL_WaitEvent instead of SDL_PeepEvents while= paused error: corrupt patch at line 50 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "I am not trying to be anyone's saviour, I'm trying to think about the future and not be sad" - Elon Musk --JWzqRxeJFOoryc0B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZUwa3QAKCRBhHseHBAsP q8PQAJ41LZJp8u0l5kw5hwbbojNsCFFKugCgiYMEKCpISwZ+zkF3sKQQzh4Xa7M= =U97B -----END PGP SIGNATURE----- --JWzqRxeJFOoryc0B-- --===============6030773670973655139== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============6030773670973655139==--