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
18787ebe
Commit
18787ebe
authored
Jul 11, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/faad: move code to faad_decoder_new()
Merge some duplicate code.
parent
47e8fcf3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
FaadDecoderPlugin.cxx
src/decoder/FaadDecoderPlugin.cxx
+17
-14
No files found.
src/decoder/FaadDecoderPlugin.cxx
View file @
18787ebe
...
@@ -217,6 +217,21 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
...
@@ -217,6 +217,21 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
return
-
1
;
return
-
1
;
}
}
static
NeAACDecHandle
faad_decoder_new
()
{
const
NeAACDecHandle
decoder
=
NeAACDecOpen
();
NeAACDecConfigurationPtr
config
=
NeAACDecGetCurrentConfiguration
(
decoder
);
config
->
outputFormat
=
FAAD_FMT_16BIT
;
config
->
downMatrix
=
1
;
config
->
dontUpSampleImplicitSBR
=
0
;
NeAACDecSetConfiguration
(
decoder
,
config
);
return
decoder
;
}
/**
/**
* Wrapper for NeAACDecInit() which works around some API
* Wrapper for NeAACDecInit() which works around some API
* inconsistencies in libfaad.
* inconsistencies in libfaad.
...
@@ -297,12 +312,7 @@ faad_get_file_time_float(InputStream &is)
...
@@ -297,12 +312,7 @@ faad_get_file_time_float(InputStream &is)
if
(
length
<
0
)
{
if
(
length
<
0
)
{
AudioFormat
audio_format
;
AudioFormat
audio_format
;
NeAACDecHandle
decoder
=
NeAACDecOpen
();
NeAACDecHandle
decoder
=
faad_decoder_new
();
NeAACDecConfigurationPtr
config
=
NeAACDecGetCurrentConfiguration
(
decoder
);
config
->
outputFormat
=
FAAD_FMT_16BIT
;
NeAACDecSetConfiguration
(
decoder
,
config
);
decoder_buffer_fill
(
buffer
);
decoder_buffer_fill
(
buffer
);
...
@@ -344,14 +354,7 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is)
...
@@ -344,14 +354,7 @@ faad_stream_decode(Decoder &mpd_decoder, InputStream &is)
/* create the libfaad decoder */
/* create the libfaad decoder */
const
NeAACDecHandle
decoder
=
NeAACDecOpen
();
const
NeAACDecHandle
decoder
=
faad_decoder_new
();
NeAACDecConfigurationPtr
config
=
NeAACDecGetCurrentConfiguration
(
decoder
);
config
->
outputFormat
=
FAAD_FMT_16BIT
;
config
->
downMatrix
=
1
;
config
->
dontUpSampleImplicitSBR
=
0
;
NeAACDecSetConfiguration
(
decoder
,
config
);
while
(
!
decoder_buffer_is_full
(
buffer
)
&&
!
is
.
LockIsEOF
()
&&
while
(
!
decoder_buffer_is_full
(
buffer
)
&&
!
is
.
LockIsEOF
()
&&
decoder_get_command
(
mpd_decoder
)
==
DecoderCommand
::
NONE
)
{
decoder_get_command
(
mpd_decoder
)
==
DecoderCommand
::
NONE
)
{
...
...
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