From patchwork Thu Nov 14 14:06:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 16261 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A88A3448A9B for ; Thu, 14 Nov 2019 16:06:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7706268AB17; Thu, 14 Nov 2019 16:06:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E33D568A3A3 for ; Thu, 14 Nov 2019 16:06:44 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id q70so5803080wme.1 for ; Thu, 14 Nov 2019 06:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gvEBkSa1liVjeEhyvNm2EcaBJM4imojCBEdLQZXu6Kg=; b=ar889okUEhlss4kKNg1whHypOl+d02Sg8vwyFluwSgueVJn3E+zALUHj7sx5fOIJfu kjzVPa9wHFSQOKmAZul6A4T3q8FcfjL/6ysR02H6CLtltWjrSGUtXfMSkVaEDWAne26a 13lPFOalj5XRldrW4zrfL9CjybB0GtK2BbJwCjantP3Ec5FXjbNQYUZoeACc0sdzMVQU T6kzKLC9SoXZ6dG8hSvfxFPT4gkJnVd5Op8eeVzasdcfBJTwcFu0eYRDXBdA/DOR9IRw /ZS7fyzRlURhz5GxFxMPHwiDV9I9UdAP8gG+f1Vo14AZExJoY2YIT7vSTAe9OPdrOIGm +2sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gvEBkSa1liVjeEhyvNm2EcaBJM4imojCBEdLQZXu6Kg=; b=GfGDUlh+HT1Q+KRK2KSMXZauUdeAunb0PbdhLArPu2YyQqrAklgirs5EnAiQOlQK9+ RjmA3YyecG9aKPrv2jjz0zTEARp92ByIjJ5DjMqY2my9hmZ5wrv9DH/nCEnqz/lu4PfT Z27+KcIQ/kivzpigGgB73XuCl+fYVpvIRqUNeJjz+fCEzE1qGbX3u7S8SbXLn7YQKALK x+NjbpzmpCAs0sejPOL1nrPLnmozDNcNmJrSEFJ8i55nqw2TXqa56r7SwNMMJ7ajnR44 LKr2KbS/ufgDylfr6Vs9qpPVl//k9I98LvrVkh7xdN9/z33MqLUvFWBNBxaaEhQ8lOV+ n3ew== X-Gm-Message-State: APjAAAXK+jAYzJkvmT0VogUyncZDw0dWJ8D2cmvK83Im/hw1FwHMfRKU wdrYqsEZ5mQcNZ7UyodSe0RHDJJo X-Google-Smtp-Source: APXvYqyfG4wFW4ky67A8H82saKp0AlF8UNx8ct9sdPysMM7o+f3IaqZb9IKkxI1QDm8X6jC0L2Kq3g== X-Received: by 2002:a1c:2bc2:: with SMTP id r185mr7801233wmr.91.1573740404223; Thu, 14 Nov 2019 06:06:44 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc08937.dynamic.kabel-deutschland.de. [188.192.137.55]) by smtp.gmail.com with ESMTPSA id s9sm5924270wmj.22.2019.11.14.06.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 06:06:43 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 14 Nov 2019 15:06:26 +0100 Message-Id: <20191114140627.21943-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/avcodec: Adapt the doc of av_bsf_send_packet X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" to match its actual implementation. Explicitly allowing empty packets to signal flushing helps getting rid of special cases. It does not hinder the ability to send i.e. timing-only packets, because one can send packets with zero size and pkt->data set. Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index bcb931f0dd..93ab04104a 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -5946,11 +5946,13 @@ int av_bsf_init(AVBSFContext *ctx); * * @param pkt the packet to filter. The bitstream filter will take ownership of * the packet and reset the contents of pkt. pkt is not touched if an error occurs. - * This parameter may be NULL, which signals the end of the stream (i.e. no more - * packets will be sent). That will cause the filter to output any packets it - * may have buffered internally. + * If pkt is empty (i.e. NULL or pkt->data and pkt->side_data_elems vanish), + * it signals the end of the stream (i.e. no more non-empty packets will be sent; + * sending more empty packets does nothing and will cause the filter to output + * any packets it may have buffered internally. * - * @return 0 on success, a negative AVERROR on error. + * @return 0 on success, a negative AVERROR on error. This function never fails + * if pkt is empty. */ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);