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
1245b4a4
Commit
1245b4a4
authored
Jul 07, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/wavpack: merge duplicate code into Scan()
parent
d4ce6049
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
WavpackDecoderPlugin.cxx
src/decoder/plugins/WavpackDecoderPlugin.cxx
+15
-18
No files found.
src/decoder/plugins/WavpackDecoderPlugin.cxx
View file @
1245b4a4
...
@@ -580,6 +580,19 @@ wavpack_filedecode(DecoderClient &client, Path path_fs)
...
@@ -580,6 +580,19 @@ wavpack_filedecode(DecoderClient &client, Path path_fs)
wavpack_decode
(
client
,
wpc
,
true
);
wavpack_decode
(
client
,
wpc
,
true
);
}
}
static
void
Scan
(
WavpackContext
*
wpc
,
TagHandler
&
handler
)
noexcept
{
try
{
handler
.
OnAudioFormat
(
CheckAudioFormat
(
wpc
));
}
catch
(...)
{
}
const
auto
duration
=
GetDuration
(
wpc
);
if
(
!
duration
.
IsNegative
())
handler
.
OnDuration
(
SongTime
(
duration
));
}
/*
/*
* Reads metainfo from the specified file.
* Reads metainfo from the specified file.
*/
*/
...
@@ -598,15 +611,7 @@ wavpack_scan_file(Path path_fs, TagHandler &handler) noexcept
...
@@ -598,15 +611,7 @@ wavpack_scan_file(Path path_fs, TagHandler &handler) noexcept
WavpackCloseFile
(
wpc
);
WavpackCloseFile
(
wpc
);
};
};
try
{
Scan
(
wpc
,
handler
);
handler
.
OnAudioFormat
(
CheckAudioFormat
(
wpc
));
}
catch
(...)
{
}
const
auto
duration
=
GetDuration
(
wpc
);
if
(
!
duration
.
IsNegative
())
handler
.
OnDuration
(
SongTime
(
duration
));
return
true
;
return
true
;
}
}
...
@@ -627,15 +632,7 @@ wavpack_scan_stream(InputStream &is, TagHandler &handler) noexcept
...
@@ -627,15 +632,7 @@ wavpack_scan_stream(InputStream &is, TagHandler &handler) noexcept
WavpackCloseFile
(
wpc
);
WavpackCloseFile
(
wpc
);
};
};
try
{
Scan
(
wpc
,
handler
);
handler
.
OnAudioFormat
(
CheckAudioFormat
(
wpc
));
}
catch
(...)
{
}
const
auto
duration
=
GetDuration
(
wpc
);
if
(
!
duration
.
IsNegative
())
handler
.
OnDuration
(
SongTime
(
duration
));
return
true
;
return
true
;
}
}
...
...
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