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 9C237422CE for ; Wed, 2 Mar 2022 12:53:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 845F968B2A5; Wed, 2 Mar 2022 14:53:53 +0200 (EET) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD22D68A987 for ; Wed, 2 Mar 2022 14:53:46 +0200 (EET) Received: by mail-lf1-f46.google.com with SMTP id j7so2633143lfu.6 for ; Wed, 02 Mar 2022 04:53:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=a19D19YAPBYYiny0+3XwUTPEEOp0FXtDkckX6daZSQs=; b=B5LaaWiXOq4lUzr/uKldSFfZ5xrNNAJRMq4ZVnZ33YZbe3pCMxFdNbCeLR/2YDSz2i GUXFHEoX032mVWFzfHA1abLJ/OuLQYm2648v7rWRAKwa6FQ+aAKEjI0Oh6/xCa0IdeZ9 YGSYDmwojBgUZF2s7UKw00dkVVpkUoYcX40XJiEfug/McTBczmg2kXAVORuu+1+M/dfB Y3rjbXeIWPgXnRaqEvUz0CENb8qKkwtPpya/7kNNnIEQw0xzZYQo3ZhcfbTisA+9Q9ig x6p0vsPtxPFkpMRIQAbzzHfplrdtBilA0c2G9JOAJ6P+cvjZOhUjN63laHFndh1e6opH NgNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=a19D19YAPBYYiny0+3XwUTPEEOp0FXtDkckX6daZSQs=; b=sGwVP6pSnn/v1rRSOD/bQG2hQ0BHGf5KmJKIlvkyHwtdpLWj+L28nc3lmALMgZw9Cc XSbZpywCUH0MUAUgjaenJJ25dPJNLdaZj4XzeTOwgHrjFzECpMeDDd9eoa7wsOZ6zXjx Pwb+4TNWwZ9ux93r1w4d8p4dCQCYGRWoq/NM+mcoD/E7WbYn1Yt9BIrj+Z/ePRbEty9v zKZfYOoLE8DMrPchRDQ+qW7vF5xiyBsfhmViDs4pulDLklvgwRcoFl79jh8AfPVNTBeV gqS3yCxa8gRIY54GbjhuE83BEqOjdY0kAVhvprEUA4y1F67kVI6Gf9CsTbLn3hJnE6fv K7Pw== X-Gm-Message-State: AOAM532DqHFp5B5hVDQqzaQJ/hIY934oJ4+mDJuV/e+GRM/Pgm1fqWPh g0IHj0d8upJg1/qKNZ+k9o/QBnu1EYybrMLmHx/ZOSAzrX8= X-Google-Smtp-Source: ABdhPJy1TWzQppNOqmMe1k+mTLuhCnBbXB00hCeCPadwK7Xz16zw19b0+inpgH0wmeL2fHHW5yXbYYjNuZhUgfG9Ppo= X-Received: by 2002:a05:6512:2290:b0:445:bd9e:6501 with SMTP id f16-20020a056512229000b00445bd9e6501mr1346238lfu.282.1646225626196; Wed, 02 Mar 2022 04:53:46 -0800 (PST) MIME-Version: 1.0 From: Andreas Unterweger Date: Wed, 2 Mar 2022 13:53:36 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH 1/2] doc/examples/transcode_aac: Don't ignore last encoded frame 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: > On 02.03.2022 13:27 Paul B Mahol wrote: > > > On Wed, Mar 2, 2022 at 1:18 PM Andreas Unterweger > wrote: > > > > On 02.03.2022 12:55 Paul B Mahol wrote: > > > > > do { > > > > > - data_written = 0; > > > > > > > > > > why this is removed ? > > > > > > > > > > > if (encode_audio_frame(NULL, output_format_context, > > > > > output_codec_context, > > > > &data_written)) > > > > > goto cleanup; > > > > It is removed because the function encode_audio_frame (next line) > > already sets data_written as an output value (this is also in the > > documentation of this function). It is thus not needed to initialize > > data_written a second time outside of the function. > > > > Note that it does not set it immediately at start, but later, and upon > error it is left untouched/uninitialized. > In case of an error, an error code is returned from the function and the output value has no meaning. In the calling function, the cleanup is invoked and data_written is not used (as it would make no sense to use it in case of an error, anyway). This behavior is the same as with the decode_audio_frame function. The only difference is that the finished = 0 initialization in line 830 is needed to avoid to forcefully flush the decoder in lines 865ff on an empty input file. _______________________________________________ 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".