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
6c818bb3
Commit
6c818bb3
authored
Dec 13, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AudioFormat: add method WithMask(), shortcut for ApplyMask()
parent
8cb160b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
AudioFormat.hxx
src/AudioFormat.hxx
+7
-0
DecoderControl.cxx
src/decoder/DecoderControl.cxx
+1
-2
OutputThread.cxx
src/output/OutputThread.cxx
+1
-2
run_convert.cxx
test/run_convert.cxx
+2
-2
No files found.
src/AudioFormat.hxx
View file @
6c818bb3
...
...
@@ -159,6 +159,13 @@ struct AudioFormat {
void
ApplyMask
(
AudioFormat
mask
);
gcc_pure
AudioFormat
WithMask
(
AudioFormat
mask
)
const
{
AudioFormat
result
=
*
this
;
result
.
ApplyMask
(
mask
);
return
result
;
}
/**
* Returns the size of each (mono) sample in bytes.
*/
...
...
src/decoder/DecoderControl.cxx
View file @
6c818bb3
...
...
@@ -64,8 +64,7 @@ DecoderControl::SetReady(const AudioFormat audio_format,
assert
(
audio_format
.
IsValid
());
in_audio_format
=
audio_format
;
out_audio_format
=
audio_format
;
out_audio_format
.
ApplyMask
(
configured_audio_format
);
out_audio_format
=
audio_format
.
WithMask
(
configured_audio_format
);
seekable
=
_seekable
;
total_time
=
_duration
;
...
...
src/output/OutputThread.cxx
View file @
6c818bb3
...
...
@@ -159,8 +159,7 @@ AudioOutput::Open()
assert
(
filter_audio_format
.
IsValid
());
out_audio_format
=
filter_audio_format
;
out_audio_format
.
ApplyMask
(
config_audio_format
);
out_audio_format
=
filter_audio_format
.
WithMask
(
config_audio_format
);
mutex
.
unlock
();
...
...
test/run_convert.cxx
View file @
6c818bb3
...
...
@@ -49,8 +49,8 @@ try {
const
auto
in_audio_format
=
ParseAudioFormat
(
argv
[
1
],
false
);
const
auto
out_audio_format_mask
=
ParseAudioFormat
(
argv
[
2
],
false
);
auto
out_audio_format
=
in_audio_format
;
out_audio_format
.
Apply
Mask
(
out_audio_format_mask
);
const
auto
out_audio_format
=
in_audio_format
.
With
Mask
(
out_audio_format_mask
);
const
size_t
in_frame_size
=
in_audio_format
.
GetFrameSize
();
...
...
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