[FFmpeg-cvslog] tools/dvd2concat: document that -protocol_whitelist is needed

2021-08-22 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Wed Jul 28 
12:52:44 2021 +0200| [6d82d894ee237e3c9f6ecf5e121e31cdfa375bf9] | committer: 
Nicolas George

tools/dvd2concat: document that -protocol_whitelist is needed

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

 tools/dvd2concat | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/dvd2concat b/tools/dvd2concat
index 8effee86b9..0280838a6b 100755
--- a/tools/dvd2concat
+++ b/tools/dvd2concat
@@ -37,7 +37,8 @@ normally contains a directory named B. It must not 
be encrypted
 with CSS.
 
 I is the output file. It can be used as an input to ffmpeg.
-It will require the B<-safe 0> option.
+It will require the B<-safe 0> and
+B<-protocol_whitelist file,subfile,concat> options.
 
 =cut
 

___
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] libavformat/concatdec: remove support for unsafe=-1

2021-08-22 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Wed Jul 28 
12:38:08 2021 +0200| [46fb395952be32692385449ee214461603480b4b] | committer: 
Nicolas George

libavformat/concatdec: remove support for unsafe=-1

It only makes sense as the default value,
but it is not the default since 689211d5727231c3fe92762d224dbadebdbf4e30.

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

 doc/demuxers.texi   | 9 +++--
 libavformat/concatdec.c | 6 ++
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 5b8cf1bfea..5f18e4551b 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -96,8 +96,7 @@ backslash or single quotes.
 All subsequent file-related directives apply to that file.
 
 @item @code{ffconcat version 1.0}
-Identify the script type and version. It also sets the @option{safe} option
-to 1 if it was -1.
+Identify the script type and version.
 
 To make FFmpeg recognize the format automatically, this directive must
 appear exactly as is (no extra space or byte-order-mark) on the very first
@@ -177,7 +176,8 @@ This demuxer accepts the following option:
 @table @option
 
 @item safe
-If set to 1, reject unsafe file paths. A file path is considered safe if it
+If set to 1, reject unsafe file paths and directives.
+A file path is considered safe if it
 does not contain a protocol specification and is relative and all components
 only contain characters from the portable character set (letters, digits,
 period, underscore and hyphen) and have no period at the beginning of a
@@ -187,9 +187,6 @@ If set to 0, any file name is accepted.
 
 The default is 1.
 
