[FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-27 Thread Steven Liu
Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 23 ---
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 043438368e..1105380806 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2486,7 +2486,9 @@ static void hls_free_variant_streams(struct HLSContext 
*hls)
 if (vtt_oc) {
 av_freep(&vs->vtt_basename);
 av_freep(&vs->vtt_m3u8_name);
+avformat_free_context(vs->vtt_avf);
 }
+avformat_free_context(vs->avf);
 
 hls_free_segments(vs->segments);
 hls_free_segments(vs->old_segments);
@@ -2956,31 +2958,14 @@ static int hls_init(AVFormatContext *s)
 
 fail:
 if (ret < 0) {
-av_freep(&hls->key_basename);
-for (i = 0; i < hls->nb_varstreams && hls->var_streams; i++) {
-vs = &hls->var_streams[i];
-av_freep(&vs->basename);
-av_freep(&vs->vtt_basename);
-av_freep(&vs->fmp4_init_filename);
-av_freep(&vs->m3u8_name);
-av_freep(&vs->vtt_m3u8_name);
-av_freep(&vs->streams);
-av_freep(&vs->language);
-av_freep(&vs->agroup);
-av_freep(&vs->ccgroup);
-av_freep(&vs->baseurl);
-av_freep(&vs->varname);
-if (vs->avf)
-avformat_free_context(vs->avf);
-if (vs->vtt_avf)
-avformat_free_context(vs->vtt_avf);
-}
+hls_free_variant_streams(hls);
 for (i = 0; i < hls->nb_ccstreams; i++) {
 ClosedCaptionsStream *ccs = &hls->cc_streams[i];
 av_freep(&ccs->ccgroup);
 av_freep(&ccs->instreamid);
 av_freep(&ccs->language);
 }
+av_freep(&hls->key_basename);
 av_freep(&hls->var_streams);
 av_freep(&hls->cc_streams);
 av_freep(&hls->master_m3u8_url);
-- 
2.15.1



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-27 Thread Michael Niedermayer
On Wed, Nov 27, 2019 at 05:43:09PM +0800, Steven Liu wrote:
> Signed-off-by: Steven Liu 
> ---
>  libavformat/hlsenc.c | 23 ---
>  1 file changed, 4 insertions(+), 19 deletions(-)

this breaks the code

./ffmpeg_g -i mm-short.mpg -i fate-suite/sub/MovText_capability_tester.mp4  -f 
hls  -c:a aac -hls_segment_filename /tmp/file-v.low.%d.ts -t 10 
/tmp/file-v.low.m3u8

...
==5612== Invalid read of size 8
==5612==at 0x800AC8: avformat_free_context (in ffmpeg/ffmpeg_g)
==5612==by 0x710A9B: hls_free_variant_streams.isra.12 (in ffmpeg/ffmpeg_g)
==5612==by 0x714EB3: hls_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x78341A: av_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x4D9E88: transcode (in ffmpeg/ffmpeg_g)
==5612==by 0x4B5D3C: main (in ffmpeg/ffmpeg_g)
==5612==  Address 0x464b0c50 is 16 bytes inside a block of size 1,504 free'd
==5612==at 0x4C2B5D9: free (vg_replace_malloc.c:446)
==5612==by 0x800D97: avformat_free_context (in ffmpeg/ffmpeg_g)
==5612==by 0x714AF9: hls_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x78341A: av_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x4D9E88: transcode (in ffmpeg/ffmpeg_g)
==5612==by 0x4B5D3C: main (in ffmpeg/ffmpeg_g)
==5612== 
==5612== Invalid read of size 8
==5612==at 0x119430E: av_opt_free (in ffmpeg/ffmpeg_g)
==5612==by 0x800AF6: avformat_free_context (in ffmpeg/ffmpeg_g)
==5612==by 0x710A9B: hls_free_variant_streams.isra.12 (in ffmpeg/ffmpeg_g)
==5612==by 0x714EB3: hls_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x78341A: av_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x4D9E88: transcode (in ffmpeg/ffmpeg_g)
==5612==by 0x4B5D3C: main (in ffmpeg/ffmpeg_g)
==5612==  Address 0x464b0c40 is 0 bytes inside a block of size 1,504 free'd
==5612==at 0x4C2B5D9: free (vg_replace_malloc.c:446)
==5612==by 0x800D97: avformat_free_context (in ffmpeg/ffmpeg_g)
==5612==by 0x714AF9: hls_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x78341A: av_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x4D9E88: transcode (in ffmpeg/ffmpeg_g)
==5612==by 0x4B5D3C: main (in ffmpeg/ffmpeg_g)
==5612== 
==5612== Invalid read of size 8
==5612==at 0x118EBA3: av_freep (in ffmpeg/ffmpeg_g)
==5612==by 0x119434E: av_opt_free (in ffmpeg/ffmpeg_g)
==5612==by 0x800AF6: avformat_free_context (in ffmpeg/ffmpeg_g)
==5612==by 0x710A9B: hls_free_variant_streams.isra.12 (in ffmpeg/ffmpeg_g)
==5612==by 0x714EB3: hls_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x78341A: av_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x4D9E88: transcode (in ffmpeg/ffmpeg_g)
==5612==by 0x4B5D3C: main (in ffmpeg/ffmpeg_g)
==5612==  Address 0x464b10b8 is 1,144 bytes inside a block of size 1,504 free'd
==5612==at 0x4C2B5D9: free (vg_replace_malloc.c:446)
==5612==by 0x800D97: avformat_free_context (in ffmpeg/ffmpeg_g)
==5612==by 0x714AF9: hls_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x78341A: av_write_trailer (in ffmpeg/ffmpeg_g)
==5612==by 0x4D9E88: transcode (in ffmpeg/ffmpeg_g)
==5612==by 0x4B5D3C: main (in ffmpeg/ffmpeg_g)

If you cannot reproduce, tell me and ill rerun this with full debug symbols 
(line numbers)

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-27 Thread Steven Liu


> 在 2019年11月28日,04:06,Michael Niedermayer  写道:
> 
> mm-short.mpg
Hi Michael,

Where should i download the file mm-short.mpg?

Thanks
Steven





___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-28 Thread Michael Niedermayer
On Thu, Nov 28, 2019 at 11:26:24AM +0800, Steven Liu wrote:
> 
> 
> > 在 2019年11月28日,04:06,Michael Niedermayer  写道:
> > 
> > mm-short.mpg
> Hi Michael,
> 
>   Where should i download the file mm-short.mpg?

you can make it yourself, it is just:

dd if=matrixbench_mpeg2.mpg of=mm-short.mpg count=4000

db7c44ab3d2b75d6e61fe61b1a595b31  mm-short.mpg

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-28 Thread Liu Steven


> 在 2019年11月29日,上午2:48,Michael Niedermayer  写道:
> 
> On Thu, Nov 28, 2019 at 11:26:24AM +0800, Steven Liu wrote:
>> 
>> 
>>> 在 2019年11月28日,04:06,Michael Niedermayer  写道:
>>> 
>>> mm-short.mpg
>> Hi Michael,
>> 
>>  Where should i download the file mm-short.mpg?
> 
> you can make it yourself, it is just:
> 
> dd if=matrixbench_mpeg2.mpg of=mm-short.mpg count=4000

StevenLiu:dash StevenLiu$ find fate-suite -name matrixbench_mpeg2.mpg
StevenLiu:dash StevenLiu$
There have no file named matrixbench_mpeg2.mpg, 
I ask for the mpg file for: i want to know what contents of the mpg file, just 
video stream? audio stream? or other stream? 


Whatever, i will resubmit a new version patch, try to fix this problem.

> 
> db7c44ab3d2b75d6e61fe61b1a595b31  mm-short.mpg
> 

Thanks
Steven



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-28 Thread Carl Eugen Hoyos
Am Fr., 29. Nov. 2019 um 00:43 Uhr schrieb Liu Steven :
>
>
>
> > 在 2019年11月29日,上午2:48,Michael Niedermayer  写道:
> >
> > On Thu, Nov 28, 2019 at 11:26:24AM +0800, Steven Liu wrote:
> >>
> >>
> >>> 在 2019年11月28日,04:06,Michael Niedermayer  写道:
> >>>
> >>> mm-short.mpg
> >> Hi Michael,
> >>
> >>  Where should i download the file mm-short.mpg?
> >
> > you can make it yourself, it is just:
> >
> > dd if=matrixbench_mpeg2.mpg of=mm-short.mpg count=4000
>
> StevenLiu:dash StevenLiu$ find fate-suite -name matrixbench_mpeg2.mpg

https://samples.ffmpeg.org/benchmark/testsuite1/

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-28 Thread Song, Ruiling
> -Original Message-
> From: ffmpeg-devel  On Behalf Of Liu
> Steven
> Sent: Friday, November 29, 2019 7:42 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Liu Steven 
> Subject: Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate
> code block
> 
> 
> 
> > 在 2019年11月29日,上午2:48,Michael Niedermayer
>  写道:
> >
> > On Thu, Nov 28, 2019 at 11:26:24AM +0800, Steven Liu wrote:
> >>
> >>
> >>> 在 2019年11月28日,04:06,Michael Niedermayer
>  写道:
> >>>
> >>> mm-short.mpg
> >> Hi Michael,
> >>
> >>Where should i download the file mm-short.mpg?
> >
> > you can make it yourself, it is just:
> >
> > dd if=matrixbench_mpeg2.mpg of=mm-short.mpg count=4000
> 
> StevenLiu:dash StevenLiu$ find fate-suite -name matrixbench_mpeg2.mpg
> StevenLiu:dash StevenLiu$
> There have no file named matrixbench_mpeg2.mpg,
> I ask for the mpg file for: i want to know what contents of the mpg file, just
> video stream? audio stream? or other stream?
https://samples.ffmpeg.org/benchmark/testsuite1/

> 
> 
> Whatever, i will resubmit a new version patch, try to fix this problem.
> 
> >
> > db7c44ab3d2b75d6e61fe61b1a595b31  mm-short.mpg
> >
> 
> Thanks
> Steven
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove duplicate code block

2019-11-28 Thread Steven Liu


> 在 2019年11月29日,07:55,Carl Eugen Hoyos  写道:
> 
> Am Fr., 29. Nov. 2019 um 00:43 Uhr schrieb Liu Steven :
>> 
>> 
>> 
>>> 在 2019年11月29日,上午2:48,Michael Niedermayer  写道:
>>> 
>>> On Thu, Nov 28, 2019 at 11:26:24AM +0800, Steven Liu wrote:
 
 
> 在 2019年11月28日,04:06,Michael Niedermayer  写道:
> 
> mm-short.mpg
 Hi Michael,
 
 Where should i download the file mm-short.mpg?
>>> 
>>> you can make it yourself, it is just:
>>> 
>>> dd if=matrixbench_mpeg2.mpg of=mm-short.mpg count=4000
>> 
>> StevenLiu:dash StevenLiu$ find fate-suite -name matrixbench_mpeg2.mpg
> 
> https://samples.ffmpeg.org/benchmark/testsuite1/

Thanks Carl :D
> 
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Thanks
Steven





___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".