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
62f73758
Commit
62f73758
authored
Dec 22, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: simplify mpd_ffmpeg_open_input()
parent
543296b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
FfmpegDecoderPlugin.cxx
src/decoder/plugins/FfmpegDecoderPlugin.cxx
+14
-19
No files found.
src/decoder/plugins/FfmpegDecoderPlugin.cxx
View file @
62f73758
...
...
@@ -54,23 +54,19 @@ extern "C" {
#include <assert.h>
#include <string.h>
/**
* API compatibility wrapper for av_open_input_stream() and
* avformat_open_input().
*/
static
int
mpd_ffmpeg_open_input
(
AVFormatContext
**
ic_ptr
,
AVIOContext
*
pb
,
const
char
*
filename
,
AVInputFormat
*
fmt
)
static
AVFormatContext
*
FfmpegOpenInput
(
AVIOContext
*
pb
,
const
char
*
filename
,
AVInputFormat
*
fmt
)
{
AVFormatContext
*
context
=
avformat_alloc_context
();
if
(
context
==
nullptr
)
return
AVERROR
(
ENOMEM
)
;
return
nullptr
;
context
->
pb
=
pb
;
*
ic_ptr
=
context
;
return
avformat_open_input
(
ic_ptr
,
filename
,
fmt
,
nullptr
);
avformat_open_input
(
&
context
,
filename
,
fmt
,
nullptr
);
return
context
;
}
static
bool
...
...
@@ -384,10 +380,9 @@ ffmpeg_decode(Decoder &decoder, InputStream &input)
return
;
}
AVFormatContext
*
format_context
=
nullptr
;
if
(
mpd_ffmpeg_open_input
(
&
format_context
,
stream
.
io
,
input
.
GetURI
(),
input_format
)
!=
0
)
{
AVFormatContext
*
format_context
=
FfmpegOpenInput
(
stream
.
io
,
input
.
GetURI
(),
input_format
);
if
(
format_context
==
nullptr
)
{
LogError
(
ffmpeg_domain
,
"Open failed"
);
return
;
}
...
...
@@ -553,9 +548,9 @@ ffmpeg_scan_stream(InputStream &is,
if
(
!
stream
.
Open
())
return
false
;
AVFormatContext
*
f
=
nullptr
;
if
(
mpd_ffmpeg_open_input
(
&
f
,
stream
.
io
,
is
.
GetURI
(),
input_format
)
!=
0
)
AVFormatContext
*
f
=
FfmpegOpenInput
(
stream
.
io
,
is
.
GetURI
(),
input_format
);
if
(
f
==
nullptr
)
return
false
;
const
int
find_result
=
...
...
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