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
2403d32a
Commit
2403d32a
authored
Sep 24, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output: set audio_output->open=1 in audio_output_task()
Since the output plugin returns a value indicating success or error, we can have the output core code assign the "open" flag.
parent
3cae6856
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
8 additions
and
39 deletions
+8
-39
audioOutput_alsa.c
src/audioOutputs/audioOutput_alsa.c
+0
-5
audioOutput_ao.c
src/audioOutputs/audioOutput_ao.c
+0
-4
audioOutput_fifo.c
src/audioOutputs/audioOutput_fifo.c
+0
-4
audioOutput_jack.c
src/audioOutputs/audioOutput_jack.c
+1
-4
audioOutput_mvp.c
src/audioOutputs/audioOutput_mvp.c
+0
-2
audioOutput_null.c
src/audioOutputs/audioOutput_null.c
+0
-3
audioOutput_oss.c
src/audioOutputs/audioOutput_oss.c
+0
-5
audioOutput_osx.c
src/audioOutputs/audioOutput_osx.c
+0
-4
audioOutput_pulse.c
src/audioOutputs/audioOutput_pulse.c
+0
-3
audioOutput_shout.c
src/audioOutputs/audioOutput_shout.c
+0
-4
output_thread.c
src/output_thread.c
+7
-1
No files found.
src/audioOutputs/audioOutput_alsa.c
View file @
2403d32a
...
...
@@ -292,8 +292,6 @@ configure_hw:
ad
->
sampleSize
=
audio_format_sample_size
(
audioFormat
)
*
audioFormat
->
channels
;
audioOutput
->
open
=
1
;
DEBUG
(
"ALSA device
\"
%s
\"
will be playing %i bit, %i channel audio at "
"%i Hz
\n
"
,
ad
->
device
,
(
int
)
audioFormat
->
bits
,
channels
,
sampleRate
);
...
...
@@ -312,7 +310,6 @@ fail:
if
(
ad
->
pcmHandle
)
snd_pcm_close
(
ad
->
pcmHandle
);
ad
->
pcmHandle
=
NULL
;
audioOutput
->
open
=
0
;
return
-
1
;
}
...
...
@@ -372,8 +369,6 @@ static void alsa_closeDevice(struct audio_output *audioOutput)
snd_pcm_close
(
ad
->
pcmHandle
);
ad
->
pcmHandle
=
NULL
;
}
audioOutput
->
open
=
0
;
}
static
int
alsa_playAudio
(
struct
audio_output
*
audioOutput
,
...
...
src/audioOutputs/audioOutput_ao.c
View file @
2403d32a
...
...
@@ -171,8 +171,6 @@ static void audioOutputAo_closeDevice(struct audio_output *audioOutput)
ao_close
(
ad
->
device
);
ad
->
device
=
NULL
;
}
audioOutput
->
open
=
0
;
}
static
int
audioOutputAo_openDevice
(
struct
audio_output
*
audioOutput
,
...
...
@@ -195,8 +193,6 @@ static int audioOutputAo_openDevice(struct audio_output *audioOutput,
if
(
ad
->
device
==
NULL
)
return
-
1
;
audioOutput
->
open
=
1
;
return
0
;
}
...
...
src/audioOutputs/audioOutput_fifo.c
View file @
2403d32a
...
...
@@ -201,8 +201,6 @@ static int fifo_openDevice(struct audio_output *audioOutput,
fd
->
timer
=
timer_new
(
audio_format
);
audioOutput
->
open
=
1
;
return
0
;
}
...
...
@@ -214,8 +212,6 @@ static void fifo_closeDevice(struct audio_output *audioOutput)
timer_free
(
fd
->
timer
);
fd
->
timer
=
NULL
;
}
audioOutput
->
open
=
0
;
}
static
void
fifo_dropBufferedAudio
(
struct
audio_output
*
audioOutput
)
...
...
src/audioOutputs/audioOutput_jack.c
View file @
2403d32a
...
...
@@ -363,22 +363,19 @@ static int jack_openDevice(struct audio_output *audioOutput,
if
(
jd
->
client
==
NULL
&&
connect_jack
(
audioOutput
,
audio_format
)
<
0
)
{
freeJackClient
(
jd
);
audioOutput
->
open
=
0
;
return
-
1
;
}
set_audioformat
(
audioOutput
,
audio_format
);
audioOutput
->
open
=
1
;
DEBUG
(
"jack_openDevice (pid=%d)!
\n
"
,
getpid
());
return
0
;
}
static
void
jack_closeDevice
(
struct
audio_output
*
audioOutput
)
static
void
jack_closeDevice
(
mpd_unused
struct
audio_output
*
audioOutput
)
{
/*jack_finishDriver(audioOutput);*/
audioOutput
->
open
=
0
;
DEBUG
(
"jack_closeDevice (pid=%d)
\n
"
,
getpid
());
}
...
...
src/audioOutputs/audioOutput_mvp.c
View file @
2403d32a
...
...
@@ -208,7 +208,6 @@ static int mvp_openDevice(struct audio_output *audioOutput,
mvp_setPcmParams
(
md
,
audioFormat
->
sampleRate
,
audioFormat
->
channels
,
1
,
audioFormat
->
bits
);
#endif
audioOutput
->
open
=
1
;
return
0
;
}
...
...
@@ -218,7 +217,6 @@ static void mvp_closeDevice(struct audio_output *audioOutput)
if
(
md
->
fd
>=
0
)
close
(
md
->
fd
);
md
->
fd
=
-
1
;
audioOutput
->
open
=
0
;
}
static
void
mvp_dropBufferedAudio
(
struct
audio_output
*
audioOutput
)
...
...
src/audioOutputs/audioOutput_null.c
View file @
2403d32a
...
...
@@ -31,7 +31,6 @@ static int null_openDevice(struct audio_output *audioOutput,
struct
audio_format
*
audio_format
)
{
audioOutput
->
data
=
timer_new
(
audio_format
);
audioOutput
->
open
=
1
;
return
0
;
}
...
...
@@ -41,8 +40,6 @@ static void null_closeDevice(struct audio_output *audioOutput)
timer_free
(
audioOutput
->
data
);
audioOutput
->
data
=
NULL
;
}
audioOutput
->
open
=
0
;
}
static
int
null_playAudio
(
struct
audio_output
*
audioOutput
,
...
...
src/audioOutputs/audioOutput_oss.c
View file @
2403d32a
...
...
@@ -471,13 +471,10 @@ static int oss_open(struct audio_output *audioOutput)
goto
fail
;
}
audioOutput
->
open
=
1
;
return
0
;
fail:
oss_close
(
od
);
audioOutput
->
open
=
0
;
return
-
1
;
}
...
...
@@ -509,8 +506,6 @@ static void oss_closeDevice(struct audio_output *audioOutput)
OssData
*
od
=
audioOutput
->
data
;
oss_close
(
od
);
audioOutput
->
open
=
0
;
}
static
void
oss_dropBufferedAudio
(
struct
audio_output
*
audioOutput
)
...
...
src/audioOutputs/audioOutput_osx.c
View file @
2403d32a
...
...
@@ -132,8 +132,6 @@ static void osx_closeDevice(struct audio_output *audioOutput)
CloseComponent
(
od
->
au
);
AudioUnitUninitialize
(
od
->
au
);
audioOutput
->
open
=
0
;
}
static
OSStatus
osx_render
(
void
*
vdata
,
...
...
@@ -292,8 +290,6 @@ static int osx_openDevice(struct audio_output *audioOutput,
od
->
pos
=
0
;
od
->
len
=
0
;
audioOutput
->
open
=
1
;
return
0
;
}
...
...
src/audioOutputs/audioOutput_pulse.c
View file @
2403d32a
...
...
@@ -149,7 +149,6 @@ static int pulse_openDevice(struct audio_output *audioOutput,
}
pd
->
connAttempts
=
0
;
audioOutput
->
open
=
1
;
DEBUG
(
"PulseAudio output
\"
%s
\"
connected and playing %i bit, %i "
"channel audio at %i Hz
\n
"
,
audioOutput
->
name
,
audioFormat
->
bits
,
...
...
@@ -178,8 +177,6 @@ static void pulse_closeDevice(struct audio_output *audioOutput)
pa_simple_drain
(
pd
->
s
,
NULL
);
pa_simple_free
(
pd
->
s
);
}
audioOutput
->
open
=
0
;
}
static
int
pulse_playAudio
(
struct
audio_output
*
audioOutput
,
...
...
src/audioOutputs/audioOutput_shout.c
View file @
2403d32a
...
...
@@ -358,8 +358,6 @@ static void my_shout_close_device(struct audio_output *audio_output)
timer_free
(
sd
->
timer
);
sd
->
timer
=
NULL
;
}
audio_output
->
open
=
0
;
}
static
int
shout_connect
(
struct
shout_data
*
sd
)
...
...
@@ -455,8 +453,6 @@ static int my_shout_open_device(struct audio_output *audio_output,
sd
->
timer
=
timer_new
(
audio_format
);
audio_output
->
open
=
1
;
return
0
;
}
...
...
src/output_thread.c
View file @
2403d32a
...
...
@@ -75,13 +75,19 @@ static void *audio_output_task(void *arg)
case
AO_COMMAND_OPEN
:
assert
(
!
ao
->
open
);
ao
->
plugin
->
open
(
ao
,
&
ao
->
outAudioFormat
);
ao
->
result
=
ao
->
plugin
->
open
(
ao
,
&
ao
->
outAudioFormat
);
assert
(
!
ao
->
open
);
if
(
ao
->
result
==
0
)
ao
->
open
=
1
;
ao_command_finished
(
ao
);
break
;
case
AO_COMMAND_CLOSE
:
assert
(
ao
->
open
);
ao
->
plugin
->
close
(
ao
);
ao
->
open
=
0
;
ao_command_finished
(
ao
);
break
;
...
...
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