Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
61e2e296
Commit
61e2e296
authored
Sep 03, 2011
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
av_string: add av_asprintf().
parent
1889c672
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
APIchanges
doc/APIchanges
+3
-0
avstring.c
libavutil/avstring.c
+26
-0
avstring.h
libavutil/avstring.h
+10
-0
avutil.h
libavutil/avutil.h
+1
-1
No files found.
doc/APIchanges
View file @
61e2e296
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
API changes, most recent first:
2011-09-xx - xxxxxxx - lavu 51.16.0
Add av_asprintf().
2011-08-22 - dacd827 - lavf 53.10.0
2011-08-22 - dacd827 - lavf 53.10.0
Add av_find_program_from_stream().
Add av_find_program_from_stream().
...
...
libavutil/avstring.c
View file @
61e2e296
...
@@ -91,6 +91,32 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
...
@@ -91,6 +91,32 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
return
len
;
return
len
;
}
}
char
*
av_asprintf
(
const
char
*
fmt
,
...)
{
char
*
p
=
NULL
;
va_list
va
;
int
len
;
va_start
(
va
,
fmt
);
len
=
vsnprintf
(
NULL
,
0
,
fmt
,
va
);
va_end
(
va
);
if
(
len
<
0
)
goto
end
;
p
=
av_malloc
(
len
+
1
);
if
(
!
p
)
goto
end
;
va_start
(
va
,
fmt
);
len
=
vsnprintf
(
p
,
len
+
1
,
fmt
,
va
);
va_end
(
va
);
if
(
len
<
0
)
av_freep
(
&
p
);
end:
return
p
;
}
char
*
av_d2str
(
double
d
)
char
*
av_d2str
(
double
d
)
{
{
char
*
str
=
av_malloc
(
16
);
char
*
str
=
av_malloc
(
16
);
...
...
libavutil/avstring.h
View file @
61e2e296
...
@@ -110,6 +110,16 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
...
@@ -110,6 +110,16 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
*/
*/
size_t
av_strlcatf
(
char
*
dst
,
size_t
size
,
const
char
*
fmt
,
...)
av_printf_format
(
3
,
4
);
size_t
av_strlcatf
(
char
*
dst
,
size_t
size
,
const
char
*
fmt
,
...)
av_printf_format
(
3
,
4
);
/**
* Print arguments following specified format into a large enough auto
* allocated buffer. It is similar to GNU asprintf().
* @param fmt printf-compatible format string, specifying how the
* following parameters are used.
* @return the allocated string
* @note You have to free the string yourself with av_free().
*/
char
*
av_asprintf
(
const
char
*
fmt
,
...)
av_printf_format
(
1
,
2
);
/**
/**
* Convert a number to a av_malloced string.
* Convert a number to a av_malloced string.
*/
*/
...
...
libavutil/avutil.h
View file @
61e2e296
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 1
5
#define LIBAVUTIL_VERSION_MINOR 1
6
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment