[FFmpeg-cvslog] avutil/mem: fix doc for reallocs

2022-05-26 Thread Zhao Zhili
ffmpeg | branch: master | Zhao Zhili  | Sat Apr  2 
01:05:37 2022 +0800| [5d8d3c1ac211c3b13a2dcce5214dcf250c6c61f2] | committer: 
Zhao Zhili

avutil/mem: fix doc for reallocs

The doc says those function are like av_free if size or nmemb is
zero. It doesn't match the code. av_realloc() realloc one byte if
size is zero, which was added by 91ff05f6ac5 ten years ago.
realloc() itself in C is implementation-dependent. Make the doc
match the longstanding behaviour.

Signed-off-by: Zhao Zhili 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d8d3c1ac211c3b13a2dcce5214dcf250c6c61f2
---

 libavutil/mem.h | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index b9fe80738c..d91174196c 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -250,8 +250,7 @@ void *av_mallocz_array(size_t nmemb, size_t size) 
av_malloc_attrib av_alloc_size
 /**
  * Allocate, reallocate, or free a block of memory.
  *
- * If `ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is
- * zero, free the memory block pointed to by `ptr`. Otherwise, expand or
+ * If `ptr` is `NULL` and `size` > 0, allocate a new block. Otherwise, expand 
or
  * shrink that block of memory according to `size`.
  *
  * @param ptr  Pointer to a memory block already allocated with
@@ -260,10 +259,11 @@ void *av_mallocz_array(size_t nmemb, size_t size) 
av_malloc_attrib av_alloc_size
  * reallocated
  *
  * @return Pointer to a newly-reallocated block or `NULL` if the block
- * cannot be reallocated or the function is used to free the memory 
block
+ * cannot be reallocated
  *
  * @warning Unlike av_malloc(), the returned pointer is not guaranteed to be
- *  correctly aligned.
+ *  correctly aligned. The returned pointer must be freed after even
+ *  if size is zero.
  * @see av_fast_realloc()
  * @see av_reallocp()
  */
@@ -311,8 +311,7 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
 /**
  * Allocate, reallocate, or free an array.
  *
- * If `ptr` is `NULL` and `nmemb` > 0, allocate a new block. If
- * `nmemb` is zero, free the memory block pointed to by `ptr`.
+ * If `ptr` is `NULL` and `nmemb` > 0, allocate a new block.
  *
  * @param ptr   Pointer to a memory block already allocated with
  *  av_realloc() or `NULL`
@@ -320,19 +319,19 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t 
elsize);
  * @param size  Size of the single element of the array
  *
  * @return Pointer to a newly-reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory 
block
+ * cannot be reallocated
  *
  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
- *  correctly aligned.
+ *  correctly aligned. The returned pointer must be freed after even if
+ *  nmemb is zero.
  * @see av_reallocp_array()
  */
 av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t 
size);
 
 /**
- * Allocate, reallocate, or free an array through a pointer to a pointer.
+ * Allocate, reallocate an array through a pointer to a pointer.
  *
- * If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block. If `nmemb` is
- * zero, free the memory block pointed to by `*ptr`.
+ * If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block.
  *
  * @param[in,out] ptr   Pointer to a pointer to a memory block already
  *  allocated with av_realloc(), or a pointer to `NULL`.
@@ -343,7 +342,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, 
size_t nmemb, size_t size)
  * @return Zero on success, an AVERROR error code on failure
  *
  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
- *  correctly aligned.
+ *  correctly aligned. *ptr must be freed after even if nmemb is zero.
  */
 int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
 

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

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


[FFmpeg-cvslog] avformat/jpegxl_probe: Check init_get_bits8() for failure

2022-05-26 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
May 15 22:46:12 2022 +0200| [cb5be590cd115b7831c9cbcfe4961a7e8ff65420] | 
committer: Michael Niedermayer

avformat/jpegxl_probe: Check init_get_bits8() for failure

Fixes: missing error check
Fixes: CID1504270

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb5be590cd115b7831c9cbcfe4961a7e8ff65420
---

 libavformat/jpegxl_probe.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/jpegxl_probe.c b/libavformat/jpegxl_probe.c
index 9cd00da194..3de002f004 100644
--- a/libavformat/jpegxl_probe.c
+++ b/libavformat/jpegxl_probe.c
@@ -250,8 +250,11 @@ int ff_jpegxl_verify_codestream_header(const uint8_t *buf, 
int buflen)
 int xyb_encoded = 1, have_icc_profile = 0;
 uint32_t num_extra_channels;
 uint64_t extensions;
