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 68E784507E for ; Fri, 3 Feb 2023 08:33:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 00E6768BC9A; Fri, 3 Feb 2023 10:32:56 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C82E468A9F0 for ; Fri, 3 Feb 2023 10:32:50 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 73100E8644 for ; Fri, 3 Feb 2023 09:32:49 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TpxNfamwbMKk for ; Fri, 3 Feb 2023 09:32:47 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 6D59EE84A1 for ; Fri, 3 Feb 2023 09:32:47 +0100 (CET) Date: Fri, 3 Feb 2023 09:32:47 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <4039d916-a926-de54-7346-ea20c40c6043@gyani.pro> Message-ID: References: <20230202180642.3479-1-ffmpeg@gyani.pro> <4039d916-a926-de54-7346-ea20c40c6043@gyani.pro> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/tee: signal EOF if no more output is to be published. 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 3 Feb 2023, Gyan Doshi wrote: > > > On 2023-02-03 04:17 am, Marton Balint wrote: >> >> >> On Thu, 2 Feb 2023, Gyan Doshi wrote: >> >>> Prior to 2d924b3a630, ffmpeg.c would exit if any packet write failed. >>> tee's >>> write_packet seemingly relied on that to enforce its abort failure >>> policy. >>>> From 2d924b3a630, ffmpeg only closes that OutputStream and keeps on >>> sending packets of other streams. >> >> Hmm, are you sure? I glanced at the code and it seems to me that any >> failure of av_interleaved_write_frame() will cause the muxing thread to >> exit. So I don't quite see how other streams can receive packets. > > Steps to reproduce: > > 1) ffmpeg -readrate 1 -stream_loop -1 -i INPUT -map 0:v -map 0:a -c copy -f > tee "[f=flv:onfail=abort]rtmp://url/playpath|[f=null:onfail=ignore]stub" > > 2) Kill the rtmp endpoint at the server side. The tee muxer logs that it's > aborting, however, ffmpeg keeps running. Contrast with 5.1 or earlier, which > exit. > > av_iwf returns EOF which just results in a call to tq_receive_finish() for > that ost without breaking muxer_thread's loop. Any av_interleaved_write_frame() negative return value is an error, ffmpeg should abort. It seems that there is a clash of error codes in sync_queue_process which returns AVERROR_EOF to signal sq_send EOF return, but that clashes with the AVERROR_EOF of av_interleaved_write_frame(), so the error condition is lost. Regards, Marton _______________________________________________ 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".