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 1E3E4455EF for ; Tue, 7 Feb 2023 08:34:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8EC8B68BEC9; Tue, 7 Feb 2023 10:33:58 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A597668B75F for ; Tue, 7 Feb 2023 10:33:51 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 193842404EE for ; Tue, 7 Feb 2023 09:33:51 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 45Txcwmb83mm for ; Tue, 7 Feb 2023 09:33:50 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 61F172404EC for ; Tue, 7 Feb 2023 09:33:50 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 4A0491601B2; Tue, 7 Feb 2023 09:33:50 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <5919fecc-bb8e-43ae-8cf2-ad63d0a95ad4@gyani.pro> References: <20230204100121.6815-1-ffmpeg@gyani.pro> <167575737404.10789.1016094525223863600@lain.khirnov.net> <5919fecc-bb8e-43ae-8cf2-ad63d0a95ad4@gyani.pro> Mail-Followup-To: FFmpeg development discussions and patches Date: Tue, 07 Feb 2023 09:33:50 +0100 Message-ID: <167575883028.1179.2962715857403119894@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] ffmpeg_mux: terminate stream thread queue only on sq_send EOF 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: 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: Quoting Gyan Doshi (2023-02-07 09:18:22) > > > On 2023-02-07 01:39 pm, Anton Khirnov wrote: > > Quoting Gyan Doshi (2023-02-04 11:01:21) > >> Prior to 2d924b3a630, ffmpeg would exit if any packet write failed. > >> After the switch to threaded mode for muxing, ffmpeg only closes that > >> OutputStream instead of closng the file. This happens because EOF > >> returned by write_packet isn't distinguished from EOF returned by sq_send, > >> both relayed via sync_queue_process. > >> > >> This breaks the abort behaviour when there are multiple streams in an output, > >> and can leave the ffmpeg process running beyond the intended point of abortion. > >> > >> Fixed by marking the OutputStream as finished upon sq_send EOF and letting > >> write_packet EOF lead to muxer termination. > > What is the situation you're handling exactly? > > av_interleaved_write_frame() returns EOF? > > Yes. How does that happen? Doesn't seem to me that muxers should do this. Otherwise, I'm not a big fan of your patch since it adds yet more overloading to ost->finished, which I'd like to remove actually. Not to mention you manipulate it from the muxer thread, which is a race. IMO this should be done without any context variables. -- Anton Khirnov _______________________________________________ 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".