Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
ae569018
Commit
ae569018
authored
Feb 27, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: implement the libavutil log callback
Pass everything to the GLib logging library. No direct stderr access.
parent
4e364854
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
NEWS
NEWS
+1
-0
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+31
-0
No files found.
NEWS
View file @
ae569018
...
@@ -24,6 +24,7 @@ ver 0.16 (20??/??/??)
...
@@ -24,6 +24,7 @@ ver 0.16 (20??/??/??)
- don't fall back to "mad" unless no plugin matches
- don't fall back to "mad" unless no plugin matches
- ffmpeg: support multiple tags
- ffmpeg: support multiple tags
- ffmpeg: convert metadata to generic format
- ffmpeg: convert metadata to generic format
- ffmpeg: implement the libavutil log callback
- sndfile: new decoder plugin based on libsndfile
- sndfile: new decoder plugin based on libsndfile
- flac: moved CUE sheet support to a playlist plugin
- flac: moved CUE sheet support to a playlist plugin
- flac: support streams without STREAMINFO block
- flac: support streams without STREAMINFO block
...
...
src/decoder/ffmpeg_decoder_plugin.c
View file @
ae569018
...
@@ -40,11 +40,38 @@
...
@@ -40,11 +40,38 @@
#include <libavcodec/avcodec.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavformat/avio.h>
#include <libavutil/log.h>
#endif
#endif
#undef G_LOG_DOMAIN
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "ffmpeg"
#define G_LOG_DOMAIN "ffmpeg"
#ifndef OLD_FFMPEG_INCLUDES
static
GLogLevelFlags
level_ffmpeg_to_glib
(
int
level
)
{
if
(
level
<=
AV_LOG_FATAL
)
return
G_LOG_LEVEL_CRITICAL
;
if
(
level
<=
AV_LOG_ERROR
)
return
G_LOG_LEVEL_WARNING
;
if
(
level
<=
AV_LOG_INFO
)
return
G_LOG_LEVEL_MESSAGE
;
return
G_LOG_LEVEL_DEBUG
;
}
static
void
mpd_ffmpeg_log_callback
(
G_GNUC_UNUSED
void
*
ptr
,
int
level
,
const
char
*
fmt
,
va_list
vl
)
{
g_logv
(
G_LOG_DOMAIN
,
level_ffmpeg_to_glib
(
level
),
fmt
,
vl
);
}
#endif
/* !OLD_FFMPEG_INCLUDES */
struct
ffmpeg_stream
{
struct
ffmpeg_stream
{
/** hack - see url_to_struct() */
/** hack - see url_to_struct() */
char
url
[
64
];
char
url
[
64
];
...
@@ -116,6 +143,10 @@ static URLProtocol mpd_ffmpeg_fileops = {
...
@@ -116,6 +143,10 @@ static URLProtocol mpd_ffmpeg_fileops = {
static
bool
static
bool
ffmpeg_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
ffmpeg_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
{
{
#ifndef OLD_FFMPEG_INCLUDES
av_log_set_callback
(
mpd_ffmpeg_log_callback
);
#endif
av_register_all
();
av_register_all
();
register_protocol
(
&
mpd_ffmpeg_fileops
);
register_protocol
(
&
mpd_ffmpeg_fileops
);
return
true
;
return
true
;
...
...
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