--1 is equivalent to 1 if the format was automatically
-probed and 0 otherwise.
-
 @item auto_convert
 If set to 1, try to perform automatic conversions on packet data to make the
 streams concatenable.
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 934e9c02fc..ed6b9d8044 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -118,7 +118,7 @@ static int add_file(AVFormatContext *avf, char *filename, 
ConcatFile **rfile,
 size_t url_len;
 int ret;
 
-if (cat->safe > 0 && !safe_filename(filename)) {
+if (cat->safe && !safe_filename(filename)) {
 av_log(avf, AV_LOG_ERROR, "Unsafe file name '%s'\n", filename);
 FAIL(AVERROR(EPERM));
 }
@@ -476,8 +476,6 @@ static int concat_read_header(AVFormatContext *avf)
 av_log(avf, AV_LOG_ERROR, "Line %d: invalid version\n", line);
 FAIL(AVERROR_INVALIDDATA);
 }
-if (cat->safe < 0)
-cat->safe = 1;
 } else {
 av_log(avf, AV_LOG_ERROR, "Line %d: unknown keyword '%s'\n",
line, keyword);
@@ -757,7 +755,7 @@ static int concat_seek(AVFormatContext *avf, int stream,
 
 static const AVOption options[] = {
 { "safe", "enable safe mode",
-  OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, DEC },
+  OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
 { "auto_convert", "automatically convert bitstream format",
   OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
 { "segment_time_metadata", "output file segment start time and duration as 
packet metadata",

___
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] lavf/concatdec: support per-file options

2021-08-22 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Wed Jul 28 
12:34:19 2021 +0200| [0210c8fee2c340ae799dcf6076bd9bf2ea8f7431] | committer: 
Nicolas George

lavf/concatdec: support per-file options

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

 doc/demuxers.texi   |  4 
 libavformat/concatdec.c | 35 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 5f18e4551b..eb3351833a 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -151,6 +151,10 @@ Metadata of the packets of the file. The specified 
metadata will be set for
 each file packet. You can specify this directive multiple times to add multiple
 metadata entries.
 
+@item @code{option @var{key} @var{value}}
+Option to access, open and probe the file.
+Can be present multiple times.
+
 @item @code{stream}
 Introduce a stream in the virtual file.
 All subsequent stream-related directives apply to the last introduced
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index ed6b9d8044..30db456b0e 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -52,6 +52,7 @@ typedef struct {
 int64_t inpoint;
 int64_t outpoint;
 AVDictionary *metadata;
+AVDictionary *options;
 int nb_streams;
 } ConcatFile;
 
@@ -330,6 +331,7 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
 {
 ConcatContext *cat = avf->priv_data;
 ConcatFile *file = &cat->files[fileno];
+AVDictionary *options = NULL;
 int ret;
 
 if (cat->avf)
@@ -345,12 +347,22 @@ static int open_file(AVFormatContext *avf, unsigned 
fileno)
 if ((ret = ff_copy_whiteblacklists(cat->avf, avf)) < 0)
 return ret;
 
-if ((ret = avformat_open_input(&cat->avf, file->url, NULL, NULL)) < 0 ||
+ret = av_dict_copy(&options, file->options, 0);
+if (ret < 0)
+return ret;
+
+if ((ret = avformat_open_input(&cat->avf, file->url, NULL, &options)) < 0 
||
 (ret = avformat_find_stream_info(cat->avf, NULL)) < 0) {
 av_log(avf, AV_LOG_ERROR, "Impossible to open '%s'\n", file->url);
+av_dict_free(&options);
 avformat_close_input(&cat->avf);
 return ret;
 }
+if (options) {
+av_log(avf, AV_LOG_WARNING, "Unused options for '%s'.\n", file->url);
+/* TODO log unused options once we have a proper string API */
+av_dict_free(&options);
+}
 cat->cur_file = file;
 file->start_time = !fileno ? 0 :
cat->files[fileno - 1].start_time +
@@ -387,6 +399,7 @@ static int concat_read_close(AVFormatContext *avf)
 }
 av_freep(&cat->files[i].streams);
 av_dict_free(&cat->files[i].metadata);
+av_dict_free(&cat->files[i].options);
 }
 if (cat->avf)
 avformat_close_input(&cat->avf);
@@ -458,6 +471,26 @@ static int concat_read_header(AVFormatContext *avf)
 FAIL(AVERROR_INVALIDDATA);
 }
 av_freep(&metadata);
+} else if (!strcmp(keyword, "option")) {
+char *key, *val;
+if (cat->safe) {
+av_log(avf, AV_LOG_ERROR, "Options not permitted in safe 
mode.\n");
+FAIL(AVERROR(EPERM));
+}
+if (!file) {
+av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
+   line, keyword);
+FAIL(AVERROR_INVALIDDATA);
+}
+if (!(key = av_get_token((const char **)&cursor, SPACE_CHARS)) ||
+!(val = av_get_token((const char **)&cursor, SPACE_CHARS))) {
+av_freep(&key);
+FAIL(AVERROR(ENOMEM));
+}
+ret = av_dict_set(&file->options, key, val,
+  AV_DICT_DONT_STRDUP_KEY | 
AV_DICT_DONT_STRDUP_VAL);
+if (ret < 0)
+FAIL(ret);
 } else if (!strcmp(keyword, "stream")) {
 if (!avformat_new_stream(avf, NULL))
 FAIL(AVERROR(ENOMEM));

___
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] tools/dvd2concat: use option keyword

2021-08-22 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Wed Jul 28 
12:45:34 2021 +0200| [252128561e891da8a4a3c4ea3ffa7071c443e343] | committer: 
Nicolas George

tools/dvd2concat: use option keyword

subfile,,start,X,end,Y,,: is ugly and will be gone some day.

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

 tools/dvd2concat | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/dvd2concat b/tools/dvd2concat
index 0280838a6b..ef04a87d05 100755
--- a/tools/dvd2concat
+++ b/tools/dvd2concat
@@ -117,10 +117,12 @@ for my $cell (@{$track->{cell}}) {
   my $file = @files == 1 ? $files[0] : "concat:" . join("|", @files);
   my $start = $off << 11;
   my $end = ($off + $size) << 11;
-  $file = "subfile,,start,${start},end,${end},,:$file";
 
   my $dur = int(1000 * $cell->{length});
-  $concat .= sprintf "\nfile '%s'\nduration %02d:%02d:%02d.%03d\n", $file,
+  $concat .= "\nfile 'subfile:$file'\n";
+  $concat .= "option start $start\n";
+  $concat .= "option end   $end\n";
+  $concat .= sprintf "duration %02d:%02d:%02d.%03d\n",
 int($dur / 360), int($dur / 6) % 60, int($dur / 1000) % 60,
 $dur % 1000;
 }

___
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_v360: refactor rescaling of i/j

2021-08-22 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Aug 22 13:42:08 
2021 +0200| [1616f7fb28cbaef19dcccd3379853addb43a3bcb] | committer: Paul B Mahol

avfilter/vf_v360: refactor rescaling of i/j

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

 libavfilter/vf_v360.c | 109 ++
 1 file changed, 57 insertions(+), 52 deletions(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 52e75ee7f2..b6e9acf5dc 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -1373,6 +1373,11 @@ static void process_cube_coordinates(const V360Context 
*s,
 rotate_cube_face(new_uf, new_vf, s->in_cubemap_face_rotation[*face]);
 }
 
+static av_always_inline float rescale(int x, int s)
+{
+return (2.f * x + 1.f) / s - 1.f;
+}
+
 /**
  * Calculate 3D coordinates on sphere for corresponding frame position in 
cubemap3x2 format.
  *
@@ -1402,8 +1407,8 @@ static int cube3x2_to_xyz(const V360Context *s,
 const int ewi = ceilf(ew * (u_face + 1)) - u_shift;
 const int ehi = ceilf(eh * (v_face + 1)) - v_shift;
 
-const float uf = 2.f * (i - u_shift + 0.5f) / ewi - 1.f;
-const float vf = 2.f * (j - v_shift + 0.5f) / ehi - 1.f;
+const float uf = rescale(i - u_shift, ewi);
+const float vf = rescale(j - v_shift, ehi);
 
 cube_to_xyz(s, uf, vf, face, vec, scalew, scaleh);
 
@@ -1526,8 +1531,8 @@ static int cube1x6_to_xyz(const V360Context *s,
 const int v_shift = ceilf(eh * face);
 const int ehi = ceilf(eh * (face + 1)) - v_shift;
 
-const float uf = 2.f * (i   + 0.5f) / ew  - 1.f;
-const float vf = 2.f * (j - v_shift + 0.5f) / ehi - 1.f;
+const float uf = rescale(i, ew);
+const float vf = rescale(j - v_shift, ehi);
 
 cube_to_xyz(s, uf, vf, face, vec, scalew, scaleh);
 
@@ -1559,8 +1564,8 @@ static int cube6x1_to_xyz(const V360Context *s,
 const int u_shift = ceilf(ew * face);
 const int ewi = ceilf(ew * (face + 1)) - u_shift;
 
-const float uf = 2.f * (i - u_shift + 0.5f) / ewi - 1.f;
-const float vf = 2.f * (j   + 0.5f) / eh  - 1.f;
+const float uf = rescale(i - u_shift, ewi);
+const float vf = rescale(j, eh);
 
 cube_to_xyz(s, uf, vf, face, vec, scalew, scaleh);
 
@@ -1758,8 +1763,8 @@ static int equirect_to_xyz(const V360Context *s,
int i, int j, int width, int height,
float *vec)
 {
-const float phi   = ((2.f * i + 0.5f) / width  - 1.f) * s->flat_range[0];
-const float theta = ((2.f * j + 0.5f) / height - 1.f) * s->flat_range[1];
+const float phi   = rescale(i, width)  * s->flat_range[0];
+const float theta = rescale(j, height) * s->flat_range[1];
 
 const float sin_phi   = sinf(phi);
 const float cos_phi   = cosf(phi);
@@ -1787,8 +1792,8 @@ static int hequirect_to_xyz(const V360Context *s,
 int i, int j, int width, int height,
 float *vec)
 {
-const float phi   = ((2.f * i + 0.5f) / width  - 1.f) * M_PI_2;
-const float theta = ((2.f * j + 0.5f) / height - 1.f) * M_PI_2;
+const float phi   = rescale(i, width)  * M_PI_2;
+const float theta = rescale(j, height) * M_PI_2;
 
 const float sin_phi   = sinf(phi);
 const float cos_phi   = cosf(phi);
@@ -1833,8 +1838,8 @@ static int stereographic_to_xyz(const V360Context *s,
 int i, int j, int width, int height,
 float *vec)
 {
-const float x = ((2.f * i + 1.f) / width  - 1.f) * s->flat_range[0];
-const float y = ((2.f * j + 1.f) / height - 1.f) * s->flat_range[1];
+const float x = rescale(i, width)  * s->flat_range[0];
+const float y = rescale(j, height) * s->flat_range[1];
 const float r = hypotf(x, y);
 const float theta = atanf(r) * 2.f;
 const float sin_theta = sinf(theta);
@@ -1939,8 +1944,8 @@ static int equisolid_to_xyz(const V360Context *s,
 int i, int j, int width, int height,
 float *vec)
 {
-const float x = ((2.f * i + 1.f) / width  - 1.f) * s->flat_range[0];
-const float y = ((2.f * j + 1.f) / height - 1.f) * s->flat_range[1];
+const float x = rescale(i, width)  * s->flat_range[0];
+const float y = rescale(j, height) * s->flat_range[1];
 const float r = hypotf(x, y);
 const float theta = asinf(r) * 2.f;
 const float sin_theta = sinf(theta);
@@ -2045,8 +2050,8 @@ static int orthographic_to_xyz(const V360Context *s,
int i, int j, int width, int height,
float *vec)
 {
-const float x = ((2.f * i + 1.f) / width  - 1.f) * s->flat_range[0];
-const float y = ((2.f * j + 1.f) / height - 1.f) * s->flat_range[1];
+const float x = rescale(i, width)  * s->flat_range[0];
+const float y = rescale(j, height) * s->flat_range[1];
 const float r = hypotf(x, y);

[FFmpeg-cvslog] avfilter/vf_v360: fill unused regions too for orthographic output format

2021-08-22 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Aug 22 14:00:04 
2021 +0200| [da6aab45e42a41b2b5750f7f36cb7da7de26c4ed] | committer: Paul B Mahol

avfilter/vf_v360: fill unused regions too for orthographic output format

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

 libavfilter/vf_v360.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index b6e9acf5dc..58915c5487 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -2055,13 +2055,20 @@ static int orthographic_to_xyz(const V360Context *s,
 const float r = hypotf(x, y);
 const float theta = asinf(r);
 
-vec[0] = x;
-vec[1] = y;
 vec[2] = cosf(theta);
+if (vec[2] > 0) {
+vec[0] = x;
+vec[1] = y;
 
-normalize_vector(vec);
+normalize_vector(vec);
+return 1;
+} else {
+vec[0] = 0;
+vec[1] = 0;
+vec[2] = 1;
 
-return 1;
+return 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] avformat/mov: add AVFMT_SHOW_IDS flag

2021-08-22 Thread Gyan Doshi
ffmpeg | branch: master | Gyan Doshi  | Wed Aug 11 12:08:13 
2021 +0530| [d905af0c2409c854dcd45a05fe4caf9ac49d82ad] | committer: Gyan Doshi

avformat/mov: add AVFMT_SHOW_IDS flag

The MOV muxer can store streamids as track ids but they aren't
visible when probing the result via lavf/dump or ffprobe due to
lack of this flag in the demuxer.

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

 libavformat/mov.c | 2 +-
 tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov | 2 +-
 tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov | 2 +-
 tests/ref/fate/mov-zombie | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 46bc7b5aa3..c556390525 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8216,5 +8216,5 @@ const AVInputFormat ff_mov_demuxer = {
 .read_packet= mov_read_packet,
 .read_close = mov_read_close,
 .read_seek  = mov_read_seek,
-.flags  = AVFMT_NO_BYTE_SEEK | AVFMT_SEEK_TO_PTS,
+.flags  = AVFMT_NO_BYTE_SEEK | AVFMT_SEEK_TO_PTS | AVFMT_SHOW_IDS,
 };
diff --git a/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov 
b/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov
index 4ef569df89..8d21c396fc 100644
--- a/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov
+++ b/tests/ref/fate/hapqa-extract-nosnappy-to-hapalphaonly-mov
@@ -36,7 +36,7 @@ color_primaries=unknown
 chroma_location=unspecified
 field_order=unknown
 refs=1
-id=N/A
+id=0x1
 r_frame_rate=25/1
 avg_frame_rate=25/1
 time_base=1/12800
diff --git a/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov 
b/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov
index 70e7cdc943..6f1f7c543f 100644
--- a/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov
+++ b/tests/ref/fate/hapqa-extract-nosnappy-to-hapq-mov
@@ -36,7 +36,7 @@ color_primaries=unknown
 chroma_location=unspecified
 field_order=unknown
 refs=1
-id=N/A
+id=0x1
 r_frame_rate=25/1
 avg_frame_rate=25/1
 time_base=1/12800
diff --git a/tests/ref/fate/mov-zombie b/tests/ref/fate/mov-zombie
index 6e6d43d563..b6656de744 100644
--- a/tests/ref/fate/mov-zombie
+++ b/tests/ref/fate/mov-zombie
@@ -194,5 +194,5 @@ 
frame|media_type=video|stream_index=0|key_frame=0|pts=188623|pts_time=2.095811|p
 
packet|codec_type=video|stream_index=0|pts=197632|pts_time=2.195911|dts=191625|dts_time=2.129167|duration=3003|duration_time=0.033367|size=580|pos=101820|flags=__
 
frame|media_type=video|stream_index=0|key_frame=0|pts=191626|pts_time=2.129178|pkt_dts=N/A|pkt_dts_time=N/A|best_effort_timestamp=191626|best_effort_timestamp_time=2.129178|pkt_duration=3003|pkt_duration_time=0.033367|pkt_pos=99180|pkt_size=1666|width=160|height=240|pix_fmt=yuv420p|sample_aspect_ratio=2:1|pict_type=P|coded_picture_number=63|display_picture_number=0|interlaced_frame=0|top_field_first=0|repeat_pict=0|color_range=tv|color_space=smpte170m|color_primaries=smpte170m|color_transfer=bt709|chroma_location=topleftside_data|side_data_type=H.26[45]
 User Data Unregistered SEI message
 
-stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=160|height=240|coded_width=160|coded_height=240|closed_captions=0|has_b_frames=1|sample_aspect_ratio=2:1|display_aspect_ratio=4:3|pix_fmt=yuv420p|level=12|color_range=tv|color_space=smpte170m|color_transfer=bt709|color_primaries=smpte170m|chroma_location=topleft|field_order=unknown|refs=2|is_avc=true|nal_length_size=4|id=N/A|r_frame_rate=3/1001|avg_frame_rate=6372000/212521|time_base=1/9|start_pts=0|start_time=0.00|duration_ts=2125200|duration=23.61|bit_rate=333874|max_bit_rate=N/A|bits_per_raw_sample=8|nb_frames=708|nb_read_frames=65|nb_read_packets=66|disposition:default=1|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:capti
 
ons=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|tag:creation_time=2008-05-12T20:59:27.00Z|tag:language=eng|tag:handler_name=Apple
 Video Media Handler|tag:vendor_id=appl|tag:encoder=H.264
+stream|index=0|codec_name=h264|profile=77|codec_type=video|codec_tag_string=avc1|codec_tag=0x31637661|width=160|height=240|coded_width=160|coded_height=240|closed_captions=0|has_b_frames=1|sample_aspect_ratio=2:1|display_aspect_ratio=4:3|pix_fmt=yuv420p|level=12|color_range=tv|color_space=smpte170m|color_transfer=bt709|color_primaries=smpte170m|chroma_location=topleft|field_order=unknown|refs=2|is_avc=true|nal_length_size=4|id=0x1|r_frame_rate=3/1001|avg_frame_rate=6372000/212521|time_base=1/9|start_pts=0|start_time=0.00|duration_ts=2125200|duration=23.61|bi

[FFmpeg-cvslog] avfilter/internal: Uninline ff_insert_(in|out)pad()

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 21:29:34 2021 +0200| [dff1709eb2dc6f3f8128abb4e2c764cc7c5fc92b] | 
committer: Andreas Rheinhardt

avfilter/internal: Uninline ff_insert_(in|out)pad()

These functions are not hot at all.

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/avfilter.c | 24 +---
 libavfilter/internal.h | 29 +++--
 2 files changed, 24 insertions(+), 29 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 28123655d6..2681d04fc0 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -101,9 +101,17 @@ void ff_command_queue_pop(AVFilterContext *filter)
 av_free(c);
 }
 
-int ff_append_pad(unsigned *count,
-   AVFilterPad **pads, AVFilterLink ***links,
-   AVFilterPad *newpad)
+/**
+ * Append a new pad.
+ *
+ * @param count  Pointer to the number of pads in the list
+ * @param pads   Pointer to the pointer to the beginning of the list of pads
+ * @param links  Pointer to the pointer to the beginning of the list of links
+ * @param newpad The new pad to add. A copy is made when adding.
+ * @return >= 0 in case of success, a negative AVERROR code on error
+ */
+static int append_pad(unsigned *count, AVFilterPad **pads,
+  AVFilterLink ***links, AVFilterPad *newpad)
 {
 AVFilterLink **newlinks;
 AVFilterPad *newpads;
@@ -126,6 +134,16 @@ int ff_append_pad(unsigned *count,
 return 0;
 }
 
+int ff_append_inpad(AVFilterContext *f, AVFilterPad *p)
+{
+return append_pad(&f->nb_inputs, &f->input_pads, &f->inputs, p);
+}
+
+int ff_append_outpad(AVFilterContext *f, AVFilterPad *p)
+{
+return append_pad(&f->nb_outputs, &f->output_pads, &f->outputs, p);
+}
+
 int avfilter_link(AVFilterContext *src, unsigned srcpad,
   AVFilterContext *dst, unsigned dstpad)
 {
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 51b0afa24d..cc95f06c4c 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -230,33 +230,10 @@ void ff_tlog_ref(void *ctx, AVFrame *ref, int end);
 void ff_tlog_link(void *ctx, AVFilterLink *link, int end);
 
 /**
- * Insert a new pad.
- *
- * @param count Pointer to the number of pads in the list
- * @param pads Pointer to the pointer to the beginning of the list of pads
- * @param links Pointer to the pointer to the beginning of the list of links
- * @param newpad The new pad to add. A copy is made when adding.
- * @return >= 0 in case of success, a negative AVERROR code on error
+ * Append a new input/output pad to the filter's list of such pads.
  */
-int ff_append_pad(unsigned *count,
-   AVFilterPad **pads, AVFilterLink ***links,
-   AVFilterPad *newpad);
-
-/** Insert a new input pad for the filter. */
-static inline int ff_append_inpad(AVFilterContext *f,
-   AVFilterPad *p)
-{
-return ff_append_pad(&f->nb_inputs,
-  &f->input_pads, &f->inputs, p);
-}
-
-/** Insert a new output pad for the filter. */
-static inline int ff_append_outpad(AVFilterContext *f,
-AVFilterPad *p)
-{
-return ff_append_pad(&f->nb_outputs,
-  &f->output_pads, &f->outputs, p);
-}
+int ff_append_inpad (AVFilterContext *f, AVFilterPad *p);
+int ff_append_outpad(AVFilterContext *f, AVFilterPad *p);
 
 /**
  * Request an input frame from the filter at the other end of the link.

___
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/avfilter: Allow to free non-static pads generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 21:54:31 2021 +0200| [f308f37441ec0d49166641843acd5302c1e26e6a] | 
committer: Andreas Rheinhardt

avfilter/avfilter: Allow to free non-static pads generically

This can be enabled/disabled on a per-pad basis by setting
the AVFILTERPAD_FLAG_FREE_NAME flag; variants of ff_append_(in|out)pads
that do this for you have been added and will be put to use in the
following commits.

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/avfilter.c | 21 -
 libavfilter/internal.h | 10 ++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 2681d04fc0..4b6a3d1e8f 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -123,8 +123,11 @@ static int append_pad(unsigned *count, AVFilterPad **pads,
 *pads  = newpads;
 if (newlinks)
 *links = newlinks;
-if (!newpads || !newlinks)
+if (!newpads || !newlinks) {
+if (newpad->flags & AVFILTERPAD_FLAG_FREE_NAME)
+av_freep(&newpad->name);
 return AVERROR(ENOMEM);
+}
 
 memcpy(*pads + idx, newpad, sizeof(AVFilterPad));
 (*links)[idx] = NULL;
@@ -139,11 +142,23 @@ int ff_append_inpad(AVFilterContext *f, AVFilterPad *p)
 return append_pad(&f->nb_inputs, &f->input_pads, &f->inputs, p);
 }
 
+int ff_append_inpad_free_name(AVFilterContext *f, AVFilterPad *p)
+{
+p->flags |= AVFILTERPAD_FLAG_FREE_NAME;
+return ff_append_inpad(f, p);
+}
+
 int ff_append_outpad(AVFilterContext *f, AVFilterPad *p)
 {
 return append_pad(&f->nb_outputs, &f->output_pads, &f->outputs, p);
 }
 
+int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p)
+{
+p->flags |= AVFILTERPAD_FLAG_FREE_NAME;
+return ff_append_outpad(f, p);
+}
+
 int avfilter_link(AVFilterContext *src, unsigned srcpad,
   AVFilterContext *dst, unsigned dstpad)
 {
@@ -754,9 +769,13 @@ void avfilter_free(AVFilterContext *filter)
 
 for (i = 0; i < filter->nb_inputs; i++) {
 free_link(filter->inputs[i]);
+if (filter->input_pads[i].flags  & AVFILTERPAD_FLAG_FREE_NAME)
+av_freep(&filter->input_pads[i].name);
 }
 for (i = 0; i < filter->nb_outputs; i++) {
 free_link(filter->outputs[i]);
+if (filter->output_pads[i].flags & AVFILTERPAD_FLAG_FREE_NAME)
+av_freep(&filter->output_pads[i].name);
 }
 
 if (filter->filter->priv_class)
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index cc95f06c4c..6ddf024d93 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -68,6 +68,11 @@ struct AVFilterPad {
  */
 #define AVFILTERPAD_FLAG_NEEDS_WRITABLE  (1 << 0)
 
+/**
+ * The pad's name is allocated and should be freed generically.
+ */
+#define AVFILTERPAD_FLAG_FREE_NAME   (1 << 1)
+
 /**
  * A combination of AVFILTERPAD_FLAG_* flags.
  */
@@ -231,9 +236,14 @@ void ff_tlog_link(void *ctx, AVFilterLink *link, int end);
 
 /**
  * Append a new input/output pad to the filter's list of such pads.
+ *
+ * The *_free_name versions will set the AVFILTERPAD_FLAG_FREE_NAME flag
+ * ensuring that the name will be freed generically (even on insertion error).
  */
 int ff_append_inpad (AVFilterContext *f, AVFilterPad *p);
 int ff_append_outpad(AVFilterContext *f, AVFilterPad *p);
+int ff_append_inpad_free_name (AVFilterContext *f, AVFilterPad *p);
+int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p);
 
 /**
  * Request an input frame from the filter at the other end of the link.

___
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/af_afir: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Aug 16 21:39:50 2021 +0200| [c54c8836cf0ebd7b40f1ceb6c3da1acc583937b1] | 
committer: Andreas Rheinhardt

avfilter/af_afir: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_afir.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index d3868a7f2e..b74e7ddfae 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -792,9 +792,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_frame_free(&s->ir[i]);
 }
 
-for (unsigned i = 1; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
-
 av_frame_free(&s->video);
 }
 
@@ -849,11 +846,9 @@ static av_cold int init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-ret = ff_append_inpad(ctx, &pad);
-if (ret < 0) {
-av_freep(&pad.name);
+ret = ff_append_inpad_free_name(ctx, &pad);
+if (ret < 0)
 return ret;
-}
 }
 
 pad = (AVFilterPad) {

___
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/af_acrossover: Free outpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 21:58:39 2021 +0200| [59b465e4dfc0bb85409bfa777b591d23476ec82b] | 
committer: Andreas Rheinhardt

avfilter/af_acrossover: Free outpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_acrossover.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index edb257d634..8306d532ac 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -191,10 +191,8 @@ static av_cold int init(AVFilterContext *ctx)
 return AVERROR(ENOMEM);
 pad.name = name;
 
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return ret;
@@ -539,13 +537,9 @@ fail:
 static av_cold void uninit(AVFilterContext *ctx)
 {
 AudioCrossoverContext *s = ctx->priv;
-int i;
 
 av_freep(&s->fdsp);
 av_frame_free(&s->xover);
-
-for (i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
 }
 
 static const AVFilterPad inputs[] = {

___
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/af_amerge: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [414c1b9b62f364c5d02714f4d1234a77442d8261] | 
committer: Andreas Rheinhardt

avfilter/af_amerge: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_amerge.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index 0e8bdea436..d67e3d7e32 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -60,8 +60,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 AMergeContext *s = ctx->priv;
 
 av_freep(&s->in);
-for (unsigned i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
 }
 
 static int query_formats(AVFilterContext *ctx)
@@ -328,10 +326,8 @@ static av_cold int init(AVFilterContext *ctx)
 };
 if (!name)
 return AVERROR(ENOMEM);
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 return 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] avfilter/af_amix: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [0e936381ff6528bd28b098b653882e49da2ed6ff] | 
committer: Andreas Rheinhardt

avfilter/af_amix: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_amix.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index 9625864038..41212d922a 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -553,10 +553,8 @@ static av_cold int init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 s->fdsp = avpriv_float_dsp_alloc(0);
@@ -589,9 +587,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_freep(&s->scale_norm);
 av_freep(&s->weights);
 av_freep(&s->fdsp);
-
-for (i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
 }
 
 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".


[FFmpeg-cvslog] avfilter/af_ladspa: Free inpad's name generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [7670e24eb015f6526497c310ebc0d2efc28fb2d6] | 
committer: Andreas Rheinhardt

avfilter/af_ladspa: Free inpad's name generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_ladspa.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c
index 9186b75957..73cbd288c0 100644
--- a/libavfilter/af_ladspa.c
+++ b/libavfilter/af_ladspa.c
@@ -456,7 +456,7 @@ static av_cold int init(AVFilterContext *ctx)
 AVFilterPad pad = { NULL };
 char *p, *arg, *saveptr = NULL;
 unsigned long nb_ports;
-int i, j = 0;
+int i, j = 0, ret;
 
 if (!s->dl_name) {
 av_log(ctx, AV_LOG_ERROR, "No plugin name provided\n");
@@ -639,10 +639,8 @@ static av_cold int init(AVFilterContext *ctx)
 
 pad.filter_frame = filter_frame;
 pad.config_props = config_input;
-if (ff_append_inpad(ctx, &pad) < 0) {
-av_freep(&pad.name);
-return AVERROR(ENOMEM);
-}
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
+return ret;
 }
 
 av_log(ctx, AV_LOG_DEBUG, "ports: %lu\n", nb_ports);
@@ -750,9 +748,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_freep(&s->octlv);
 av_freep(&s->handles);
 av_freep(&s->ctl_needs_value);
-
-if (ctx->nb_inputs)
-av_freep(&ctx->input_pads[0].name);
 }
 
 static int process_command(AVFilterContext *ctx, const char *cmd, const char 
*args,

___
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/af_headphone: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Aug 16 21:43:49 2021 +0200| [ad5d056dc37d3df199aaf5055a05bd9b5a24836a] | 
committer: Andreas Rheinhardt

avfilter/af_headphone: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_headphone.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index a2f18417bc..0cb188b61d 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -670,10 +670,8 @@ static av_cold int init(AVFilterContext *ctx)
 };
 if (!name)
 return AVERROR(ENOMEM);
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 if (s->type == TIME_DOMAIN) {
@@ -729,9 +727,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_freep(&s->temp_afft[1]);
 av_freep(&s->data_hrtf[0]);
 av_freep(&s->data_hrtf[1]);
-
-for (unsigned i = 1; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
 }
 
 #define OFFSET(x) offsetof(HeadphoneContext, x)

___
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/af_lv2: Free inpad's name generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [f28db2ca277ac24fd549a6ab9beaf46872848df1] | 
committer: Andreas Rheinhardt

avfilter/af_lv2: Free inpad's name generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_lv2.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavfilter/af_lv2.c b/libavfilter/af_lv2.c
index 76a289434f..75c7494cc8 100644
--- a/libavfilter/af_lv2.c
+++ b/libavfilter/af_lv2.c
@@ -393,7 +393,7 @@ static av_cold int init(AVFilterContext *ctx)
 const LilvPlugin *plugin;
 AVFilterPad pad = { NULL };
 LilvNode *uri;
-int i;
+int i, ret;
 
 s->world = lilv_world_new();
 if (!s->world)
@@ -464,10 +464,8 @@ static av_cold int init(AVFilterContext *ctx)
 return AVERROR(ENOMEM);
 
 pad.filter_frame = filter_frame;
-if (ff_append_inpad(ctx, &pad) < 0) {
-av_freep(&pad.name);
-return AVERROR(ENOMEM);
-}
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
+return ret;
 }
 
 return 0;
@@ -562,9 +560,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_freep(&s->maxes);
 av_freep(&s->controls);
 av_freep(&s->seq_out);
-
-if (ctx->nb_inputs)
-av_freep(&ctx->input_pads[0].name);
 }
 
 static const AVFilterPad lv2_outputs[] = {

___
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/af_join: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [d2e72473dffb4090c4568a21fcdcc8f709a17c80] | 
committer: Andreas Rheinhardt

avfilter/af_join: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/af_join.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/af_join.c b/libavfilter/af_join.c
index 8e57dfb8b9..c8e58260da 100644
--- a/libavfilter/af_join.c
+++ b/libavfilter/af_join.c
@@ -194,10 +194,8 @@ static av_cold int join_init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
@@ -212,10 +210,6 @@ static av_cold void join_uninit(AVFilterContext *ctx)
 av_frame_free(&s->input_frames[i]);
 }
 
-for (i = 0; i < ctx->nb_inputs; i++) {
-av_freep(&ctx->input_pads[i].name);
-}
-
 av_freep(&s->channels);
 av_freep(&s->buffers);
 av_freep(&s->input_frames);

___
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/avf_concat: Free pads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [fbfcb012aca8259dd1c03ce3bf3aff1878b630e6] | 
committer: Andreas Rheinhardt

avfilter/avf_concat: Free pads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/avf_concat.c | 13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
index 10f21cecb7..2ae24e9b39 100644
--- a/libavfilter/avf_concat.c
+++ b/libavfilter/avf_concat.c
@@ -319,10 +319,8 @@ static av_cold int init(AVFilterContext *ctx)
 else
 pad.get_buffer.audio = get_audio_buffer;
 pad.name = av_asprintf("in%d:%c%d", seg, "va"[type], str);
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 }
 }
@@ -334,10 +332,8 @@ static av_cold int init(AVFilterContext *ctx)
 .config_props  = config_output,
 };
 pad.name = av_asprintf("out:%c%d", "va"[type], str);
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 }
 
@@ -351,12 +347,7 @@ static av_cold int init(AVFilterContext *ctx)
 static av_cold void uninit(AVFilterContext *ctx)
 {
 ConcatContext *cat = ctx->priv;
-unsigned i;
 
-for (i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
-for (i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
 av_freep(&cat->in);
 }
 

___
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/f_interleave: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [b8e31568dfee086e068b1148e62d42682edf9041] | 
committer: Andreas Rheinhardt

avfilter/f_interleave: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/f_interleave.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/libavfilter/f_interleave.c b/libavfilter/f_interleave.c
index d0c94abbce..b60e89762f 100644
--- a/libavfilter/f_interleave.c
+++ b/libavfilter/f_interleave.c
@@ -173,21 +173,13 @@ static av_cold int init(AVFilterContext *ctx)
 default:
 av_assert0(0);
 }
-if ((ret = ff_append_inpad(ctx, &inpad)) < 0) {
-av_freep(&inpad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &inpad)) < 0)
 return ret;
-}
 }
 
 return 0;
 }
 
-static av_cold void uninit(AVFilterContext *ctx)
-{
-for (int i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
-}
-
 static int config_output(AVFilterLink *outlink)
 {
 AVFilterContext *ctx = outlink->src;
@@ -242,7 +234,6 @@ const AVFilter ff_vf_interleave = {
 .description = NULL_IF_CONFIG_SMALL("Temporally interleave video inputs."),
 .priv_size   = sizeof(InterleaveContext),
 .init= init,
-.uninit  = uninit,
 .activate= activate,
 FILTER_OUTPUTS(interleave_outputs),
 .priv_class  = &interleave_class,
@@ -269,7 +260,6 @@ const AVFilter ff_af_ainterleave = {
 .description = NULL_IF_CONFIG_SMALL("Temporally interleave audio inputs."),
 .priv_size   = sizeof(InterleaveContext),
 .init= init,
-.uninit  = uninit,
 .activate= activate,
 FILTER_OUTPUTS(ainterleave_outputs),
 .priv_class  = &ainterleave_class,

___
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/f_segment: Free outpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Aug 17 02:29:50 2021 +0200| [f6c6a51d988763fe92961ff483c6d5eb98055f38] | 
committer: Andreas Rheinhardt

avfilter/f_segment: Free outpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/f_segment.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavfilter/f_segment.c b/libavfilter/f_segment.c
index f40b18839c..e9b574d5bc 100644
--- a/libavfilter/f_segment.c
+++ b/libavfilter/f_segment.c
@@ -137,10 +137,8 @@ static av_cold int init(AVFilterContext *ctx, enum 
AVMediaType type)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
@@ -245,9 +243,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 SegmentContext *s = ctx->priv;
 
 av_freep(&s->points);
-
-for (unsigned i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
 }
 
 #define OFFSET(x) offsetof(SegmentContext, x)

___
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/f_select: Free outpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [64133506f7894a93bbd143b54224a6e85cdb59fe] | 
committer: Andreas Rheinhardt

avfilter/f_select: Free outpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/f_select.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index fad54ab16a..187e98a1a7 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -192,10 +192,8 @@ static av_cold int init(AVFilterContext *ctx)
 return AVERROR(ENOMEM);
 pad.type = ctx->filter->inputs[0].type;
 pad.request_frame = request_frame;
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
@@ -432,14 +430,10 @@ static int request_frame(AVFilterLink *outlink)
 static av_cold void uninit(AVFilterContext *ctx)
 {
 SelectContext *select = ctx->priv;
-int i;
 
 av_expr_free(select->expr);
 select->expr = NULL;
 
-for (i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
-
 if (select->do_scene_detect) {
 av_frame_free(&select->prev_picref);
 }

___
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/f_streamselect: Free pads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [a79852f1c14aec91be999beb3f23473556321a35] | 
committer: Andreas Rheinhardt

avfilter/f_streamselect: Free pads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/f_streamselect.c | 15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c
index da2391898f..c5427672e2 100644
--- a/libavfilter/f_streamselect.c
+++ b/libavfilter/f_streamselect.c
@@ -167,16 +167,13 @@ static int parse_definition(AVFilterContext *ctx, int 
nb_pads, int is_input, int
 av_log(ctx, AV_LOG_DEBUG, "Add %s pad %s\n", padtype, pad.name);
 
 if (is_input) {
-ret = ff_append_inpad(ctx, &pad);
+ret = ff_append_inpad_free_name(ctx, &pad);
 } else {
 pad.config_props  = config_output;
-ret = ff_append_outpad(ctx, &pad);
+ret = ff_append_outpad_free_name(ctx, &pad);
 }
-
-if (ret < 0) {
-av_freep(&pad.name);
+if (ret < 0)
 return ret;
-}
 }
 
 return 0;
@@ -295,12 +292,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_freep(&s->map);
 av_freep(&s->frames);
 ff_framesync_uninit(&s->fs);
-
-for (int i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
-
-for (int i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
 }
 
 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".


[FFmpeg-cvslog] avfilter/split: Free outpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [0ce19ecd2833080b3f6bd0d9d0838e4eccb8e792] | 
committer: Andreas Rheinhardt

avfilter/split: Free outpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/split.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/libavfilter/split.c b/libavfilter/split.c
index a77ce6f6f1..b02584d0ab 100644
--- a/libavfilter/split.c
+++ b/libavfilter/split.c
@@ -56,23 +56,13 @@ static av_cold int split_init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
 }
 
-static av_cold void split_uninit(AVFilterContext *ctx)
-{
-int i;
-
-for (i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
-}
-
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -124,7 +114,6 @@ const AVFilter ff_vf_split = {
 .priv_size   = sizeof(SplitContext),
 .priv_class  = &split_class,
 .init= split_init,
-.uninit  = split_uninit,
 FILTER_INPUTS(avfilter_vf_split_inputs),
 .outputs = NULL,
 .flags   = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
@@ -144,7 +133,6 @@ const AVFilter ff_af_asplit = {
 .priv_size   = sizeof(SplitContext),
 .priv_class  = &asplit_class,
 .init= split_init,
-.uninit  = split_uninit,
 FILTER_INPUTS(avfilter_af_asplit_inputs),
 .outputs = NULL,
 .flags   = AVFILTER_FLAG_DYNAMIC_OUTPUTS,

___
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/src_movie: Free outpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [41c98bfe0a6fc614e3e4046f2fba8e9ebf75a134] | 
committer: Andreas Rheinhardt

avfilter/src_movie: Free outpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/src_movie.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index ea5bb90255..0d63c1e4bc 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -306,10 +306,8 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
 return AVERROR(ENOMEM);
 pad.config_props  = movie_config_output_props;
 pad.request_frame = movie_request_frame;
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 if ( movie->st[i].st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
 !movie->st[i].st->codecpar->channel_layout) {
 ret = guess_channel_layout(&movie->st[i], i, ctx);
@@ -334,7 +332,6 @@ static av_cold void movie_uninit(AVFilterContext *ctx)
 int i;
 
 for (i = 0; i < ctx->nb_outputs; i++) {
-av_freep(&ctx->output_pads[i].name);
 if (movie->st[i].st)
 avcodec_free_context(&movie->st[i].codec_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".


[FFmpeg-cvslog] avfilter/vf_extractplanes: Free outpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [2142e719112d733b6eec9add8b2d30f6265a46a7] | 
committer: Andreas Rheinhardt

avfilter/vf_extractplanes: Free outpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_extractplanes.c | 14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/libavfilter/vf_extractplanes.c b/libavfilter/vf_extractplanes.c
index 54bfaeae5e..972cc17329 100644
--- a/libavfilter/vf_extractplanes.c
+++ b/libavfilter/vf_extractplanes.c
@@ -352,23 +352,13 @@ static av_cold int init(AVFilterContext *ctx)
 pad.type = AVMEDIA_TYPE_VIDEO;
 pad.config_props = config_output;
 
-if ((ret = ff_append_outpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_outpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
 }
 
-static av_cold void uninit(AVFilterContext *ctx)
-{
-int i;
-
-for (i = 0; i < ctx->nb_outputs; i++)
-av_freep(&ctx->output_pads[i].name);
-}
-
 static const AVFilterPad extractplanes_inputs[] = {
 {
 .name = "default",
@@ -384,7 +374,6 @@ const AVFilter ff_vf_extractplanes = {
 .priv_size = sizeof(ExtractPlanesContext),
 .priv_class= &extractplanes_class,
 .init  = init,
-.uninit= uninit,
 .query_formats = query_formats,
 FILTER_INPUTS(extractplanes_inputs),
 .outputs   = NULL,
@@ -408,7 +397,6 @@ const AVFilter ff_vf_alphaextract = {
   "grayscale image component."),
 .priv_size  = sizeof(ExtractPlanesContext),
 .init   = init_alphaextract,
-.uninit = uninit,
 .query_formats  = query_formats,
 FILTER_INPUTS(extractplanes_inputs),
 .outputs= NULL,

___
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_mergeplanes: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [0ba9089aec43818b30d688810771eee2609f7894] | 
committer: Andreas Rheinhardt

avfilter/vf_mergeplanes: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_mergeplanes.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/vf_mergeplanes.c b/libavfilter/vf_mergeplanes.c
index fe68c5c7e7..638a7065f2 100644
--- a/libavfilter/vf_mergeplanes.c
+++ b/libavfilter/vf_mergeplanes.c
@@ -96,10 +96,8 @@ static av_cold int init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_inpad(ctx, &pad)) < 0){
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
@@ -279,12 +277,8 @@ static int activate(AVFilterContext *ctx)
 static av_cold void uninit(AVFilterContext *ctx)
 {
 MergePlanesContext *s = ctx->priv;
-int i;
 
 ff_framesync_uninit(&s->fs);
-
-for (i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
 }
 
 static const AVFilterPad mergeplanes_outputs[] = {

___
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_mix: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [97c796176e4eee495eb1a5d1c4469cc9fc2d0bdc] | 
committer: Andreas Rheinhardt

avfilter/vf_mix: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_mix.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c
index a581dfc8ef..ce66202557 100644
--- a/libavfilter/vf_mix.c
+++ b/libavfilter/vf_mix.c
@@ -125,10 +125,8 @@ static av_cold int init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 }
 
@@ -304,10 +302,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 ff_framesync_uninit(&s->fs);
 av_freep(&s->weights);
 
-if (!s->tmix) {
-for (i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
-} else {
+if (s->tmix) {
 for (i = 0; i < s->nb_frames && s->frames; i++)
 av_frame_free(&s->frames[i]);
 }

___
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_program_opencl: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 23:44:55 2021 +0200| [65884bd81fe71fd4f29f3e7495f3970e482e7904] | 
committer: Andreas Rheinhardt

avfilter/vf_program_opencl: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_program_opencl.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_program_opencl.c b/libavfilter/vf_program_opencl.c
index d80aa9be04..fdc6b4dcd1 100644
--- a/libavfilter/vf_program_opencl.c
+++ b/libavfilter/vf_program_opencl.c
@@ -287,11 +287,9 @@ static av_cold int program_opencl_init(AVFilterContext 
*avctx)
 
 input.config_props = &ff_opencl_filter_config_input;
 
-err = ff_append_inpad(avctx, &input);
-if (err < 0) {
-av_freep(&input.name);
+err = ff_append_inpad_free_name(avctx, &input);
+if (err < 0)
 return err;
-}
 }
 }
 
@@ -302,14 +300,11 @@ static av_cold void program_opencl_uninit(AVFilterContext 
*avctx)
 {
 ProgramOpenCLContext *ctx = avctx->priv;
 cl_int cle;
-int i;
 
 if (ctx->nb_inputs > 0) {
 ff_framesync_uninit(&ctx->fs);
 
 av_freep(&ctx->frames);
-for (i = 0; i < avctx->nb_inputs; i++)
-av_freep(&avctx->input_pads[i].name);
 }
 
 if (ctx->kernel) {

___
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_xmedian: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [845579c6e2ee4c729a56c4daf819e5690d858570] | 
committer: Andreas Rheinhardt

avfilter/vf_xmedian: Free inpads' names generically

This affects only the xmedian filter, not tmedian.

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_xmedian.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavfilter/vf_xmedian.c b/libavfilter/vf_xmedian.c
index f900720012..f8e4e4adb2 100644
--- a/libavfilter/vf_xmedian.c
+++ b/libavfilter/vf_xmedian.c
@@ -118,10 +118,8 @@ static av_cold int init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
@@ -335,8 +333,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 
 ff_framesync_uninit(&s->fs);
 
-for (int i = 0; i < ctx->nb_inputs && !s->tmedian; i++)
-av_freep(&ctx->input_pads[i].name);
 for (int i = 0; i < s->nb_frames && s->frames && s->tmedian; i++)
 av_frame_free(&s->frames[i]);
 av_freep(&s->frames);

___
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_signature: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [07aacf5ea9467320fb4999293f7fa08b71c07300] | 
committer: Andreas Rheinhardt

avfilter/vf_signature: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_signature.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index b8339d7442..784869a7ae 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -664,10 +664,8 @@ static av_cold int init(AVFilterContext *ctx)
 
 if (!pad.name)
 return AVERROR(ENOMEM);
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 
 sc = &(sic->streamcontexts[i]);
 
@@ -730,8 +728,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 }
 av_freep(&sic->streamcontexts);
 }
-for (unsigned i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
 }
 
 static int config_output(AVFilterLink *outlink)

___
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_stack: Free inpads' names generically

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Wed Aug 11 22:02:44 2021 +0200| [ad3b1fddb3d3000d423b8eafec2fb977be8cc248] | 
committer: Andreas Rheinhardt

avfilter/vf_stack: Free inpads' names generically

Reviewed-by: Nicolas George 
Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/vf_stack.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavfilter/vf_stack.c b/libavfilter/vf_stack.c
index 8d3360169d..a87cffc491 100644
--- a/libavfilter/vf_stack.c
+++ b/libavfilter/vf_stack.c
@@ -123,10 +123,8 @@ static av_cold int init(AVFilterContext *ctx)
 if (!pad.name)
 return AVERROR(ENOMEM);
 
-if ((ret = ff_append_inpad(ctx, &pad)) < 0) {
-av_freep(&pad.name);
+if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
 return ret;
-}
 }
 
 return 0;
@@ -372,14 +370,10 @@ static int config_output(AVFilterLink *outlink)
 static av_cold void uninit(AVFilterContext *ctx)
 {
 StackContext *s = ctx->priv;
-int i;
 
 ff_framesync_uninit(&s->fs);
 av_freep(&s->frames);
 av_freep(&s->items);
-
-for (i = 0; i < ctx->nb_inputs; i++)
-av_freep(&ctx->input_pads[i].name);
 }
 
 static int activate(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".


[FFmpeg-cvslog] avcodec/vc1dec: ff_print_debug_info() does not support WMV3 field_mode

2021-08-22 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Aug  8 20:46:32 2021 +0200| [c59b5e3d1e0121ea23b5b326529f5bdca44cf982] | 
committer: Michael Niedermayer

avcodec/vc1dec: ff_print_debug_info() does not support WMV3 field_mode

Fixes: out of array read
Fixes: 
36331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5140494328922112.fuzz

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/vc1dec.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 1fb1950ade..335cd92953 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1151,12 +1151,14 @@ image:
 if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
 if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
 goto err;
-ff_print_debug_info(s, s->current_picture_ptr, pict);
+if (!v->field_mode)
+ff_print_debug_info(s, s->current_picture_ptr, pict);
 *got_frame = 1;
 } else if (s->last_picture_ptr) {
 if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
 goto err;
-ff_print_debug_info(s, s->last_picture_ptr, pict);
+if (!v->field_mode)
+ff_print_debug_info(s, s->last_picture_ptr, pict);
 *got_frame = 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] avcodec/h264dec: use picture parameters in ff_print_debug_info2()

2021-08-22 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Aug  8 21:23:31 2021 +0200| [65892516d52c268bd66ef825c4b1c8050a69d732] | 
committer: Michael Niedermayer

avcodec/h264dec: use picture parameters in ff_print_debug_info2()

Fixes: out of array read
Fixes: 
36341/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6737583085322240

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/h264dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 38f8967265..07ff9110d2 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -914,7 +914,7 @@ static int finalize_frame(H264Context *h, AVFrame *dst, 
H264Picture *out, int *g
  out->qscale_table,
  out->motion_val,
  NULL,
- h->mb_width, h->mb_height, h->mb_stride, 1);
+ out->mb_width, out->mb_height, 
out->mb_stride, 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] avcodec/webp: Check available space in loop in decode_entropy_coded_image()

2021-08-22 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Jul 25 15:50:54 2021 +0200| [5e00eab61112c52f27a09fe77d50e6fc508f9c53] | 
committer: Michael Niedermayer

avcodec/webp: Check available space in loop in decode_entropy_coded_image()

Fixes: Timeout
Fixes: 
35401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5714401821851648

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/webp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index 83371ef6fd..3efd4438d9 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -627,6 +627,9 @@ static int decode_entropy_coded_image(WebPContext *s, enum 
ImageRole role,
 while (y < img->frame->height) {
 int v;
 
+if (get_bits_left(&s->gb) < 0)
+return AVERROR_INVALIDDATA;
+
 hg = get_huffman_group(s, img, x, y);
 v = huff_reader_get_symbol(&hg[HUFF_IDX_GREEN], &s->gb);
 if (v < NUM_LITERAL_CODES) {

___
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/av1dec: Set position of AVPackets given to BSF

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Aug 22 04:03:15 2021 +0200| [8a805095c16553f5c50fbcb11d11d0f34376e038] | 
committer: Andreas Rheinhardt

avformat/av1dec: Set position of AVPackets given to BSF

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavformat/av1dec.c | 44 +++-
 1 file changed, 15 insertions(+), 29 deletions(-)

diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index f6c575069e..e021615c1f 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -22,7 +22,6 @@
 #include "config.h"
 
 #include "libavutil/common.h"
-#include "libavutil/fifo.h"
 #include "libavutil/opt.h"
 #include "libavcodec/av1_parse.h"
 #include "libavcodec/bsf.h"
@@ -299,7 +298,6 @@ typedef struct ObuContext {
 const AVClass *class;
 AVBSFContext *bsf;
 AVRational framerate;
-AVFifoBuffer *fifo;
 } ObuContext;
 
 //For low overhead obu, we can't foresee the obu size before we parsed the 
header.
@@ -372,9 +370,6 @@ static int obu_probe(const AVProbeData *p)
 static int obu_read_header(AVFormatContext *s)
 {
 ObuContext *c = s->priv_data;
-c->fifo = av_fifo_alloc(MAX_OBU_HEADER_SIZE);
-if (!c->fifo)
-return AVERROR(ENOMEM);
 return read_header(s, &c->framerate, &c->bsf, c);
 }
 
@@ -383,37 +378,26 @@ static int obu_get_packet(AVFormatContext *s, AVPacket 
*pkt)
 ObuContext *c = s->priv_data;
 uint8_t header[MAX_OBU_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
 int64_t obu_size;
-int size = av_fifo_space(c->fifo);
+int size;
 int ret, len, type;
 
-av_fifo_generic_write(c->fifo, s->pb, size,
-  (int (*)(void*, void*, int))avio_read);
-size = av_fifo_size(c->fifo);
-if (!size)
-return 0;
-
-av_fifo_generic_peek(c->fifo, header, size, NULL);
+if ((ret = ffio_ensure_seekback(s->pb, MAX_OBU_HEADER_SIZE)) < 0)
+return ret;
+size = avio_read(s->pb, header, MAX_OBU_HEADER_SIZE);
+if (size < 0)
+return size;
 
 len = read_obu_with_size(header, size, &obu_size, &type);
 if (len < 0) {
 av_log(c, AV_LOG_ERROR, "Failed to read obu\n");
 return len;
 }
+avio_seek(s->pb, -size, SEEK_CUR);
 
-ret = av_new_packet(pkt, len);
-if (ret < 0) {
-av_log(c, AV_LOG_ERROR, "Failed to allocate packet for obu\n");
-return ret;
-}
-size = FFMIN(size, len);
-av_fifo_generic_read(c->fifo, pkt->data, size, NULL);
-len -= size;
-if (len > 0) {
-ret = avio_read(s->pb, pkt->data + size, len);
-if (ret != len) {
-av_log(c, AV_LOG_ERROR, "Failed to read %d frome file\n", len);
-return ret < 0 ? ret : AVERROR_INVALIDDATA;
-}
+ret = av_get_packet(s->pb, pkt, len);
+if (ret != len) {
+av_log(c, AV_LOG_ERROR, "Failed to get packet for obu\n");
+return ret < 0 ? ret : AVERROR_INVALIDDATA;
 }
 return 0;
 }
@@ -425,7 +409,10 @@ static int obu_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 
 while (1) {
 ret = obu_get_packet(s, pkt);
-if (ret < 0)
+/* In case of AVERROR_EOF we need to flush the BSF. Conveniently
+ * obu_get_packet() returns a blank pkt in this case which
+ * can be used to signal that the BSF should be flushed. */
+if (ret < 0 && ret != AVERROR_EOF)
 return ret;
 ret = av_bsf_send_packet(c->bsf, pkt);
 if (ret < 0) {
@@ -448,7 +435,6 @@ static int obu_read_close(AVFormatContext *s)
 {
 ObuContext *c = s->priv_data;
 
-av_fifo_freep(&c->fifo);
 av_bsf_free(&c->bsf);
 return 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] avcodec/av1_frame_merge_bsf: Passthrough pos in case of no timestamps

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Aug 22 07:55:34 2021 +0200| [5a3385d49a765a9cf6d55ecc0826e48d2bf082de] | 
committer: Andreas Rheinhardt

avcodec/av1_frame_merge_bsf: Passthrough pos in case of no timestamps

This is needed by the AV1-Annex B and AV1-OBU demuxers.

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/av1_frame_merge_bsf.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/av1_frame_merge_bsf.c b/libavcodec/av1_frame_merge_bsf.c
index fce5bdb67e..19b9cd01a8 100644
--- a/libavcodec/av1_frame_merge_bsf.c
+++ b/libavcodec/av1_frame_merge_bsf.c
@@ -103,10 +103,15 @@ eof:
 err = AVERROR(EAGAIN);
 }
 
-// Buffer packets with timestamps. There should be at most one per TU, be 
it split or not.
-if (!buffer_pkt->data && in->pts != AV_NOPTS_VALUE)
+/* Buffer packets with timestamps (there should be at most one per TU)
+ * or any packet if buffer_pkt is empty. The latter is needed to
+ * passthrough positions in case there are no timestamps like with
+ * the raw OBU demuxer. */
+if (!buffer_pkt->data ||
+in->pts != AV_NOPTS_VALUE && buffer_pkt->pts == AV_NOPTS_VALUE) {
+av_packet_unref(buffer_pkt);
 av_packet_move_ref(buffer_pkt, in);
-else
+} else
 av_packet_unref(in);
 
 ff_cbs_fragment_reset(&ctx->frag[ctx->idx]);

___
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/av1dec: Deduplicate Annex B and low overhead OBU AV1 demuxer

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Aug 22 04:34:29 2021 +0200| [172116fd5d1a5bc155f7c12c98defdf848cd100c] | 
committer: Andreas Rheinhardt

avformat/av1dec: Deduplicate Annex B and low overhead OBU AV1 demuxer

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavformat/av1dec.c | 133 ++-
 1 file changed, 47 insertions(+), 86 deletions(-)

diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index e021615c1f..d5d4548d8b 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -29,6 +29,14 @@
 #include "avio_internal.h"
 #include "internal.h"
 
+typedef struct AV1DemuxContext {
+const AVClass *class;
+AVBSFContext *bsf;
+AVRational framerate;
+uint32_t temporal_unit_size;
+uint32_t frame_unit_size;
+} AV1DemuxContext;
+
 //return < 0 if we need more data
 static int get_score(int type, int *seq)
 {
@@ -48,14 +56,15 @@ static int get_score(int type, int *seq)
 return 0;
 }
 
-static int read_header(AVFormatContext *s, const AVRational *framerate, 
AVBSFContext **bsf, void *logctx)
+static int av1_read_header(AVFormatContext *s)
 {
+AV1DemuxContext *const c = s->priv_data;
 const AVBitStreamFilter *filter = av_bsf_get_by_name("av1_frame_merge");
 AVStream *st;
 int ret;
 
 if (!filter) {
-av_log(logctx, AV_LOG_ERROR, "av1_frame_merge bitstream filter "
+av_log(s, AV_LOG_ERROR, "av1_frame_merge bitstream filter "
"not found. This is a bug, please report it.\n");
 return AVERROR_BUG;
 }
@@ -68,35 +77,49 @@ static int read_header(AVFormatContext *s, const AVRational 
*framerate, AVBSFCon
 st->codecpar->codec_id = AV_CODEC_ID_AV1;
 st->internal->need_parsing = AVSTREAM_PARSE_HEADERS;
 
-st->internal->avctx->framerate = *framerate;
+st->internal->avctx->framerate = c->framerate;
 // taken from rawvideo demuxers
 avpriv_set_pts_info(st, 64, 1, 120);
 
-ret = av_bsf_alloc(filter, bsf);
+ret = av_bsf_alloc(filter, &c->bsf);
 if (ret < 0)
 return ret;
 
-ret = avcodec_parameters_copy((*bsf)->par_in, st->codecpar);
+ret = avcodec_parameters_copy(c->bsf->par_in, st->codecpar);
 if (ret < 0)
 return ret;
 
-ret = av_bsf_init(*bsf);
+ret = av_bsf_init(c->bsf);
 if (ret < 0)
 return ret;
 
 return 0;
 }
 
+static int av1_read_close(AVFormatContext *s)
+{
+AV1DemuxContext *const c = s->priv_data;
+
+av_bsf_free(&c->bsf);
+return 0;
+}
+
 #define DEC AV_OPT_FLAG_DECODING_PARAM
+#define OFFSET(x) offsetof(AV1DemuxContext, x)
+static const AVOption av1_options[] = {
+{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = 
"25"}, 0, INT_MAX, DEC},
+{ NULL },
+};
+#undef OFFSET
+
+static const AVClass av1_demuxer_class = {
+.class_name = "AV1 Annex B/low overhead OBU demuxer",
+.item_name  = av_default_item_name,
+.option = av1_options,
+.version= LIBAVUTIL_VERSION_INT,
+};
 
 #if CONFIG_AV1_DEMUXER
-typedef struct AnnexBContext {
-const AVClass *class;
-AVBSFContext *bsf;
-uint32_t temporal_unit_size;
-uint32_t frame_unit_size;
-AVRational framerate;
-} AnnexBContext;
 
 static int leb(AVIOContext *pb, uint32_t *len) {
 int more, i = 0;
@@ -193,15 +216,9 @@ static int annexb_probe(const AVProbeData *p)
 return 0;
 }
 
-static int annexb_read_header(AVFormatContext *s)
-{
-AnnexBContext *c = s->priv_data;
-return read_header(s, &c->framerate, &c->bsf, c);
-}
-
 static int annexb_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-AnnexBContext *c = s->priv_data;
+AV1DemuxContext *const c = s->priv_data;
 uint32_t obu_unit_size;
 int ret, len;
 
@@ -256,50 +273,22 @@ end:
 return ret;
 }
 
-static int annexb_read_close(AVFormatContext *s)
-{
-AnnexBContext *c = s->priv_data;
-
-av_bsf_free(&c->bsf);
-return 0;
-}
-
-#define OFFSET(x) offsetof(AnnexBContext, x)
-static const AVOption annexb_options[] = {
-{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = 
"25"}, 0, INT_MAX, DEC},
-{ NULL },
-};
-#undef OFFSET
-
-static const AVClass annexb_demuxer_class = {
-.class_name = "AV1 Annex B demuxer",
-.item_name  = av_default_item_name,
-.option = annexb_options,
-.version= LIBAVUTIL_VERSION_INT,
-};
-
 const AVInputFormat ff_av1_demuxer = {
 .name   = "av1",
 .long_name  = NULL_IF_CONFIG_SMALL("AV1 Annex B"),
-.priv_data_size = sizeof(AnnexBContext),
+.priv_data_size = sizeof(AV1DemuxContext),
 .flags_internal = FF_FMT_INIT_CLEANUP,
 .read_probe = annexb_probe,
-.read_header= annexb_read_header,
+.read_header= av1_read_header,
 .read_packet= annexb_read_packet,
-.read_close = annexb_read_close,
+.read_close = av

[FFmpeg-cvslog] avformat/utils: Also set io_repositioned for generic seeking

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Aug 22 08:27:01 2021 +0200| [4d200342a7d512dbe91c1820ee82fc3aaf4b644d] | 
committer: Andreas Rheinhardt

avformat/utils: Also set io_repositioned for generic seeking

It allows demuxers to perform certain tasks after
a successful generic seek.

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavformat/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5754fc1537..39f082d98d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2354,10 +2354,12 @@ static int seek_frame_generic(AVFormatContext *s, int 
stream_index,
 ie = &st->internal->index_entries[st->internal->nb_index_entries - 
1];
 if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
 return ret;
+s->io_repositioned = 1;
 avpriv_update_cur_dts(s, st, ie->timestamp);
 } else {
 if ((ret = avio_seek(s->pb, s->internal->data_offset, SEEK_SET)) < 
0)
 return ret;
+s->io_repositioned = 1;
 }
 av_packet_unref(pkt);
 for (;;) {
@@ -2392,6 +2394,7 @@ static int seek_frame_generic(AVFormatContext *s, int 
stream_index,
 ie = &st->internal->index_entries[index];
 if ((ret = avio_seek(s->pb, ie->pos, SEEK_SET)) < 0)
 return ret;
+s->io_repositioned = 1;
 avpriv_update_cur_dts(s, st, ie->timestamp);
 
 return 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] avformat/av1dec: Flush BSF upon seeking

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Aug 22 11:18:56 2021 +0200| [3f938cd46a8ae1e66569ec322e8ad56c055726a6] | 
committer: Andreas Rheinhardt

avformat/av1dec: Flush BSF upon seeking

The av1_merge_frame BSF outputs its cached data when it sees the
beginning of a new frame, i.e. when it sees a temporal delimiter OBU.
Therefore it typically has a temporal delimiter OBU cached after
outputting a packet.

This implies that the OBU demuxer must flush its BSF upon seeking
because otherwise the first frame returned after a seek consists
of an old temporal delimiter OBU only.

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavformat/av1dec.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index d5d4548d8b..88a3c325e4 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -390,6 +390,10 @@ static int obu_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 AV1DemuxContext *const c = s->priv_data;
 int ret;
 
+if (s->io_repositioned) {
+av_bsf_flush(c->bsf);
+s->io_repositioned = 0;
+}
 while (1) {
 ret = obu_get_packet(s, pkt);
 /* In case of AVERROR_EOF we need to flush the BSF. Conveniently

___
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/av1dec: Disallow seeking by bytes

2021-08-22 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Aug 22 15:10:35 2021 +0200| [0383ec88a56dcad7b2e87ff243f26d3287ba3fdb] | 
committer: Andreas Rheinhardt

avformat/av1dec: Disallow seeking by bytes

The low overhead OBU format provides no means to resync after performing
a byte-based seek; in other words: Byte based seeking is just not
supported.

Reviewed-by: James Almer 
Signed-off-by: Andreas Rheinhardt 

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

 libavformat/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index 88a3c325e4..37f21483b9 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -428,7 +428,7 @@ const AVInputFormat ff_obu_demuxer = {
 .read_packet= obu_read_packet,
 .read_close = av1_read_close,
 .extensions = "obu",
-.flags  = AVFMT_GENERIC_INDEX,
+.flags  = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK,
 .priv_class = &av1_demuxer_class,
 };
 #endif

___
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".