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
f15fc4e9
Commit
f15fc4e9
authored
Nov 21, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: use GLib instead of log.h
parent
4a3a621c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
ffmpeg_plugin.c
src/decoder/ffmpeg_plugin.c
+11
-8
No files found.
src/decoder/ffmpeg_plugin.c
View file @
f15fc4e9
...
...
@@ -17,7 +17,6 @@
*/
#include "../decoder_api.h"
#include "../log.h"
#include <assert.h>
#include <stdio.h>
...
...
@@ -27,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glib.h>
#ifdef OLD_FFMPEG_INCLUDES
#include <avcodec.h>
...
...
@@ -38,6 +38,9 @@
#include <libavformat/avio.h>
#endif
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "ffmpeg"
struct
ffmpeg_context
{
int
audio_stream
;
AVFormatContext
*
format_context
;
...
...
@@ -156,18 +159,18 @@ ffmpeg_helper(struct input_stream *input,
//ffmpeg works with ours "fileops" helper
if
(
av_open_input_file
(
&
format_context
,
stream
.
url
,
NULL
,
0
,
NULL
)
!=
0
)
{
ERROR
(
"Open failed!
\n
"
);
g_warning
(
"Open failed
\n
"
);
return
false
;
}
if
(
av_find_stream_info
(
format_context
)
<
0
)
{
ERROR
(
"Couldn't find stream info!
\n
"
);
g_warning
(
"Couldn't find stream info
\n
"
);
return
false
;
}
audio_stream
=
ffmpeg_find_audio_stream
(
format_context
);
if
(
audio_stream
==
-
1
)
{
ERROR
(
"No audio stream inside!
\n
"
);
g_warning
(
"No audio stream inside
\n
"
);
return
false
;
}
...
...
@@ -175,12 +178,12 @@ ffmpeg_helper(struct input_stream *input,
codec
=
avcodec_find_decoder
(
codec_context
->
codec_id
);
if
(
!
codec
)
{
ERROR
(
"Unsupported audio codec!
\n
"
);
g_warning
(
"Unsupported audio codec
\n
"
);
return
false
;
}
if
(
avcodec_open
(
codec_context
,
codec
)
<
0
)
{
ERROR
(
"Could not open codec!
\n
"
);
g_warning
(
"Could not open codec
\n
"
);
return
false
;
}
...
...
@@ -219,7 +222,7 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is,
packet
->
data
,
packet
->
size
);
if
(
len
<
0
)
{
WARNING
(
"skipping frame!
\n
"
);
g_message
(
"skipping frame
\n
"
);
return
decoder_get_command
(
decoder
);
}
...
...
@@ -330,7 +333,7 @@ static struct tag *ffmpeg_tag(const char *file)
bool
ret
;
if
(
!
input_stream_open
(
&
input
,
file
))
{
ERROR
(
"failed to open %s
\n
"
,
file
);
g_warning
(
"failed to open %s
\n
"
,
file
);
return
NULL
;
}
...
...
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