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
479de9c7
Commit
479de9c7
authored
Jul 07, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sndfile: add CheckAudioFormat(SF_INFO)
parent
60821232
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
SndfileDecoderPlugin.cxx
src/decoder/plugins/SndfileDecoderPlugin.cxx
+9
-4
No files found.
src/decoder/plugins/SndfileDecoderPlugin.cxx
View file @
479de9c7
...
@@ -165,6 +165,14 @@ sndfile_sample_format(const SF_INFO &info) noexcept
...
@@ -165,6 +165,14 @@ sndfile_sample_format(const SF_INFO &info) noexcept
}
}
}
}
static
AudioFormat
CheckAudioFormat
(
const
SF_INFO
&
info
)
{
return
CheckAudioFormat
(
info
.
samplerate
,
sndfile_sample_format
(
info
),
info
.
channels
);
}
static
sf_count_t
static
sf_count_t
sndfile_read_frames
(
SNDFILE
*
sf
,
SampleFormat
format
,
sndfile_read_frames
(
SNDFILE
*
sf
,
SampleFormat
format
,
void
*
buffer
,
sf_count_t
n_frames
)
void
*
buffer
,
sf_count_t
n_frames
)
...
@@ -200,10 +208,7 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is)
...
@@ -200,10 +208,7 @@ sndfile_stream_decode(DecoderClient &client, InputStream &is)
return
;
return
;
}
}
const
auto
audio_format
=
const
auto
audio_format
=
CheckAudioFormat
(
info
);
CheckAudioFormat
(
info
.
samplerate
,
sndfile_sample_format
(
info
),
info
.
channels
);
client
.
Ready
(
audio_format
,
info
.
seekable
,
sndfile_duration
(
info
));
client
.
Ready
(
audio_format
,
info
.
seekable
,
sndfile_duration
(
info
));
...
...
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