diff mbox series

[FFmpeg-devel] fftools/ffmpeg: reset pointer, which could be reused by Android and iOS

Message ID tencent_2C06F0F76CBCBCA06571A1AF6CF398284607@qq.com
State New
Headers show
Series [FFmpeg-devel] fftools/ffmpeg: reset pointer, which could be reused by Android and iOS | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

徐福隆 March 3, 2023, 6:51 a.m. UTC
---
 fftools/ffmpeg.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Zhao Zhili March 3, 2023, 9:23 a.m. UTC | #1
> On Mar 3, 2023, at 14:51, xufuji456 <839789740@qq.com> wrote:
> 
> ---
> fftools/ffmpeg.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 743bc0c6b6..0ce9531235 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -569,6 +569,13 @@ static void ffmpeg_cleanup(int ret)
>     av_freep(&input_files);
>     av_freep(&output_files);
> 
> +    nb_input_files    = 0;
> +    nb_output_files   = 0;
> +    nb_filtergraphs   = 0;
> +    input_files       = NULL;
> +    output_files      = NULL;
> +    filtergraphs      = NULL;
> +

Until we decided to make ffmpeg cmd works as a library,
it doesn’t matter. I’m interested on the idea to make fftools
work like a library. But it depends on the community.

https://patchwork.ffmpeg.org/project/ffmpeg/patch/tencent_929F62AB2F4E5E70082DE99AE040769A1008@qq.com/

>     uninit_opts();
> 
>     avformat_network_deinit();
> -- 
> 2.32.0 (Apple Git-132)
> 
> _______________________________________________
> 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".
Nicolas George March 3, 2023, 9:31 a.m. UTC | #2
"zhilizhao(赵志立)" (12023-03-03):
> >     av_freep(&input_files);
> >     av_freep(&output_files);
> > +    input_files       = NULL;
> > +    output_files      = NULL;
> Until we decided to make ffmpeg cmd works as a library,
> it doesn’t matter.

It is worse than that: the patch completely ignores the semantic of
av_freep().

Useless patch with no explanations at all in the mail => just ignore the
mail.

>		      I’m interested on the idea to make fftools
> work like a library. But it depends on the community.

That would be more or less what an extended libavfilter with movie
source and sink would be.

Regards,
徐福隆 March 3, 2023, 10:24 a.m. UTC | #3
Thank you for your reminding, George.
I really ignore av_freep() above.
Please ignore this patch.


// xufuji456


------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "ffmpeg-devel"                                                                                    <george@nsup.org&gt;;
发送时间:&nbsp;2023年3月3日(星期五) 下午5:31
收件人:&nbsp;"FFmpeg development discussions and patches"<ffmpeg-devel@ffmpeg.org&gt;;
抄送:&nbsp;"徐福隆"<839789740@qq.com&gt;;
主题:&nbsp;Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: reset pointer, which could be reused by Android and iOS



"zhilizhao(赵志立)" (12023-03-03):
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; av_freep(&amp;input_files);
&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; av_freep(&amp;output_files);
&gt; &gt; +&nbsp;&nbsp;&nbsp; input_files&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = NULL;
&gt; &gt; +&nbsp;&nbsp;&nbsp; output_files&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = NULL;
&gt; Until we decided to make ffmpeg cmd works as a library,
&gt; it doesn’t matter.

It is worse than that: the patch completely ignores the semantic of
av_freep().

Useless patch with no explanations at all in the mail =&gt; just ignore the
mail.

&gt;		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I’m interested on the idea to make fftools
&gt; work like a library. But it depends on the community.

That would be more or less what an extended libavfilter with movie
source and sink would be.

Regards,

-- 
&nbsp; Nicolas George
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 743bc0c6b6..0ce9531235 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -569,6 +569,13 @@  static void ffmpeg_cleanup(int ret)
     av_freep(&input_files);
     av_freep(&output_files);
 
+    nb_input_files    = 0;
+    nb_output_files   = 0;
+    nb_filtergraphs   = 0;
+    input_files       = NULL;
+    output_files      = NULL;
+    filtergraphs      = NULL;
+
     uninit_opts();
 
     avformat_network_deinit();