[FFmpeg-devel] [PATCH v2 1/2] avformat/file: Add a specialized url_check callback for pipe protocol

2022-08-30 Thread Neil Roberts
Using file_check for the pipe protocol doesn't make sense. For example, for a URL like “pipe:0” it would end up checking whether the “pipe:0” file exists. This patch instead makes it check the access modes on the corresponding file descriptor using fcntl on *nix and DuplicateHandle on Windows. v2:

[FFmpeg-devel] [PATCH v2 2/2] avformat/tests: Add a test for avio_check with the pipe protocol

2022-08-30 Thread Neil Roberts
Creates a UNIX pipe and then verifies that avio_check returns the right access flags for the two ends of the pipe. v2: Add support for the Windows version of _pipe Signed-off-by: Neil Roberts --- libavformat/Makefile | 1 + libavformat/tests/.gitignore | 1 + libavformat/tests/pipe.

Re: [FFmpeg-devel] [PATCH 2/3] lavu/fifo: clarify interaction of AV_FIFO_FLAG_AUTO_GROW with av_fifo_can_write()

2022-08-30 Thread James Almer
On 8/30/2022 3:35 AM, Anton Khirnov wrote: Quoting James Almer (2022-08-29 17:00:54) On 8/29/2022 11:07 AM, Anton Khirnov wrote: --- libavutil/fifo.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavutil/fifo.h b/libavutil/fifo.h index 6c6bd78842..89872d0972

Re: [FFmpeg-devel] [PATCH 2/3] lavu/fifo: clarify interaction of AV_FIFO_FLAG_AUTO_GROW with av_fifo_can_write()

2022-08-30 Thread Anton Khirnov
Quoting James Almer (2022-08-30 14:56:45) > > > > I disagree that this is a break. > > > > The issue in my view is that 'can be written' is ambiguous here, so we > > are interpreting it differently. Your interpretation is apparently > > 'maximum number of elements for which a write can possibly s

Re: [FFmpeg-devel] [PATCH] avcodec: add a bsf to reorder DTS into PTS

2022-08-30 Thread Andreas Rheinhardt
James Almer: > Starting with an h264 implementation. Can be extended to support other codecs. > > Addresses ticket #502. > > Signed-off-by: James Almer > --- > configure | 1 + > libavcodec/Makefile| 1 + > libavcodec/bitstream_filters.c | 1 + > libavcode

Re: [FFmpeg-devel] [PATCH] avcodec: add a bsf to reorder DTS into PTS

2022-08-30 Thread James Almer
On 8/30/2022 11:30 AM, Andreas Rheinhardt wrote: James Almer: Starting with an h264 implementation. Can be extended to support other codecs. Addresses ticket #502. Signed-off-by: James Almer --- configure | 1 + libavcodec/Makefile| 1 + libavcodec/bit

Re: [FFmpeg-devel] [PATCH] avcodec: add a bsf to reorder DTS into PTS

2022-08-30 Thread Andreas Rheinhardt
James Almer: > On 8/30/2022 11:30 AM, Andreas Rheinhardt wrote: >> James Almer: >>> Starting with an h264 implementation. Can be extended to support >>> other codecs. >>> >>> Addresses ticket #502. >>> >>> Signed-off-by: James Almer >>> --- >>>   configure  |   1 + >>>   libavc

Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter

2022-08-30 Thread Nicolas George
Nicolas George (12022-08-24): > The actual implementation, tests and uses in the rest of > FFmpeg code will be committed separately once the API is > settled. > > Signed-off-by: Nicolas George > --- > doc/avwriter_intro.md | 109 ++ > libavutil/writer.h| 484 +

Re: [FFmpeg-devel] [PATCH v2 1/3] fftools/cmdutils: Add function to report error before exit

2022-08-30 Thread Andreas Rheinhardt
Andreas Rheinhardt: > This is designed to improve and unify error handling for > allocation failures for the many (often small) allocations that we have > in the fftools. These typically either don't return an error message > or an error message that is not really helpful to the user > and can be r

Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter

2022-08-30 Thread Leo Izen
On 8/24/22 11:18, Nicolas George wrote: +``` +AVWriter wr = av_dynbuf_writer(); +av_something_write(wr, something, 0); +if (av_writer_get_error(wr, 0) < 0) +die("Failed"); +use_string(av_dynbuf_writer_get_data(wr, NULL)); +av_dynbuf_writer_fin

Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter

2022-08-30 Thread Nicolas George
Leo Izen (12022-08-30): > Is there a reason this is AVWriter wr = foo() and not AVWriter *wr = foo()? > Most other APIs return pointers to structs, rather than structs themselves > (see: av_packet_alloc). Using a pointer would prevent us from having > sizeof(AVWriter) as part of the ABI, as was don

Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option

2022-08-30 Thread Stephen Hutchinson
On 8/28/22 8:41 PM, Andreas Rheinhardt wrote: This will make frameprops a global on-off which overrides everything else even if some of the "else" stuff has been enabled explicitly. Worse yet, if you want to disable everything except exactly one field, you have to leave frameprops enabled and dis

Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option

2022-08-30 Thread Andreas Rheinhardt
Stephen Hutchinson: > On 8/28/22 8:41 PM, Andreas Rheinhardt wrote: >> This will make frameprops a global on-off which overrides everything >> else even if some of the "else" stuff has been enabled explicitly. Worse >> yet, if you want to disable everything except exactly one field, you >> have to

[FFmpeg-devel] [PATCH] avformat/asfdec_o: limit recursion depth in asf_read_unknown()

2022-08-30 Thread Michael Niedermayer
The threshold of 5 is arbitrary, both smaller and larger should work fine Fixes: Stack overflow Fixes: 50603/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-6049302564175872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by:

Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option

2022-08-30 Thread Stephen Hutchinson
On 8/30/22 7:17 PM, Andreas Rheinhardt wrote: { "avisynth_flags", "set flags related to reading frame properties from script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" }, This is wrong. It should be { "avisynth_flags", "

[FFmpeg-devel] [PATCH 0/3 v2] avisynth: add user-selectable flags

2022-08-30 Thread Stephen Hutchinson
The reading of frame properties from the script can now be toggled on and off per-property or as a whole, using the avisynth_flags option. The ability to read _SARNum/_SARDen properties has been added, but is kept off by default because it poses more of a risk of a user accidentally getting it wro

[FFmpeg-devel] [PATCH 1/3 v2] avformat/avisynth: read _SARNum/_SARDen from frame properties

2022-08-30 Thread Stephen Hutchinson
Initialized to 1:1, but if the script sets these properties, it will be set to those instead (0:0 disables it, apparently). Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 8 1 file changed, 8 insertions(+) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c ind

[FFmpeg-devel] [PATCH 2/3 v2] avformat/avisynth: implement avisynth_flags option

2022-08-30 Thread Stephen Hutchinson
Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 52 ++ 1 file changed, 52 insertions(+) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index d978e6ec40..7bb2977383 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.

[FFmpeg-devel] [PATCH 3/3 v2] avformat/avisynth: reindent

2022-08-30 Thread Stephen Hutchinson
Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 348 - 1 file changed, 174 insertions(+), 174 deletions(-) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 7bb2977383..b426ac343e 100644 --- a/libavformat/avisynth.c +++ b/li

Re: [FFmpeg-devel] [PATCH v3 1/3] lavc/decode: Warp get_hw_config function

2022-08-30 Thread Wang, Fei W
On Tue, 2022-08-23 at 16:19 +0800, Fei Wang wrote: > From: Linjie Fu > > Wrap the procedure of getting the hardware config from a pixel format > into a function. > > Signed-off-by: Linjie Fu > Signed-off-by: Fei Wang > --- > libavcodec/decode.c | 31 +++ > 1 file c

Re: [FFmpeg-devel] [PATCH v5 00/25] Subtitle Filtering 2022

2022-08-30 Thread Anton Khirnov
Quoting Soft Works (2022-08-27 00:48:01) > 2. "There's no reason why this cannot be handled using the buffer > and data fields" > > I had explained the reasons and in conversation on IRC, Lynne was > no longer insisting on this AFAIR. I did not see this explanation, can you restate it here?

Re: [FFmpeg-devel] [PATCH v3 1/3] lavf/dashdec: Prepare DASH decoder for multithreading

2022-08-30 Thread Steven Liu
Lukas Fellechner 于2022年8月24日周三 03:04写道: > > For adding multithreading to the DASH decoder initialization, > the open_demux_for_component() method must be split up into two parts: > > begin_open_demux_for_component(): Opens the stream and does probing > and format detection. This can be run in para

Re: [FFmpeg-devel] [PATCH 12/18] lavf/dv: make returning the video packet optional

2022-08-30 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2022-08-24 18:03:05) > Anton Khirnov: > > The mov demuxer only returns DV audio, video packets are discarded. > > > > It first reads the data to be parsed into a packet. Then both this > > packet and the pointer to its data are passed together to > > avpriv_dv_produce_p

[FFmpeg-devel] [PATCH] lavf/mov: avoid leaks with multiple dv-audio streams

2022-08-30 Thread Anton Khirnov
--- libavformat/mov.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index a2b429e52f..f433746192 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2430,6 +2430,11 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb, s

[FFmpeg-devel] [PATCH] lavf/dv: return a meaningful error code from avpriv_dv_produce_packet()

2022-08-30 Thread Anton Khirnov
--- libavformat/dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dv.c b/libavformat/dv.c index f88fe62349..c888111789 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -404,7 +404,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, if

Re: [FFmpeg-devel] [PATCH v3 2/3] lavf/dashdec: Multithreaded DASH initialization

2022-08-30 Thread Andreas Rheinhardt
Lukas Fellechner: > This patch adds an "init-threads" option, specifying the max > number of threads to use. Multiple worker threads are spun up > to massively bring down init times. > --- > libavformat/dashdec.c | 351 +- > 1 file changed, 350 insertions(+)

Re: [FFmpeg-devel] [PATCH 17/18] lavf/dv: do not update AVCodecParameters.sample_rate while demuxing

2022-08-30 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2022-08-24 16:20:35) > Anton Khirnov: > > Demuxers are not allowed to do this and few callers, if any, will handle > > this correctly. Send the AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE side data > > instead. > > 1. One of the callers which did not handle this correctly is

Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter

2022-08-30 Thread Leo Izen
On 8/30/22 15:37, Nicolas George wrote: Leo Izen (12022-08-30): Is there a reason this is AVWriter wr = foo() and not AVWriter *wr = foo()? Most other APIs return pointers to structs, rather than structs themselves (see: av_packet_alloc). Using a pointer would prevent us from having sizeof(AVW

Re: [FFmpeg-devel] [PATCH] lavu: header and documentation for AVWriter

2022-08-30 Thread Andreas Rheinhardt
Leo Izen: > > On 8/30/22 15:37, Nicolas George wrote: >> Leo Izen (12022-08-30): >>> Is there a reason this is AVWriter wr = foo() and not AVWriter *wr = >>> foo()? >>> Most other APIs return pointers to structs, rather than structs >>> themselves >>> (see: av_packet_alloc). Using a pointer would

Re: [FFmpeg-devel] [PATCH 16/16] avutil/fifo: Properly deprecate av_tempfile()

2022-08-30 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2022-08-29 01:34:48) > Subject: Re: [FFmpeg-devel] [PATCH 16/16] avutil/fifo: Properly deprecate > av_tempfile() you mean file -- Anton Khirnov ___ ffmpeg-devel mailing

Re: [FFmpeg-devel] [PATCH 16/16] avutil/fifo: Properly deprecate av_tempfile()

2022-08-30 Thread Andreas Rheinhardt
Anton Khirnov: > Quoting Andreas Rheinhardt (2022-08-29 01:34:48) >> Subject: Re: [FFmpeg-devel] [PATCH 16/16] avutil/fifo: Properly deprecate >> av_tempfile() > > you mean file > Thanks for noticing, will fix. (It is btw not the only bug i

Re: [FFmpeg-devel] [PATCH v5 00/25] Subtitle Filtering 2022

2022-08-30 Thread Soft Works
> -Original Message- > From: ffmpeg-devel On Behalf Of > Anton Khirnov > Sent: Wednesday, August 31, 2022 3:40 AM > To: FFmpeg development discussions and patches de...@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH v5 00/25] Subtitle Filtering 2022 > > Quoting Soft Works (2022-08-2