The branch, master has been updated
via 7321e4b9508685ebede5d6f1ef37a4a00944715e (commit)
via 8703dd74bd04866ad885a9f76d79ed9b40afa282 (commit)
via 69d9c074ef6679717f60c1420f0c75e626d5b9ea (commit)
via 8c1301cf9d224c211d1d3c104bca533424369f3a (commit)
via 35ceef40ad9ba882049a82f7dcba455c9ce07db5 (commit)
via 4b8be1991c8f4675e93d3091e3469b293800695c (commit)
via 9458a6f8ec2a8048fa1d672b6b27fcc56fd14cb1 (commit)
from 7a1c737c359509f59c8552e79b2fa6a191d61ad9 (commit)
- Log -----------------------------------------------------------------
commit 7321e4b9508685ebede5d6f1ef37a4a00944715e
Author: Marton Balint <[email protected]>
AuthorDate: Sun Aug 17 23:50:09 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/img2dec: support arbitrary path lengths
Signed-off-by: Marton Balint <[email protected]>
diff --git a/libavformat/img2.h b/libavformat/img2.h
index 0781e681c5..6da9e47a97 100644
--- a/libavformat/img2.h
+++ b/libavformat/img2.h
@@ -46,7 +46,6 @@ typedef struct VideoDemuxData {
int img_count;
int is_pipe;
int split_planes; /**< use independent file for each Y, U, V plane */
- char path[1024];
char *pixel_format; /**< Set by a private option. */
int width, height; /**< Set by a private option. */
AVRational framerate; /**< Set by a private option. */
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 1ccdeb9aa3..789f8b94c9 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -188,7 +188,6 @@ int ff_img_read_header(AVFormatContext *s1)
return AVERROR(EINVAL);
}
- av_strlcpy(s->path, s1->url, sizeof(s->path));
s->img_number = 0;
s->img_count = 0;
@@ -226,22 +225,22 @@ int ff_img_read_header(AVFormatContext *s1)
s->pattern_type = PT_SEQUENCE;
}
if (s->pattern_type == PT_SEQUENCE) {
- if (find_image_range(&first_index, &last_index, s->path,
+ if (find_image_range(&first_index, &last_index, s1->url,
s->start_number, s->start_number_range) < 0) {
- if (s1->pb || avio_check(s->path, AVIO_FLAG_READ) > 0) {
+ if (s1->pb || avio_check(s1->url, AVIO_FLAG_READ) > 0) {
// Fallback to normal mode
s->pattern_type = PT_NONE;
} else {
av_log(s1, AV_LOG_ERROR,
"Could find no file or sequence with path '%s' and
index in the range %d-%d\n",
- s->path, s->start_number, s->start_number +
s->start_number_range - 1);
+ s1->url, s->start_number, s->start_number +
s->start_number_range - 1);
return AVERROR(ENOENT);
}
}
} else if (s->pattern_type == PT_GLOB) {
#if HAVE_GLOB
int gerr;
- gerr = glob(s->path, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL,
&s->globstate);
+ gerr = glob(s1->url, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL,
&s->globstate);
if (gerr != 0) {
return AVERROR(ENOENT);
}
@@ -279,7 +278,7 @@ int ff_img_read_header(AVFormatContext *s1)
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
st->codecpar->codec_id = ffifmt(s1->iformat)->raw_codec_id;
} else {
- const char *str = strrchr(s->path, '.');
+ const char *str = strrchr(s1->url, '.');
s->split_planes = str && !av_strcasecmp(str + 1, "y");
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
if (s1->pb) {
@@ -322,7 +321,7 @@ int ff_img_read_header(AVFormatContext *s1)
ffio_rewind_with_probe_data(s1->pb, &probe_buffer,
probe_buffer_size);
}
if (st->codecpar->codec_id == AV_CODEC_ID_NONE)
- st->codecpar->codec_id = ff_guess_image2_codec(s->path);
+ st->codecpar->codec_id = ff_guess_image2_codec(s1->url);
if (st->codecpar->codec_id == AV_CODEC_ID_LJPEG)
st->codecpar->codec_id = AV_CODEC_ID_MJPEG;
if (st->codecpar->codec_id == AV_CODEC_ID_ALIAS_PIX) // we cannot
distinguish this from BRENDER_PIX
@@ -364,13 +363,13 @@ static int add_filename_as_pkt_side_data(char *filename,
AVPacket *pkt) {
int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
{
VideoDemuxData *s = s1->priv_data;
- char filename_bytes[1024];
- char *filename = filename_bytes;
+ AVBPrint filename;
int i, res;
int size[3] = { 0 }, ret[3] = { 0 };
AVIOContext *f[3] = { NULL };
AVCodecParameters *par = s1->streams[0]->codecpar;
+ av_bprint_init(&filename, 0, AV_BPRINT_SIZE_UNLIMITED);
if (!s->is_pipe) {
/* loop over input */
if (s->loop && s->img_number > s->img_last) {
@@ -379,36 +378,43 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if (s->img_number > s->img_last)
return AVERROR_EOF;
if (s->pattern_type == PT_NONE) {
- av_strlcpy(filename_bytes, s->path, sizeof(filename_bytes));
+ av_bprintf(&filename, "%s", s1->url);
} else if (s->use_glob) {
#if HAVE_GLOB
- filename = s->globstate.gl_pathv[s->img_number];
+ av_bprintf(&filename, "%s", s->globstate.gl_pathv[s->img_number]);
#endif
} else {
- if (av_get_frame_filename(filename_bytes, sizeof(filename_bytes),
- s->path,
- s->img_number) < 0)
- return AVERROR(EIO);
+ int ret = ff_bprint_get_frame_filename(&filename, s1->url,
s->img_number, 0);
+ if (ret < 0) {
+ av_bprint_finalize(&filename, NULL);
+ return ret;
+ }
+ }
+ if (!av_bprint_is_complete(&filename)) {
+ av_bprint_finalize(&filename, NULL);
+ return AVERROR(ENOMEM);
}
for (i = 0; i < 3; i++) {
if (s1->pb &&
- !strcmp(filename_bytes, s->path) &&
+ !strcmp(filename.str, s1->url) &&
!s->loop &&
!s->split_planes) {
f[i] = s1->pb;
- } else if (s1->io_open(s1, &f[i], filename, AVIO_FLAG_READ, NULL)
< 0) {
+ } else if (s1->io_open(s1, &f[i], filename.str, AVIO_FLAG_READ,
NULL) < 0) {
if (i >= 1)
break;
av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",
- filename);
+ filename.str);
+ av_bprint_finalize(&filename, NULL);
return AVERROR(EIO);
}
size[i] = avio_size(f[i]);
if (!s->split_planes)
break;
- filename[strlen(filename) - 1] = 'U' + i;
+ filename.str[filename.len - 1] = 'U' + i;
}
+ av_bprint_finalize(&filename, NULL);
if (par->codec_id == AV_CODEC_ID_NONE) {
AVProbeData pd = { 0 };
@@ -418,13 +424,15 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
int score = 0;
ret = avio_read(f[0], header, PROBE_BUF_MIN);
- if (ret < 0)
+ if (ret < 0) {
+ av_bprint_finalize(&filename, NULL);
return ret;
+ }
memset(header + ret, 0, sizeof(header) - ret);
avio_skip(f[0], -ret);
pd.buf = header;
pd.buf_size = ret;
- pd.filename = filename;
+ pd.filename = filename.str;
ifmt = ffifmt(av_probe_input_format3(&pd, 1, &score));
if (ifmt && ifmt->read_packet == ff_img_read_packet &&
ifmt->raw_codec_id)
@@ -457,7 +465,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if (s->ts_from_file) {
struct stat img_stat;
av_assert0(!s->is_pipe); // The ts_from_file option is not supported
by piped input demuxers
- if (stat(filename, &img_stat)) {
+ if (stat(filename.str, &img_stat)) {
res = AVERROR(EIO);
goto fail;
}
@@ -480,10 +488,11 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
* as packet side_data.
*/
if (!s->is_pipe && s->export_path_metadata == 1) {
- res = add_filename_as_pkt_side_data(filename, pkt);
+ res = add_filename_as_pkt_side_data(filename.str, pkt);
if (res < 0)
goto fail;
}
+ av_bprint_finalize(&filename, NULL);
pkt->size = 0;
for (i = 0; i < 3; i++) {
@@ -522,6 +531,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
}
fail:
+ av_bprint_finalize(&filename, NULL);
if (!s->is_pipe) {
for (i = 0; i < 3; i++) {
if (f[i] != s1->pb)
commit 8703dd74bd04866ad885a9f76d79ed9b40afa282
Author: Marton Balint <[email protected]>
AuthorDate: Sun Aug 17 23:08:26 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/img2dec: remove path limits from find_image_range
Signed-off-by: Marton Balint <[email protected]>
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 3170132b08..1ccdeb9aa3 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -27,6 +27,7 @@
#include <sys/stat.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
@@ -96,18 +97,23 @@ static int infer_size(int *width_ptr, int *height_ptr, int
size)
static int find_image_range(int *pfirst_index, int *plast_index,
const char *path, int start_index, int
start_index_range)
{
- char buf[1024];
- int range, last_index, range1, first_index;
+ int range, last_index, range1, first_index, ret;
+ AVBPrint filename;
+ av_bprint_init(&filename, 0, AV_BPRINT_SIZE_UNLIMITED);
/* find the first image */
for (first_index = start_index; first_index < start_index +
start_index_range; first_index++) {
- if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0)
- return -1;
- if (avio_check(buf, AVIO_FLAG_READ) > 0)
+ av_bprint_clear(&filename);
+ ret = ff_bprint_get_frame_filename(&filename, path, first_index, 0);
+ if (ret < 0)
+ goto fail;
+ if (avio_check(filename.str, AVIO_FLAG_READ) > 0)
break;
}
- if (first_index == start_index + start_index_range)
+ if (first_index == start_index + start_index_range) {
+ ret = AVERROR(EINVAL);
goto fail;
+ }
/* find the last image */
last_index = first_index;
@@ -118,15 +124,18 @@ static int find_image_range(int *pfirst_index, int
*plast_index,
range1 = 1;
else
range1 = 2 * range;
- if (av_get_frame_filename(buf, sizeof(buf), path,
- last_index + range1) < 0)
+ av_bprint_clear(&filename);
+ ret = ff_bprint_get_frame_filename(&filename, path, last_index +
range1, 0);
+ if (ret < 0)
goto fail;
- if (avio_check(buf, AVIO_FLAG_READ) <= 0)
+ if (avio_check(filename.str, AVIO_FLAG_READ) <= 0)
break;
range = range1;
/* just in case... */
- if (range >= (1 << 30))
+ if (range >= (1 << 30)) {
+ ret = AVERROR(EINVAL);
goto fail;
+ }
}
/* we are sure than image last_index + range exists */
if (!range)
@@ -135,10 +144,10 @@ static int find_image_range(int *pfirst_index, int
*plast_index,
}
*pfirst_index = first_index;
*plast_index = last_index;
- return 0;
-
+ ret = 0;
fail:
- return -1;
+ av_bprint_finalize(&filename, NULL);
+ return ret;
}
static int img_read_probe(const AVProbeData *p)
commit 69d9c074ef6679717f60c1420f0c75e626d5b9ea
Author: Marton Balint <[email protected]>
AuthorDate: Wed Aug 13 22:37:11 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/img2dec: do not use av_get_frame_filename result buffer if the
call fails
We have no way of knowing if the string was fully processed or got truncated
because of a parse error so it is better to use the original path if
finding an
image sequence fails.
We do this by explicitly falling back to the PT_NONE mode if the provided
filename is not a valid pattern but the file exists or if the IO context is
already open.
This also means that filenames no longer need to be escaped even in sequence
mode if an invalid sequence (a sequence without %d) is provided, so a
command
line such as ffmpeg -f image2 -i "100%.jpg" will just work, but "100%%.jpg"
will no longer work.
Signed-off-by: Marton Balint <[email protected]>
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index a3f4ef14fa..3170132b08 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -93,7 +93,7 @@ static int infer_size(int *width_ptr, int *height_ptr, int
size)
* @param start_index minimum accepted value for the first index in the range
* @return -1 if no image file could be found
*/
-static int find_image_range(AVIOContext *pb, int *pfirst_index, int
*plast_index,
+static int find_image_range(int *pfirst_index, int *plast_index,
const char *path, int start_index, int
start_index_range)
{
char buf[1024];
@@ -101,13 +101,8 @@ static int find_image_range(AVIOContext *pb, int
*pfirst_index, int *plast_index
/* find the first image */
for (first_index = start_index; first_index < start_index +
start_index_range; first_index++) {
- if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0) {
- *pfirst_index =
- *plast_index = 1;
- if (pb || avio_check(buf, AVIO_FLAG_READ) > 0)
- return 0;
+ if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0)
return -1;
- }
if (avio_check(buf, AVIO_FLAG_READ) > 0)
break;
}
@@ -222,12 +217,17 @@ int ff_img_read_header(AVFormatContext *s1)
s->pattern_type = PT_SEQUENCE;
}
if (s->pattern_type == PT_SEQUENCE) {
- if (find_image_range(s1->pb, &first_index, &last_index, s->path,
+ if (find_image_range(&first_index, &last_index, s->path,
s->start_number, s->start_number_range) < 0) {
- av_log(s1, AV_LOG_ERROR,
- "Could find no file with path '%s' and index in the
range %d-%d\n",
- s->path, s->start_number, s->start_number +
s->start_number_range - 1);
- return AVERROR(ENOENT);
+ if (s1->pb || avio_check(s->path, AVIO_FLAG_READ) > 0) {
+ // Fallback to normal mode
+ s->pattern_type = PT_NONE;
+ } else {
+ av_log(s1, AV_LOG_ERROR,
+ "Could find no file or sequence with path '%s' and
index in the range %d-%d\n",
+ s->path, s->start_number, s->start_number +
s->start_number_range - 1);
+ return AVERROR(ENOENT);
+ }
}
} else if (s->pattern_type == PT_GLOB) {
#if HAVE_GLOB
@@ -378,7 +378,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
} else {
if (av_get_frame_filename(filename_bytes, sizeof(filename_bytes),
s->path,
- s->img_number) < 0 && s->img_number > 1)
+ s->img_number) < 0)
return AVERROR(EIO);
}
for (i = 0; i < 3; i++) {
commit 8c1301cf9d224c211d1d3c104bca533424369f3a
Author: Marton Balint <[email protected]>
AuthorDate: Mon Aug 18 00:02:22 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/webm_chunk: support for arbitrary path lengths
Signed-off-by: Marton Balint <[email protected]>
diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 255b8697c5..57329f1788 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -30,13 +30,12 @@
#include "internal.h"
#include "mux.h"
+#include "libavutil/bprint.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
-#define MAX_FILENAME_SIZE 1024
-
typedef struct WebMChunkContext {
const AVClass *class;
char *header_filename;
@@ -133,16 +132,13 @@ fail:
return 0;
}
-static int get_chunk_filename(AVFormatContext *s, char
filename[MAX_FILENAME_SIZE])
+static int get_chunk_filename(AVFormatContext *s, AVBPrint *filename)
{
WebMChunkContext *wc = s->priv_data;
- if (!filename) {
- return AVERROR(EINVAL);
- }
- if (av_get_frame_filename(filename, MAX_FILENAME_SIZE,
- s->url, wc->chunk_index - 1) < 0) {
+ int ret = ff_bprint_get_frame_filename(filename, s->url, wc->chunk_index -
1, 0);
+ if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Invalid chunk filename template '%s'\n",
s->url);
- return AVERROR(EINVAL);
+ return ret;
}
return 0;
}
@@ -185,7 +181,7 @@ static int chunk_end(AVFormatContext *s, int flush)
int buffer_size;
uint8_t *buffer;
AVIOContext *pb;
- char filename[MAX_FILENAME_SIZE];
+ AVBPrint filename;
AVDictionary *options = NULL;
if (!oc->pb)
@@ -196,19 +192,21 @@ static int chunk_end(AVFormatContext *s, int flush)
av_write_frame(oc, NULL);
buffer_size = avio_close_dyn_buf(oc->pb, &buffer);
oc->pb = NULL;
- ret = get_chunk_filename(s, filename);
+ av_bprint_init(&filename, 0, AV_BPRINT_SIZE_UNLIMITED);
+ ret = get_chunk_filename(s, &filename);
if (ret < 0)
goto fail;
if (wc->http_method)
if ((ret = av_dict_set(&options, "method", wc->http_method, 0)) < 0)
goto fail;
- ret = s->io_open(s, &pb, filename, AVIO_FLAG_WRITE, &options);
+ ret = s->io_open(s, &pb, filename.str, AVIO_FLAG_WRITE, &options);
av_dict_free(&options);
if (ret < 0)
goto fail;
avio_write(pb, buffer, buffer_size);
ff_format_io_close(s, &pb);
fail:
+ av_bprint_finalize(&filename, NULL);
av_free(buffer);
return (ret < 0) ? ret : 0;
}
commit 35ceef40ad9ba882049a82f7dcba455c9ce07db5
Author: Marton Balint <[email protected]>
AuthorDate: Sun Aug 17 20:39:09 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/segment: support arbitrary path lengths
Signed-off-by: Marton Balint <[email protected]>
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 05383de841..2c7ba0e776 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -38,6 +38,7 @@
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
#include "libavutil/parseutils.h"
#include "libavutil/mathematics.h"
#include "libavutil/time.h"
@@ -122,7 +123,7 @@ typedef struct SegmentContext {
int write_empty;
int use_rename;
- char temp_list_filename[1024];
+ char *temp_list_filename;
SegmentListEntry cur_entry;
SegmentListEntry *segment_list_entries;
@@ -191,9 +192,10 @@ static int set_segment_filename(AVFormatContext *s)
AVFormatContext *oc = seg->avf;
size_t size;
int ret;
- char buf[1024];
+ AVBPrint filename;
char *new_name;
+ av_bprint_init(&filename, 0, AV_BPRINT_SIZE_UNLIMITED);
if (seg->segment_idx_wrap)
seg->segment_idx %= seg->segment_idx_wrap;
if (seg->use_strftime) {
@@ -201,18 +203,22 @@ static int set_segment_filename(AVFormatContext *s)
struct tm *tm, tmpbuf;
time(&now0);
tm = localtime_r(&now0, &tmpbuf);
- if (!strftime(buf, sizeof(buf), s->url, tm)) {
- av_log(oc, AV_LOG_ERROR, "Could not get segment filename with
strftime\n");
- return AVERROR(EINVAL);
+ av_bprint_strftime(&filename, s->url, tm);
+ if (!av_bprint_is_complete(&filename)) {
+ av_bprint_finalize(&filename, NULL);
+ return AVERROR(ENOMEM);
+ }
+ } else {
+ ret = ff_bprint_get_frame_filename(&filename, s->url,
seg->segment_idx, 0);
+ if (ret < 0) {
+ av_bprint_finalize(&filename, NULL);
+ av_log(oc, AV_LOG_ERROR, "Invalid segment filename template
'%s'\n", s->url);
+ return ret;
}
- } else if (av_get_frame_filename(buf, sizeof(buf),
- s->url, seg->segment_idx) < 0) {
- av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s'\n",
s->url);
- return AVERROR(EINVAL);
}
- new_name = av_strdup(buf);
- if (!new_name)
- return AVERROR(ENOMEM);
+ ret = av_bprint_finalize(&filename, &new_name);
+ if (ret < 0)
+ return ret;
ff_format_set_url(oc, new_name);
/* copy modified name in list entry */
@@ -279,7 +285,10 @@ static int segment_list_open(AVFormatContext *s)
SegmentContext *seg = s->priv_data;
int ret;
- snprintf(seg->temp_list_filename, sizeof(seg->temp_list_filename),
seg->use_rename ? "%s.tmp" : "%s", seg->list);
+ av_freep(&seg->temp_list_filename);
+ seg->temp_list_filename = av_asprintf(seg->use_rename ? "%s.tmp" : "%s",
seg->list);
+ if (!seg->temp_list_filename)
+ return AVERROR(ENOMEM);
ret = s->io_open(s, &seg->list_pb, seg->temp_list_filename,
AVIO_FLAG_WRITE, NULL);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Failed to open segment list '%s'\n",
seg->list);
@@ -659,6 +668,7 @@ static void seg_free(AVFormatContext *s)
av_freep(&seg->times);
av_freep(&seg->frames);
av_freep(&seg->cur_entry.filename);
+ av_freep(&seg->temp_list_filename);
cur = seg->segment_list_entries;
while (cur) {
commit 4b8be1991c8f4675e93d3091e3469b293800695c
Author: Marton Balint <[email protected]>
AuthorDate: Thu Aug 14 23:49:34 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/utils: support arbitrary path lengths for av_filename_number_test
Signed-off-by: Marton Balint <[email protected]>
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9b29ae26d0..3573aa918e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -116,9 +116,12 @@ int av_append_packet(AVIOContext *s, AVPacket *pkt, int
size)
int av_filename_number_test(const char *filename)
{
- char buf[1024];
- return filename &&
- (av_get_frame_filename(buf, sizeof(buf), filename, 1) >= 0);
+ AVBPrint bp;
+
+ if (!filename)
+ return 0;
+ av_bprint_init(&bp, 0, AV_BPRINT_SIZE_COUNT_ONLY);
+ return (ff_bprint_get_frame_filename(&bp, filename, 1,
AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION) >= 0);
}
/**********************************************************/
commit 9458a6f8ec2a8048fa1d672b6b27fcc56fd14cb1
Author: Marton Balint <[email protected]>
AuthorDate: Wed Aug 27 08:36:39 2025 +0200
Commit: Marton Balint <[email protected]>
CommitDate: Fri Sep 5 21:05:13 2025 +0200
avformat/utils: add AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION flag
Signed-off-by: Marton Balint <[email protected]>
diff --git a/doc/APIchanges b/doc/APIchanges
index d69aaf2215..5b07848c0a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
+2025-09-xx - xxxxxxxx - lavf 62.5.100 - avformat.h
+ Add AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION
+
2025-09-xx - xxxxxxxxxx - lavu 60.12.100 - hwcontext_d3d12va.h
Add support for texture array mode AVD3D12VAFrame.subresource_index,
AVD3D12VAFramesContext.texture_array
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index be6e532387..a7446546e5 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2819,7 +2819,8 @@ void av_dump_format(AVFormatContext *ic,
int is_output);
-#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d
+#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d
+#define AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION 2 ///< Ignore truncated
output instead of returning an error
/**
* Return in 'buf' the path with '%d' replaced by a number.
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8a249ad85a..9b29ae26d0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -327,7 +327,7 @@ addchar:
}
if (!percentd_found)
goto fail;
- if (!av_bprint_is_complete(buf))
+ if (!(flags & AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION) &&
!av_bprint_is_complete(buf))
return AVERROR(ENOMEM);
return 0;
fail:
diff --git a/libavformat/version.h b/libavformat/version.h
index 858a94cc5d..e2634b85ae 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,8 +31,8 @@
#include "version_major.h"
-#define LIBAVFORMAT_VERSION_MINOR 4
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MINOR 5
+#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-----------------------------------------------------------------------
Summary of changes:
doc/APIchanges | 3 ++
libavformat/avformat.h | 3 +-
libavformat/img2.h | 1 -
libavformat/img2dec.c | 107 ++++++++++++++++++++++++++++-------------------
libavformat/segment.c | 36 ++++++++++------
libavformat/utils.c | 11 +++--
libavformat/version.h | 4 +-
libavformat/webm_chunk.c | 22 +++++-----
8 files changed, 110 insertions(+), 77 deletions(-)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]