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
10196496
Commit
10196496
authored
Oct 21, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/modplug: move code to LoadModPlugFile()
parent
86f08862
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
ModplugDecoderPlugin.cxx
src/decoder/ModplugDecoderPlugin.cxx
+17
-21
No files found.
src/decoder/ModplugDecoderPlugin.cxx
View file @
10196496
...
...
@@ -106,22 +106,27 @@ mod_loadfile(struct decoder *decoder, struct input_stream *is)
return
bdatas
;
}
static
ModPlugFile
*
LoadModPlugFile
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
)
{
const
auto
bdatas
=
mod_loadfile
(
decoder
,
is
);
if
(
!
bdatas
)
{
LogWarning
(
modplug_domain
,
"could not load stream"
);
return
nullptr
;
}
ModPlugFile
*
f
=
ModPlug_Load
(
bdatas
->
data
,
bdatas
->
len
);
g_byte_array_free
(
bdatas
,
TRUE
);
return
f
;
}
static
void
mod_decode
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
)
{
ModPlugFile
*
f
;
ModPlug_Settings
settings
;
GByteArray
*
bdatas
;
int
ret
;
char
audio_buffer
[
MODPLUG_FRAME_SIZE
];
bdatas
=
mod_loadfile
(
decoder
,
is
);
if
(
!
bdatas
)
{
LogWarning
(
modplug_domain
,
"could not load stream"
);
return
;
}
ModPlug_GetSettings
(
&
settings
);
/* alter setting */
settings
.
mResamplingMode
=
MODPLUG_RESAMPLE_FIR
;
/* RESAMP */
...
...
@@ -132,9 +137,8 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
/* insert more setting changes here */
ModPlug_SetSettings
(
&
settings
);
f
=
ModPlug_Load
(
bdatas
->
data
,
bdatas
->
len
);
g_byte_array_free
(
bdatas
,
TRUE
);
if
(
!
f
)
{
ModPlugFile
*
f
=
LoadModPlugFile
(
decoder
,
is
);
if
(
f
==
nullptr
)
{
LogWarning
(
modplug_domain
,
"could not decode stream"
);
return
;
}
...
...
@@ -173,15 +177,7 @@ static bool
modplug_scan_stream
(
struct
input_stream
*
is
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
ModPlugFile
*
f
;
GByteArray
*
bdatas
;
bdatas
=
mod_loadfile
(
nullptr
,
is
);
if
(
!
bdatas
)
return
false
;
f
=
ModPlug_Load
(
bdatas
->
data
,
bdatas
->
len
);
g_byte_array_free
(
bdatas
,
TRUE
);
ModPlugFile
*
f
=
LoadModPlugFile
(
nullptr
,
is
);
if
(
f
==
nullptr
)
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