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
1fb3fbb4
Commit
1fb3fbb4
authored
Oct 10, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio_format: un-inline audio_format_mask_apply()
This function is not critical for performance, and the inline expansion looks too expensive.
parent
2c38d19a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
audio_format.c
src/audio_format.c
+19
-0
audio_format.h
src/audio_format.h
+2
-17
No files found.
src/audio_format.c
View file @
1fb3fbb4
...
@@ -28,6 +28,25 @@
...
@@ -28,6 +28,25 @@
#define REVERSE_ENDIAN_SUFFIX "_be"
#define REVERSE_ENDIAN_SUFFIX "_be"
#endif
#endif
void
audio_format_mask_apply
(
struct
audio_format
*
af
,
const
struct
audio_format
*
mask
)
{
assert
(
audio_format_valid
(
af
));
assert
(
audio_format_mask_valid
(
mask
));
if
(
mask
->
sample_rate
!=
0
)
af
->
sample_rate
=
mask
->
sample_rate
;
if
(
mask
->
format
!=
SAMPLE_FORMAT_UNDEFINED
)
af
->
format
=
mask
->
format
;
if
(
mask
->
channels
!=
0
)
af
->
channels
=
mask
->
channels
;
assert
(
audio_format_valid
(
af
));
}
const
char
*
const
char
*
sample_format_to_string
(
enum
sample_format
format
)
sample_format_to_string
(
enum
sample_format
format
)
{
{
...
...
src/audio_format.h
View file @
1fb3fbb4
...
@@ -221,24 +221,9 @@ static inline bool audio_format_equals(const struct audio_format *a,
...
@@ -221,24 +221,9 @@ static inline bool audio_format_equals(const struct audio_format *a,
a
->
reverse_endian
==
b
->
reverse_endian
;
a
->
reverse_endian
==
b
->
reverse_endian
;
}
}
static
inline
void
void
audio_format_mask_apply
(
struct
audio_format
*
af
,
audio_format_mask_apply
(
struct
audio_format
*
af
,
const
struct
audio_format
*
mask
)
const
struct
audio_format
*
mask
);
{
assert
(
audio_format_valid
(
af
));
assert
(
audio_format_mask_valid
(
mask
));
if
(
mask
->
sample_rate
!=
0
)
af
->
sample_rate
=
mask
->
sample_rate
;
if
(
mask
->
format
!=
SAMPLE_FORMAT_UNDEFINED
)
af
->
format
=
mask
->
format
;
if
(
mask
->
channels
!=
0
)
af
->
channels
=
mask
->
channels
;
assert
(
audio_format_valid
(
af
));
}
G_GNUC_CONST
G_GNUC_CONST
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