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
accd2625
Commit
accd2625
authored
Oct 08, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio_format: move code to sample_format_size()
Cast to enum sample_format. Without the cast, it's just a plain integer, and gcc cannot know that a "case" statement is missing.
parent
3057d19c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
audio_format.h
src/audio_format.h
+13
-6
No files found.
src/audio_format.h
View file @
accd2625
...
@@ -237,12 +237,10 @@ audio_format_mask_apply(struct audio_format *af,
...
@@ -237,12 +237,10 @@ audio_format_mask_apply(struct audio_format *af,
assert
(
audio_format_valid
(
af
));
assert
(
audio_format_valid
(
af
));
}
}
/**
static
inline
unsigned
* Returns the size of each (mono) sample in bytes.
sample_format_size
(
enum
sample_format
format
)
*/
static
inline
unsigned
audio_format_sample_size
(
const
struct
audio_format
*
af
)
{
{
switch
(
af
->
format
)
{
switch
(
format
)
{
case
SAMPLE_FORMAT_S8
:
case
SAMPLE_FORMAT_S8
:
return
1
;
return
1
;
...
@@ -257,13 +255,22 @@ static inline unsigned audio_format_sample_size(const struct audio_format *af)
...
@@ -257,13 +255,22 @@ static inline unsigned audio_format_sample_size(const struct audio_format *af)
return
4
;
return
4
;
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_UNDEFINED
:
break
;
return
0
;
}
}
assert
(
false
);
return
0
;
return
0
;
}
}
/**
/**
* Returns the size of each (mono) sample in bytes.
*/
static
inline
unsigned
audio_format_sample_size
(
const
struct
audio_format
*
af
)
{
return
sample_format_size
((
enum
sample_format
)
af
->
format
);
}
/**
* Returns the size of each full frame in bytes.
* Returns the size of each full frame in bytes.
*/
*/
static
inline
unsigned
static
inline
unsigned
...
...
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