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
8dd83a2c
Commit
8dd83a2c
authored
Oct 08, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/roar: move code to _use_audio_format()
parent
49b84f92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
27 deletions
+38
-27
roar_output_plugin.c
src/output/roar_output_plugin.c
+38
-27
No files found.
src/output/roar_output_plugin.c
View file @
8dd83a2c
...
...
@@ -145,6 +145,43 @@ roar_finish(struct audio_output *ao)
g_free
(
self
);
}
static
void
roar_use_audio_format
(
struct
roar_audio_info
*
info
,
struct
audio_format
*
audio_format
)
{
info
->
rate
=
audio_format
->
sample_rate
;
info
->
channels
=
audio_format
->
channels
;
info
->
codec
=
ROAR_CODEC_PCM_S
;
switch
(
audio_format
->
format
)
{
case
SAMPLE_FORMAT_UNDEFINED
:
info
->
bits
=
16
;
audio_format
->
format
=
SAMPLE_FORMAT_S16
;
break
;
case
SAMPLE_FORMAT_S8
:
info
->
bits
=
8
;
break
;
case
SAMPLE_FORMAT_S16
:
info
->
bits
=
16
;
break
;
case
SAMPLE_FORMAT_S24
:
info
->
bits
=
24
;
break
;
case
SAMPLE_FORMAT_S24_P32
:
info
->
bits
=
32
;
audio_format
->
format
=
SAMPLE_FORMAT_S32
;
break
;
case
SAMPLE_FORMAT_S32
:
info
->
bits
=
32
;
break
;
}
}
static
bool
roar_open
(
struct
audio_output
*
ao
,
struct
audio_format
*
audio_format
,
GError
**
error
)
{
...
...
@@ -169,33 +206,7 @@ roar_open(struct audio_output *ao, struct audio_format *audio_format, GError **e
return
false
;
}
self
->
info
.
rate
=
audio_format
->
sample_rate
;
self
->
info
.
channels
=
audio_format
->
channels
;
self
->
info
.
codec
=
ROAR_CODEC_PCM_S
;
switch
(
audio_format
->
format
)
{
case
SAMPLE_FORMAT_S8
:
self
->
info
.
bits
=
8
;
break
;
case
SAMPLE_FORMAT_S16
:
self
->
info
.
bits
=
16
;
break
;
case
SAMPLE_FORMAT_S24
:
self
->
info
.
bits
=
24
;
break
;
case
SAMPLE_FORMAT_S24_P32
:
self
->
info
.
bits
=
32
;
audio_format
->
format
=
SAMPLE_FORMAT_S32
;
break
;
case
SAMPLE_FORMAT_S32
:
self
->
info
.
bits
=
32
;
break
;
default:
self
->
info
.
bits
=
16
;
audio_format
->
format
=
SAMPLE_FORMAT_S16
;
}
audio_format
->
reverse_endian
=
0
;
roar_use_audio_format
(
&
self
->
info
,
audio_format
);
if
(
roar_vs_stream
(
self
->
vss
,
&
(
self
->
info
),
ROAR_DIR_PLAY
,
&
(
self
->
err
))
<
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