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
25f89afb
Commit
25f89afb
authored
Dec 17, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/winmm: show detailed error messages
parent
43f3cdcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
WinmmOutputPlugin.cxx
src/output/plugins/WinmmOutputPlugin.cxx
+18
-7
No files found.
src/output/plugins/WinmmOutputPlugin.cxx
View file @
25f89afb
...
...
@@ -56,6 +56,18 @@ struct WinmmOutput {
static
constexpr
Domain
winmm_output_domain
(
"winmm_output"
);
static
void
SetWaveOutError
(
Error
&
error
,
MMRESULT
result
,
const
char
*
prefix
)
{
char
buffer
[
256
];
if
(
waveOutGetErrorTextA
(
result
,
buffer
,
ARRAY_SIZE
(
buffer
))
==
MMSYSERR_NOERROR
)
error
.
Format
(
winmm_output_domain
,
int
(
result
),
"%s: %s"
,
prefix
,
buffer
);
else
error
.
Set
(
winmm_output_domain
,
int
(
result
),
prefix
);
}
HWAVEOUT
winmm_output_get_handle
(
WinmmOutput
&
output
)
{
...
...
@@ -179,7 +191,7 @@ winmm_output_open(AudioOutput *ao, AudioFormat &audio_format,
(
DWORD_PTR
)
wo
->
event
,
0
,
CALLBACK_EVENT
);
if
(
result
!=
MMSYSERR_NOERROR
)
{
CloseHandle
(
wo
->
event
);
error
.
Set
(
winmm_output_domain
,
"waveOutOpen() failed"
);
SetWaveOutError
(
error
,
result
,
"waveOutOpen() failed"
);
return
false
;
}
...
...
@@ -225,8 +237,8 @@ winmm_set_buffer(WinmmOutput *wo, WinmmBuffer *buffer,
MMRESULT
result
=
waveOutPrepareHeader
(
wo
->
handle
,
&
buffer
->
hdr
,
sizeof
(
buffer
->
hdr
));
if
(
result
!=
MMSYSERR_NOERROR
)
{
error
.
Set
(
winmm_output_domain
,
result
,
"waveOutPrepareHeader() failed"
);
SetWaveOutError
(
error
,
result
,
"waveOutPrepareHeader() failed"
);
return
false
;
}
...
...
@@ -251,8 +263,8 @@ winmm_drain_buffer(WinmmOutput *wo, WinmmBuffer *buffer,
if
(
result
==
MMSYSERR_NOERROR
)
return
true
;
else
if
(
result
!=
WAVERR_STILLPLAYING
)
{
error
.
Set
(
winmm_output_domain
,
result
,
"waveOutUnprepareHeader() failed"
);
SetWaveOutError
(
error
,
result
,
"waveOutUnprepareHeader() failed"
);
return
false
;
}
...
...
@@ -278,8 +290,7 @@ winmm_output_play(AudioOutput *ao, const void *chunk, size_t size, Error &error)
if
(
result
!=
MMSYSERR_NOERROR
)
{
waveOutUnprepareHeader
(
wo
->
handle
,
&
buffer
->
hdr
,
sizeof
(
buffer
->
hdr
));
error
.
Set
(
winmm_output_domain
,
result
,
"waveOutWrite() failed"
);
SetWaveOutError
(
error
,
result
,
"waveOutWrite() failed"
);
return
0
;
}
...
...
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