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
7e84c73b
Commit
7e84c73b
authored
Nov 04, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: moved code to ffmpeg_find_audio_stream()
parent
5e486964
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
ffmpeg_plugin.c
src/decoder/ffmpeg_plugin.c
+12
-9
No files found.
src/decoder/ffmpeg_plugin.c
View file @
7e84c73b
...
...
@@ -130,6 +130,17 @@ static bool ffmpeg_init(void)
return
true
;
}
static
int
ffmpeg_find_audio_stream
(
const
AVFormatContext
*
format_context
)
{
for
(
unsigned
i
=
0
;
i
<
format_context
->
nb_streams
;
++
i
)
if
(
format_context
->
streams
[
i
]
->
codec
->
codec_type
==
CODEC_TYPE_AUDIO
)
return
i
;
return
-
1
;
}
static
bool
ffmpeg_helper
(
struct
input_stream
*
input
,
bool
(
*
callback
)(
struct
ffmpeg_context
*
ctx
),
...
...
@@ -139,7 +150,6 @@ ffmpeg_helper(struct input_stream *input,
AVCodecContext
*
codec_context
;
AVCodec
*
codec
;
int
audio_stream
;
unsigned
i
;
struct
ffmpeg_stream
stream
=
{
.
url
=
"mpd://X"
,
/* only the mpd:// prefix matters */
};
...
...
@@ -163,14 +173,7 @@ ffmpeg_helper(struct input_stream *input,
return
false
;
}
audio_stream
=
-
1
;
for
(
i
=
0
;
i
<
format_context
->
nb_streams
;
i
++
)
{
if
(
format_context
->
streams
[
i
]
->
codec
->
codec_type
==
CODEC_TYPE_AUDIO
&&
audio_stream
<
0
)
{
audio_stream
=
i
;
}
}
audio_stream
=
ffmpeg_find_audio_stream
(
format_context
);
if
(
audio_stream
==
-
1
)
{
ERROR
(
"No audio stream inside!
\n
"
);
return
false
;
...
...
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