* [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing @ 2023-05-10 21:58 Michael Niedermayer 2023-05-10 21:58 ` [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 Michael Niedermayer 2023-09-16 17:35 ` [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing Michael Niedermayer 0 siblings, 2 replies; 5+ messages in thread From: Michael Niedermayer @ 2023-05-10 21:58 UTC (permalink / raw) To: FFmpeg development discussions and patches Issue found by: Сергей Колесников Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/format.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/format.c b/libavformat/format.c index 76f25ab5a6..52b814e67d 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -231,6 +231,7 @@ int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, int ret = 0, probe_size, buf_offset = 0; int score = 0; int ret2; + int eof = 0; if (!max_probe_size) max_probe_size = PROBE_BUF_MAX; @@ -254,7 +255,7 @@ int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, } } - for (probe_size = PROBE_BUF_MIN; probe_size <= max_probe_size && !*fmt; + for (probe_size = PROBE_BUF_MIN; probe_size <= max_probe_size && !*fmt && !eof; probe_size = FFMIN(probe_size << 1, FFMAX(max_probe_size, probe_size + 1))) { score = probe_size < max_probe_size ? AVPROBE_SCORE_RETRY : 0; @@ -270,6 +271,7 @@ int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, score = 0; ret = 0; /* error was end of file, nothing read */ + eof = 1; } buf_offset += ret; if (buf_offset < offset) -- 2.17.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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 2023-05-10 21:58 [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing Michael Niedermayer @ 2023-05-10 21:58 ` Michael Niedermayer 2023-05-11 17:36 ` Paul B Mahol 2023-09-16 17:35 ` [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing Michael Niedermayer 1 sibling, 1 reply; 5+ messages in thread From: Michael Niedermayer @ 2023-05-10 21:58 UTC (permalink / raw) To: FFmpeg development discussions and patches The 1000 did result in a apparent never ending reload loop Issue found by: Сергей Колесников Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/hls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 11e345b280..77bce8fc0d 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -2556,7 +2556,7 @@ static const AVOption hls_options[] = { {.str = "3gp,aac,avi,ac3,eac3,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,mpeg,mpegts,ogg,ogv,oga,ts,vob,wav"}, INT_MIN, INT_MAX, FLAGS}, {"max_reload", "Maximum number of times a insufficient list is attempted to be reloaded", - OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, FLAGS}, + OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 100}, 0, INT_MAX, FLAGS}, {"m3u8_hold_counters", "The maximum number of times to load m3u8 when it refreshes without new segments", OFFSET(m3u8_hold_counters), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, FLAGS}, {"http_persistent", "Use persistent HTTP connections", -- 2.17.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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 2023-05-10 21:58 ` [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 Michael Niedermayer @ 2023-05-11 17:36 ` Paul B Mahol 2023-05-11 22:45 ` Michael Niedermayer 0 siblings, 1 reply; 5+ messages in thread From: Paul B Mahol @ 2023-05-11 17:36 UTC (permalink / raw) To: FFmpeg development discussions and patches On Wed, May 10, 2023 at 11:58 PM Michael Niedermayer <michael@niedermayer.cc> wrote: > The 1000 did result in a apparent never ending reload loop > > How so? Somewhere overflow happens causing infinity? > Issue found by: Сергей Колесников > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/hls.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/hls.c b/libavformat/hls.c > index 11e345b280..77bce8fc0d 100644 > --- a/libavformat/hls.c > +++ b/libavformat/hls.c > @@ -2556,7 +2556,7 @@ static const AVOption hls_options[] = { > {.str = > "3gp,aac,avi,ac3,eac3,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,mpeg,mpegts,ogg,ogv,oga,ts,vob,wav"}, > INT_MIN, INT_MAX, FLAGS}, > {"max_reload", "Maximum number of times a insufficient list is > attempted to be reloaded", > - OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, > FLAGS}, > + OFFSET(max_reload), AV_OPT_TYPE_INT, {.i64 = 100}, 0, INT_MAX, > FLAGS}, > {"m3u8_hold_counters", "The maximum number of times to load m3u8 when > it refreshes without new segments", > OFFSET(m3u8_hold_counters), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, > INT_MAX, FLAGS}, > {"http_persistent", "Use persistent HTTP connections", > -- > 2.17.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-request@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-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 2023-05-11 17:36 ` Paul B Mahol @ 2023-05-11 22:45 ` Michael Niedermayer 0 siblings, 0 replies; 5+ messages in thread From: Michael Niedermayer @ 2023-05-11 22:45 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 1221 bytes --] On Thu, May 11, 2023 at 07:36:04PM +0200, Paul B Mahol wrote: > On Wed, May 10, 2023 at 11:58 PM Michael Niedermayer <michael@niedermayer.cc> > wrote: > > > The 1000 did result in a apparent never ending reload loop > > > > > How so? Somewhere overflow happens causing infinity? no, it was lack of patience each reload before the patches takes 50seconds with the testcase thats with one url which returns 55 bytes i didnt benchmark it but i would expect 1000 reloads to take about 14 hours after the bugfix it should be a bit less than 2 hours and with just 100 reloads its maybe 10minutes Why is the reload taking so long ? The RFC says this: "If the client reloads a Playlist file and finds that it has not changed, then it MUST wait for a period of one-half the target duration before retrying." Given that i think a default of 100 is actually still too much and something like 3 is better, so i will locally change the default to 3 thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ 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". ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing 2023-05-10 21:58 [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing Michael Niedermayer 2023-05-10 21:58 ` [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 Michael Niedermayer @ 2023-09-16 17:35 ` Michael Niedermayer 1 sibling, 0 replies; 5+ messages in thread From: Michael Niedermayer @ 2023-09-16 17:35 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 572 bytes --] On Wed, May 10, 2023 at 11:58:31PM +0200, Michael Niedermayer wrote: > Issue found by: Сергей Колесников > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/format.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam" [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ 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". ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-16 17:35 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-05-10 21:58 [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing Michael Niedermayer 2023-05-10 21:58 ` [FFmpeg-devel] [PATCH 2/2] avformat/hls: reduce default max reload to 100 Michael Niedermayer 2023-05-11 17:36 ` Paul B Mahol 2023-05-11 22:45 ` Michael Niedermayer 2023-09-16 17:35 ` [FFmpeg-devel] [PATCH 1/2] avformat/format: Stop reading data at EOF during probing Michael Niedermayer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git