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
79d70f12
Commit
79d70f12
authored
Nov 02, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output: don't allow length==0
Nobody should call playAudio() with an empty chunk. Add some assertions on that.
parent
cc164cc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
audio.c
src/audio.c
+1
-0
output_control.c
src/output_control.c
+2
-0
output_thread.c
src/output_thread.c
+2
-0
No files found.
src/audio.c
View file @
79d70f12
...
...
@@ -228,6 +228,7 @@ bool playAudio(const char *buffer, size_t length)
bool
ret
=
false
;
unsigned
int
i
;
assert
(
length
>
0
);
/* no partial frames allowed */
assert
((
length
%
audio_format_frame_size
(
&
input_audio_format
))
==
0
);
...
...
src/output_control.c
View file @
79d70f12
...
...
@@ -107,6 +107,8 @@ audio_output_signal(struct audio_output *ao)
void
audio_output_play
(
struct
audio_output
*
audioOutput
,
const
char
*
playChunk
,
size_t
size
)
{
assert
(
size
>
0
);
if
(
!
audioOutput
->
open
)
return
;
...
...
src/output_thread.c
View file @
79d70f12
...
...
@@ -65,6 +65,8 @@ static void ao_play(struct audio_output *ao)
size_t
size
=
ao
->
args
.
play
.
size
;
bool
ret
;
assert
(
size
>
0
);
if
(
!
audio_format_equals
(
&
ao
->
inAudioFormat
,
&
ao
->
outAudioFormat
))
convertAudioFormat
(
ao
,
&
data
,
&
size
);
...
...
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