Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bcd3ce59
Commit
bcd3ce59
authored
Jun 22, 2008
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add callback for av_log
Originally committed as revision 13866 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
82e0be62
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
ffserver.c
ffserver.c
+23
-6
No files found.
ffserver.c
View file @
bcd3ce59
...
...
@@ -318,12 +318,9 @@ static char *ctime1(char *buf2)
return
buf2
;
}
static
void
__attribute__
((
format
(
printf
,
1
,
2
)))
http_log
(
const
char
*
fmt
,
...
)
static
void
http_vlog
(
const
char
*
fmt
,
va_list
vargs
)
{
static
int
print_prefix
=
1
;
va_list
ap
;
va_start
(
ap
,
fmt
);
if
(
logfile
)
{
if
(
print_prefix
)
{
char
buf
[
32
];
...
...
@@ -331,10 +328,29 @@ static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ..
fprintf
(
logfile
,
"%s "
,
buf
);
}
print_prefix
=
strstr
(
fmt
,
"
\n
"
)
!=
NULL
;
vfprintf
(
logfile
,
fmt
,
ap
);
vfprintf
(
logfile
,
fmt
,
vargs
);
fflush
(
logfile
);
}
va_end
(
ap
);
}
void
__attribute__
((
format
(
printf
,
1
,
2
)))
http_log
(
const
char
*
fmt
,
...)
{
va_list
vargs
;
va_start
(
vargs
,
fmt
);
http_vlog
(
fmt
,
vargs
);
va_end
(
vargs
);
}
static
void
http_av_log
(
void
*
ptr
,
int
level
,
const
char
*
fmt
,
va_list
vargs
)
{
static
int
print_prefix
=
1
;
AVClass
*
avc
=
ptr
?
*
(
AVClass
**
)
ptr
:
NULL
;
if
(
level
>
av_log_level
)
return
;
if
(
print_prefix
&&
avc
)
http_log
(
"[%s @ %p]"
,
avc
->
item_name
(
ptr
),
avc
);
print_prefix
=
strstr
(
fmt
,
"
\n
"
)
!=
NULL
;
http_vlog
(
fmt
,
vargs
);
}
static
void
log_connection
(
HTTPContext
*
c
)
...
...
@@ -4518,6 +4534,7 @@ int main(int argc, char **argv)
logfile
=
stdout
;
else
logfile
=
fopen
(
logfilename
,
"a"
);
av_log_set_callback
(
http_av_log
);
}
if
(
http_server
()
<
0
)
{
...
...
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