+int ret;
 
-init_get_bits8(gb, buf, buflen);
+ret = init_get_bits8(gb, buf, buflen);
+if (ret < 0)
+return ret;
 
 if (jxl_bits(16) != FF_JPEGXL_CODESTREAM_SIGNATURE_LE)
 return -1;

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

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


[FFmpeg-cvslog] avformat/act: Check ff_get_wav_header() for failure

2022-05-26 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
May 15 22:55:12 2022 +0200| [5982da87e3464e7df529a169352748560d70ba80] | 
committer: Michael Niedermayer

avformat/act: Check ff_get_wav_header() for failure

Fixes: missing error check
Fixes: CID717495

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5982da87e3464e7df529a169352748560d70ba80
---

 libavformat/act.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/act.c b/libavformat/act.c
index 6dd9f62a87..da73fcceca 100644
--- a/libavformat/act.c
+++ b/libavformat/act.c
@@ -68,6 +68,7 @@ static int read_header(AVFormatContext *s)
 AVIOContext *pb = s->pb;
 int size;
 AVStream* st;
+int ret;
 
 int min,sec,msec;
 
@@ -77,7 +78,9 @@ static int read_header(AVFormatContext *s)
 
 avio_skip(pb, 16);
 size=avio_rl32(pb);
-ff_get_wav_header(s, pb, st->codecpar, size, 0);
+ret = ff_get_wav_header(s, pb, st->codecpar, size, 0);
+if (ret < 0)
+return ret;
 
 /*
   8000Hz (Fine-rec) file format has 10 bytes long

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

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


[FFmpeg-cvslog] Changelog: Add line for IPFS

2022-05-26 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
May 19 16:49:44 2022 +0200| [7bfbd24e71ff523afa1d7e6512cbc70b5d542dc6] | 
committer: Michael Niedermayer

Changelog: Add line for IPFS

Noticed-and-suggested-by: Mark Gaiser 
Reviewed-by: Mark Gaiser 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7bfbd24e71ff523afa1d7e6512cbc70b5d542dc6
---

 Changelog | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Changelog b/Changelog
index 7c485d27d6..53130f072f 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version 5.1:
+- add ipfs/ipns protocol support
 - dialogue enhance audio filter
 - dropped obsolete XvMC hwaccel
 - pcm-bluray encoder

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

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


[FFmpeg-cvslog] avformat/matroskadec: assert non NULL buf

2022-05-26 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
May 20 00:36:34 2022 +0200| [d84f03609ef36db0cdc48b3bbce3c5cd04bf18a1] | 
committer: Michael Niedermayer

avformat/matroskadec: assert non NULL buf

The code is only called if size is > 0 so buf should not be NULL

Helps: CID610554

Reviewed-by: Andreas Rheinhardt 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d84f03609ef36db0cdc48b3bbce3c5cd04bf18a1
---

 libavformat/matroskadec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 4715f1b7d4..de73f97aca 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3701,6 +3701,8 @@ static int matroska_parse_block(MatroskaDemuxContext 
*matroska, AVBufferRef *buf
 uint64_t num;
 int trust_default_duration;
 
+av_assert1(buf);
+
 ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL);
 
 if ((n = ebml_read_num(matroska, &pb.pub, 8, &num, 1)) < 0)

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

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


[FFmpeg-cvslog] doc/protocols: sort IPFS section alphabetically

2022-05-26 Thread Gyan Doshi
ffmpeg | branch: master | Gyan Doshi  | Thu May 26 16:13:33 
2022 +0530| [8a0f7f7bfe86a2cc57edd5255ecc144dc17e51a3] | committer: Gyan Doshi

doc/protocols: sort IPFS section alphabetically

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a0f7f7bfe86a2cc57edd5255ecc144dc17e51a3
---

 doc/protocols.texi | 62 +++---
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 90a9eefde0..399e998068 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -614,6 +614,37 @@ Establish a TLS (HTTPS) connection to Icecast.
 
icecast://[@var{username}[:@var{password}]@@]@var{server}:@var{port}/@var{mountpoint}
 @end example
 
+@section ipfs
+
+InterPlanetary File System (IPFS) protocol support. One can access files stored
+on the IPFS network through so called gateways. Those are http(s) endpoints.
+This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be send
+to such a gateway. Users can (and should) host their own node which means this
+protocol will use your local gateway to access files on the IPFS network.
+
+If a user doesn't have a node of their own then the public gateway dweb.link is
+used by default.
+
+You can use this protocol in 2 ways. Using IPFS:
+@example
+ffplay ipfs://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T
+@end example
+
+Or the IPNS protocol (IPNS is mutable IPFS):
+@example
+ffplay ipns://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T
+@end example
+
+You can also change the gateway to be used:
+
+@table @option
+
+@item gateway
+Defines the gateway to use. When nothing is provided the protocol will first 
try
+your local gateway. If that fails dweb.link will be used.
+
+@end table
+
 @section mmst
 
 MMS (Microsoft Media Server) protocol over TCP.
@@ -2025,35 +2056,4 @@ decoding errors.
 
 @end table
 
-@section ipfs
-
-InterPlanetary File System (IPFS) protocol support. One can access files stored
-on the IPFS network through so called gateways. Those are http(s) endpoints.
-This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be send
-to such a gateway. Users can (and should) host their own node which means this
-protocol will use your local gateway to access files on the IPFS network.
-
-If a user doesn't have a node of their own then the public gateway dweb.link is
-used by default.
-
-You can use this protocol in 2 ways. Using IPFS:
-@example
-ffplay ipfs://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T
-@end example
-
-Or the IPNS protocol (IPNS is mutable IPFS):
-@example
-ffplay ipns://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T
-@end example
-
-You can also change the gateway to be used:
-
-@table @option
-
-@item gateway
-Defines the gateway to use. When nothing is provided the protocol will first 
try
-your local gateway. If that fails dweb.link will be used.
-
-@end table
-
 @c man end PROTOCOLS

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

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


[FFmpeg-cvslog] doc/protocols: add details and reformat IPFS section

2022-05-26 Thread Gyan Doshi
ffmpeg | branch: master | Gyan Doshi  | Thu May 26 16:36:57 
2022 +0530| [0dcbe1c1aa8ace2a84a4a7963acd755c4bbd96fb] | committer: Gyan Doshi

doc/protocols: add details and reformat IPFS section

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0dcbe1c1aa8ace2a84a4a7963acd755c4bbd96fb
---

 doc/protocols.texi | 33 +
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 399e998068..39b719dc50 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -617,15 +617,26 @@ 
icecast://[@var{username}[:@var{password}]@@]@var{server}:@var{port}/@var{mountp
 @section ipfs
 
 InterPlanetary File System (IPFS) protocol support. One can access files stored
-on the IPFS network through so called gateways. Those are http(s) endpoints.
-This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be send
+on the IPFS network through so-called gateways. These are http(s) endpoints.
+This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent
 to such a gateway. Users can (and should) host their own node which means this
-protocol will use your local gateway to access files on the IPFS network.
+protocol will use one's local gateway to access files on the IPFS network.
 
-If a user doesn't have a node of their own then the public gateway dweb.link is
-used by default.
+If a user doesn't have a node of their own then the public gateway 
@code{https://dweb.link}
+is used by default.
 
-You can use this protocol in 2 ways. Using IPFS:
+This protocol accepts the following options:
+
+@table @option
+
+@item gateway
+Defines the gateway to use. When not set, the protocol will first try
+locating the local gateway by looking at @code{$IPFS_GATEWAY}, 
@code{$IPFS_PATH}
+and @code{$HOME/.ipfs/}, in that order. If that fails @code{https://dweb.link} 
will be used.
+
+@end table
+
+One can use this protocol in 2 ways. Using IPFS:
 @example
 ffplay ipfs://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T
 @end example
@@ -635,16 +646,6 @@ Or the IPNS protocol (IPNS is mutable IPFS):
 ffplay ipns://QmbGtJg23skhvFmu9mJiePVByhfzu5rwo74MEkVDYAmF5T
 @end example
 
-You can also change the gateway to be used:
-
-@table @option
-
-@item gateway
-Defines the gateway to use. When nothing is provided the protocol will first 
try
-your local gateway. If that fails dweb.link will be used.
-
-@end table
-
 @section mmst
 
 MMS (Microsoft Media Server) protocol over TCP.

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

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


[FFmpeg-cvslog] qsv: check for libmfx.pc instead of mfx.pc

2022-05-26 Thread Haihao Xiang
ffmpeg | branch: master | Haihao Xiang  | 
Thu May 26 10:32:26 2022 +0800| [f912cefb8343efc511aa72963b9f66e327ec0b88] | 
committer: Haihao Xiang

qsv: check for libmfx.pc instead of mfx.pc

This fixed the regression caused by commit 478e1a98a

Reported-by: Timo Rothenpieler 
Signed-off-by: Haihao Xiang 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f912cefb8343efc511aa72963b9f66e327ec0b88
---

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 6cf7d89674..5a167613a4 100755
--- a/configure
+++ b/configure
@@ -6565,7 +6565,7 @@ enabled liblensfun&& require_pkg_config 
liblensfun lensfun lensfun.h lf_
 # Media SDK or Intel Media Server Studio, these don't come with
 # pkg-config support.  Instead, users should make sure that the build
 # can find the libraries and headers through other means.
-enabled libmfx&& { check_pkg_config libmfx "mfx >= 1.28" 
"mfx/mfxvideo.h" MFXInit ||
+enabled libmfx&& { check_pkg_config libmfx "libmfx >= 1.28" 
"mfx/mfxvideo.h" MFXInit ||
{ require libmfx "mfx/mfxvideo.h mfx/mfxdefs.h" 
MFXInit "-llibmfx $advapi32_extralibs" &&
  { test_cpp_condition mfx/mfxdefs.h 
"MFX_VERSION >= 1028" || die "ERROR: libmfx version must be >= 1.28"; }  &&
  warn "using libmfx without pkg-config"; } }

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

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


[FFmpeg-cvslog] avfilter/vf_vpp_qsv: set outlink to EOF correctly

2022-05-26 Thread Fei Wang
ffmpeg | branch: master | Fei Wang  | Thu 
May 12 09:18:21 2022 +0800| [6ec127b223ab6c8062d6e99cf3d1b6ffbf75d56f] | 
committer: Haihao Xiang

avfilter/vf_vpp_qsv: set outlink to EOF correctly

1. Return error if filter frame fail before set outlink to EOF in none
pass through mode.
2. Set outlink to EOF before return success in pass through mode.

Fix endless cmd:

ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 -hwaccel_output_format \
qsv -v debug -c:v hevc_qsv -i 4k.h265  \
-filter_complex "vpp_qsv=w=3840:h=2160:async_depth=4[o1];[o1]split=2[s1][s2];
[s2]vpp_qsv=w=1920:h=1080:async_depth=4[o2];[o2]split=2[s3][s4];
[s4]vpp_qsv=w=1920:h=1080:async_depth=4[o3]" \
-map [s1] -c:v hevc_qsv -async 3 -async_depth 3 -b:v 9000k -preset 7 -g 33 -y 
-f null - \
-map [s3] -c:v hevc_qsv -async 3 -async_depth 3 -b:v 4000k -preset 7 -g 33 -y 
-f null - \
-map [o3] -c:v hevc_qsv -async 3 -async_depth 3 -b:v 3100k -preset 7 -g 33 -y 
-f null -

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ec127b223ab6c8062d6e99cf3d1b6ffbf75d56f
---

 libavfilter/vf_vpp_qsv.c | 35 +++
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 6e5056d133..4a053f9145 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -547,15 +547,17 @@ static int activate(AVFilterContext *ctx)
 qsv->eof = s->eof;
 ret = ff_qsvvpp_filter_frame(qsv, inlink, in);
 av_frame_free(&in);
+if (ret == AVERROR(EAGAIN))
+goto not_ready;
+else if (ret < 0)
+return ret;
 
-if (s->eof) {
-ff_outlink_set_status(outlink, status, pts);
-return 0;
-}
+if (s->eof)
+goto eof;
 
 if (qsv->got_frame) {
 qsv->got_frame = 0;
-return ret;
+return 0;
 }
 }
 } else {
@@ -564,18 +566,27 @@ static int activate(AVFilterContext *ctx)
 in->pts = av_rescale_q(in->pts, inlink->time_base, 
outlink->time_base);
 
 ret = ff_filter_frame(outlink, in);
-return ret;
+if (ret < 0)
+return ret;
+
+if (s->eof)
+goto eof;
+
+return 0;
 }
 }
 
-if (s->eof) {
-ff_outlink_set_status(outlink, status, pts);
-return 0;
-} else {
-FF_FILTER_FORWARD_WANTED(outlink, inlink);
-}
+not_ready:
+if (s->eof)
+goto eof;
+
+FF_FILTER_FORWARD_WANTED(outlink, inlink);
 
 return FFERROR_NOT_READY;
+
+eof:
+ff_outlink_set_status(outlink, status, pts);
+return 0;
 }
 
 static int query_formats(AVFilterContext *ctx)

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

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