From patchwork Mon Mar 4 15:42:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 46781 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d808:b0:19e:cdac:8cce with SMTP id iv8csp72318pzb; Mon, 4 Mar 2024 07:43:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9v+15of9dnuHXLe/3EfJlxf+jU61axBQqBqIdUzLCm+RucqpWICGrO/VCH6fi4Uknq/jCpx83qFfq+EaZBFs8bnfbk6fjnc3BwA== X-Google-Smtp-Source: AGHT+IEBjKHVorNDj2LHVkJz7Rx0vDtgx+7opAOr7Qvkiz5KAYH1oFwYQHjHRgs28Zi31nz8CWuG X-Received: by 2002:a05:6512:39c5:b0:513:258f:5ef3 with SMTP id k5-20020a05651239c500b00513258f5ef3mr8319279lfu.1.1709567036897; Mon, 04 Mar 2024 07:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709567036; cv=none; d=google.com; s=arc-20160816; b=RNY323O25aXl3vg3b+53f6eo+zVVd9blaEmbYr0s1Kg4jEo26nCKEQye1INWnZeXxY gyqgcMocpxWH9TkmgkAx2pahSQEhmxZ42PrKp5QiVTs1rvOPfAJPIhrrUQ0g9C4ZSAAd L6bYVfAdRAeHlqp7M9+NjzATADqQzHsLIoeJmdm3pywSuE36SfIQVD2g0uz9lOFGLoiu zZWXa0Cefum+Na0Z8Cv3uHa0bNoMVyb73V9ZBBG9rmQ72wRtwWNTyWzpNNUUS9QE12eo /WZfuoNGv8OvhbjoxFxLHaGpqQYwDD39Y52t16pa2PI1W6oNVI6X8FmNwjvZh+oNTnXn zFjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=x1HhCQ9GBlGn73fzfllnKw4J2GjNFDN6pba+jc+dxik=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=uzmX8Jw4onP4b4/nuO9QmBjqlJ7Oz6aVeUgsumk8XX6gnbgRbj59N+yIXDFUN/6GxC Gjgrb9OmQfdz/ArZHfQAfVuX+aE7OSJZsCW243Bk3yqjAM+XGiTovglksVKI3IHjZFDN 7klx6Fwx18w3bdbnzQh3EQpFq3BU71PTNFV0jK/6Y+CzY4khpCOZCqWIiN4QGkwt3bTW OjWf4Cb194pbiBNzdL6WB9k0DhlK+GSRROXPEo09d+AbvvpC5H6N2O8Qdqr+PL0douGJ eN2F6bOngUmzDOC20mcFvjYewzxcQpEx2NyvSirgi42VAiY8h/88zofdwR7INtqzEVFw 183w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=h8yhDw+i; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a4-20020a05640213c400b005676553bc54si501391edx.625.2024.03.04.07.43.56; Mon, 04 Mar 2024 07:43:56 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=h8yhDw+i; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B359768D46C; Mon, 4 Mar 2024 17:43:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6695268D464 for ; Mon, 4 Mar 2024 17:43:37 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=h8yhDw+i; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 097324D3D for ; Mon, 4 Mar 2024 16:43:37 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id uyzRHYg3VP2g for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1709567014; bh=pOABSOJWCJBl28QGs+XsPlEJZAF4HpvQyTZMGAAjjv8=; h=From:To:Subject:Date:From; b=h8yhDw+iQ0lplTRFH+/jsIhmXjjCp5lVvvjINpcvzStJ+6k+gTHnvxYKE0g1O6BJ7 9JHpW35nblXjzySzUZIQpA65v5nJk7Dnt28z+TiY+P5tGu2MDxH+cakuzx95n7n6ky oSxfJRGWdy6lWoe16+MU6bfla8mWYr8TdHJ74UZ0qLRLLlyWHrHzgibUK4Hm6eyIsQ MFNVAXZs74TEIKeoY26eJ2hXSRqF3VpZcgrA41hibRf7QW3ObUTYVo7rltq2IqoJ0E rITJbXtjxJAMiynxtoJL/psSqnm73lJV5JeCj3gJVTah8WmSVgTAvZ6HL9blLw75ib bCY/q4j9cedUg== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id B1F3610B9 for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 867BD3A0357 for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Mar 2024 16:42:04 +0100 Message-ID: <20240304154205.27758-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavfi: deprecate avfilter_link_free() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: NYK2VROyOywQ It never makes sense for this function to be called by users. --- libavfilter/avfilter.c | 11 +++++++++-- libavfilter/avfilter.h | 5 ++++- libavfilter/version_major.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index daa7c3672a..cb2128252b 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -192,7 +192,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, return 0; } -void avfilter_link_free(AVFilterLink **link) +static void link_free(AVFilterLink **link) { FilterLinkInternal *li; @@ -207,6 +207,13 @@ void avfilter_link_free(AVFilterLink **link) av_freep(link); } +#if FF_API_LINK_PUBLIC +void avfilter_link_free(AVFilterLink **link) +{ + link_free(link); +} +#endif + static void update_link_current_pts(FilterLinkInternal *li, int64_t pts) { AVFilterLink *const link = &li->l; @@ -763,7 +770,7 @@ static void free_link(AVFilterLink *link) ff_formats_unref(&link->outcfg.samplerates); ff_channel_layouts_unref(&link->incfg.channel_layouts); ff_channel_layouts_unref(&link->outcfg.channel_layouts); - avfilter_link_free(&link); + link_free(&link); } void avfilter_free(AVFilterContext *filter) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 5eff35b836..0949870de4 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -692,10 +692,13 @@ struct AVFilterLink { int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad); +#if FF_API_LINK_PUBLIC /** - * Free the link in *link, and set its pointer to NULL. + * @deprecated this function should never be called by users */ +attribute_deprecated void avfilter_link_free(AVFilterLink **link); +#endif /** * Negotiate the media format, dimensions, etc of all inputs to a filter. diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h index 1decc4012e..97fcd57e90 100644 --- a/libavfilter/version_major.h +++ b/libavfilter/version_major.h @@ -36,5 +36,6 @@ */ #define FF_API_LIBPLACEBO_OPTS (LIBAVFILTER_VERSION_MAJOR < 10) +#define FF_API_LINK_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 11) #endif /* AVFILTER_VERSION_MAJOR_H */ From patchwork Mon Mar 4 15:42:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 46780 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d808:b0:19e:cdac:8cce with SMTP id iv8csp72201pzb; Mon, 4 Mar 2024 07:43:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU2yp7IVRoFOc3QffZDQht+I0YVRsQHcz8PjtNys1kxrV3uO4FHi7F5RMNbS9c1wvya2sguybcpUZVutLfNPYdX2kvO7vQVQAVbyA== X-Google-Smtp-Source: AGHT+IFNWy/24jGONabPK3xKxDKDV4rwxY1uQv0dsyX8WvEiYosUBVOC48q+tDMAKTNkOJ5jS1Vy X-Received: by 2002:a50:ed02:0:b0:566:c2f8:a47d with SMTP id j2-20020a50ed02000000b00566c2f8a47dmr6326689eds.1.1709567026538; Mon, 04 Mar 2024 07:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709567026; cv=none; d=google.com; s=arc-20160816; b=EyNb4O1jhSSf97xLfEZbpxUkGTweHFoRhJ+G6qDPqYxSdGfT6yUneKL56B8cc8UgNR zl9bvuL7NR2u0HE4Zo/zqf1yxZoh0aCTL9dy5ag0O778xg3YdFcpz+7zLuxGEcilWbbm WI17Rv/wpTVxoNMrfrXIxC+TjEgY6yPTN2sSWxpyeypSOuRFoTgbW01Czgeq0zs5aAEq ywmDcO+cTFeQMrtGgiV0Dxf6ZSwinmb7JznSzUuZO2eZDq0RLEQE2XNUVkgeM+spV9bw 3yZSvaaWnKXmCLIoOYlNfuO9SayWhyU+LKYIY89UvgrN/maPtnOUpegc0xn+QohouUKH u0cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=be32xo7edA/EGp4FfeMjaFnv3gl64QWR23HZu2/27/8=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=mYd3YfmFDbzi8oxofzQWTibV6NBxFMiOpKS12mKD1sFnbKv76PAh+t5qt1btyOQVZN nDg5o61/9F8N2SW5mFFKH9gkvgEOyhlUG5/MZ0NeWi3t9IGrmJG/0iAIuSZhSJhc48Re sMhXRXWdIITRmlgmBj7K3jrGl9MqE2AlLgOzEWdX5aj8gMzlPkOdguzrfvvmNtGeZGDY fd+nJBTexGAk3ciTkIR+qyoppI8dX3kMq1LvlgKU/a25/uBCwfdbaNl1XzzwaTzakJt0 Du++tJGGQAaNQHdjOf53g7XSTIY8aj72NqVNxlxe7EtmFcB5Sgm+F4ZyeyVOe6EHjON3 s1MA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=PhtQyBrW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v18-20020a056402349200b00566c239f705si3389054edc.209.2024.03.04.07.43.46; Mon, 04 Mar 2024 07:43:46 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=PhtQyBrW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9F97B68D3E6; Mon, 4 Mar 2024 17:43:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2498068D3E6 for ; Mon, 4 Mar 2024 17:43:36 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=PhtQyBrW; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 878504D49 for ; Mon, 4 Mar 2024 16:43:35 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id La3I6MnEeKzs for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1709567014; bh=63fGm5J9fPvDwUhnGFaYJzvqxWTXxx3VXDCGWYw18y0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PhtQyBrW1DGLklTYji6rlXk1Qoze3fmz8l602r7Lxn/j/VUFHWpzLJ132b74xX0qi EK4K2/xvtHyYba953HfN50HtB7RIFFzaSYzeV8pMAOrVASAUbE5qIYddfSLLSI2aV0 L3lNxnY1m1Bg6kJoQSHZMhk4DAc/sKEeji8XOhxIXgnqT9x0st+6VE6FsbCNWjBA2y xNC7UZ+pNCl5ODxUuES7pQjp7mxHoICnl+SPYcAye6lOv7iVQJFOf/liyx6dklvg8x C1dzGaYbZVID3mYuzhHEIsq/B3mp5sksSJ21exOJTebBuaf30yDOGrsAc3HxhWdT8B R/2TZJht6AEfQ== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id B5C8C4D3D for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 966ED3A0582 for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Mar 2024 16:42:05 +0100 Message-ID: <20240304154205.27758-2-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304154205.27758-1-anton@khirnov.net> References: <20240304154205.27758-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavfi: deprecate avfilter_config_links() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: /ec6tXrd/Kt+ It never makes sense for this function to be called by users. --- libavfilter/avfilter.c | 8 ++++++-- libavfilter/avfilter.h | 8 +++----- libavfilter/avfiltergraph.c | 2 +- libavfilter/f_streamselect.c | 2 +- libavfilter/internal.h | 8 ++++++++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index cb2128252b..859a6f9d16 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -212,6 +212,10 @@ void avfilter_link_free(AVFilterLink **link) { link_free(link); } +int avfilter_config_links(AVFilterContext *filter) +{ + return ff_filter_config_links(EINVAL); +} #endif static void update_link_current_pts(FilterLinkInternal *li, int64_t pts) @@ -322,7 +326,7 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, return 0; } -int avfilter_config_links(AVFilterContext *filter) +int ff_filter_config_links(AVFilterContext *filter) { int (*config_link)(AVFilterLink *); unsigned i; @@ -353,7 +357,7 @@ int avfilter_config_links(AVFilterContext *filter) case AVLINK_UNINIT: li->init_state = AVLINK_STARTINIT; - if ((ret = avfilter_config_links(link->src)) < 0) + if ((ret = ff_filter_config_links(link->src)) < 0) return ret; if (!(config_link = link->srcpad->config_props)) { diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 0949870de4..08f185c4d2 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -698,15 +698,13 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, */ attribute_deprecated void avfilter_link_free(AVFilterLink **link); -#endif /** - * Negotiate the media format, dimensions, etc of all inputs to a filter. - * - * @param filter the filter to negotiate the properties for its inputs - * @return zero on successful negotiation + * @deprecated this function should never be called by users */ +attribute_deprecated int avfilter_config_links(AVFilterContext *filter); +#endif #define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically #define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 674711ec35..ac491ee89b 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -251,7 +251,7 @@ static int graph_config_links(AVFilterGraph *graph, void *log_ctx) filt = graph->filters[i]; if (!filt->nb_outputs) { - if ((ret = avfilter_config_links(filt))) + if ((ret = ff_filter_config_links(filt))) return ret; } } diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c index 1328a842f9..fb96a46862 100644 --- a/libavfilter/f_streamselect.c +++ b/libavfilter/f_streamselect.c @@ -250,7 +250,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar if (ret < 0) return ret; - return avfilter_config_links(ctx); + return ff_filter_config_links(ctx); } return AVERROR(ENOSYS); } diff --git a/libavfilter/internal.h b/libavfilter/internal.h index 0e3f68d1f4..000f94cb16 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -246,6 +246,14 @@ int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg, */ void ff_avfilter_link_set_in_status(AVFilterLink *link, int status, int64_t pts); +/** + * Negotiate the media format, dimensions, etc of all inputs to a filter. + * + * @param filter the filter to negotiate the properties for its inputs + * @return zero on successful negotiation + */ +int ff_filter_config_links(AVFilterContext *filter); + #define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d)) #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))