summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-03 20:34:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-04 23:22:54 +0200
commit82a33c8d858498fc4e0b8ab93ad323a05dfd5168 (patch)
treea6b3a17bbf86daec3abc146544a9889a64ec1e3c /libavformat/utils.c
parentbe63ef3c4e6399a3ef8d22cc25e9cb3575cf74ae (diff)
avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLE
This will be used to allow writing file sequences using the tee output onto multiple places in parallel Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5a902ea8b0..6b7609ecd2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4315,7 +4315,7 @@ uint64_t ff_ntp_time(void)
return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
}
-int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
+int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number, int flags)
{
const char *p;
char *q, buf1[20], c;
@@ -4340,7 +4340,7 @@ int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
case '%':
goto addchar;
case 'd':
- if (percentd_found)
+ if (!(flags & AV_FRAME_FILENAME_FLAGS_MULTIPLE) && percentd_found)
goto fail;
percentd_found = 1;
if (number < 0)
@@ -4370,6 +4370,11 @@ fail:
return -1;
}
+int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
+{
+ return av_get_frame_filename2(buf, buf_size, path, number, 0);
+}
+
void av_url_split(char *proto, int proto_size,
char *authorization, int authorization_size,
char *hostname, int hostname_size,