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
3be8b02c
Commit
3be8b02c
authored
Oct 19, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sndfile: make `vio` constexpr
Use `const_cast` to be able to pass it to sf_open_virtual() which has a wrong parameter declaration.
parent
bdfaea0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
SndfileDecoderPlugin.cxx
src/decoder/plugins/SndfileDecoderPlugin.cxx
+5
-3
No files found.
src/decoder/plugins/SndfileDecoderPlugin.cxx
View file @
3be8b02c
...
...
@@ -130,7 +130,7 @@ sndfile_vio_tell(void *user_data)
* This SF_VIRTUAL_IO implementation wraps MPD's #InputStream to a
* libsndfile stream.
*/
static
SF_VIRTUAL_IO
vio
=
{
static
constexpr
SF_VIRTUAL_IO
vio
=
{
sndfile_vio_get_filelen
,
sndfile_vio_seek
,
sndfile_vio_read
,
...
...
@@ -202,7 +202,8 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is)
info
.
format
=
0
;
SndfileInputStream
sis
{
&
client
,
is
};
SNDFILE
*
const
sf
=
sf_open_virtual
(
&
vio
,
SFM_READ
,
&
info
,
&
sis
);
SNDFILE
*
const
sf
=
sf_open_virtual
(
const_cast
<
SF_VIRTUAL_IO
*>
(
&
vio
),
SFM_READ
,
&
info
,
&
sis
);
if
(
sf
==
nullptr
)
{
FormatWarning
(
sndfile_domain
,
"sf_open_virtual() failed: %s"
,
sf_strerror
(
nullptr
));
...
...
@@ -274,7 +275,8 @@ sndfile_scan_stream(InputStream &is, TagHandler &handler) noexcept
info
.
format
=
0
;
SndfileInputStream
sis
{
nullptr
,
is
};
SNDFILE
*
const
sf
=
sf_open_virtual
(
&
vio
,
SFM_READ
,
&
info
,
&
sis
);
SNDFILE
*
const
sf
=
sf_open_virtual
(
const_cast
<
SF_VIRTUAL_IO
*>
(
&
vio
),
SFM_READ
,
&
info
,
&
sis
);
if
(
sf
==
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