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
b2819e12
Commit
b2819e12
authored
Apr 12, 2008
by
Max Kellermann
Committed by
Eric Wong
Apr 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make playerData_pd static
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7309
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
288a7087
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
39 deletions
+32
-39
playerData.c
src/playerData.c
+32
-39
No files found.
src/playerData.c
View file @
b2819e12
...
...
@@ -28,7 +28,7 @@ unsigned int buffered_chunks;
#define DEFAULT_BUFFER_SIZE 2048
#define DEFAULT_BUFFER_BEFORE_PLAY 10
static
PlayerData
*
playerData_pd
;
static
PlayerData
playerData_pd
;
void
initPlayerData
(
void
)
{
...
...
@@ -36,7 +36,6 @@ void initPlayerData(void)
char
*
test
;
int
crossfade
=
0
;
size_t
bufferSize
=
DEFAULT_BUFFER_SIZE
;
size_t
allocationSize
;
ConfigParam
*
param
;
size_t
device_array_size
=
audio_device_count
()
*
sizeof
(
mpd_sint8
);
...
...
@@ -74,45 +73,40 @@ void initPlayerData(void)
buffered_before_play
=
buffered_chunks
;
}
/* for playerData struct */
allocationSize
=
sizeof
(
PlayerData
);
playerData_pd
=
xmalloc
(
allocationSize
);
playerData_pd
->
audioDeviceStates
=
xmalloc
(
device_array_size
);
initOutputBuffer
(
&
(
playerData_pd
->
buffer
));
notifyInit
(
&
playerData_pd
->
playerControl
.
notify
);
playerData_pd
->
playerControl
.
stop
=
0
;
playerData_pd
->
playerControl
.
pause
=
0
;
playerData_pd
->
playerControl
.
play
=
0
;
playerData_pd
->
playerControl
.
error
=
PLAYER_ERROR_NOERROR
;
playerData_pd
->
playerControl
.
lockQueue
=
0
;
playerData_pd
->
playerControl
.
unlockQueue
=
0
;
playerData_pd
->
playerControl
.
state
=
PLAYER_STATE_STOP
;
playerData_pd
->
playerControl
.
queueState
=
PLAYER_QUEUE_BLANK
;
playerData_pd
->
playerControl
.
queueLockState
=
PLAYER_QUEUE_UNLOCKED
;
playerData_pd
->
playerControl
.
seek
=
0
;
playerData_pd
->
playerControl
.
closeAudio
=
0
;
playerData_pd
->
playerControl
.
current_song
=
NULL
;
playerData_pd
->
playerControl
.
errored_song
=
NULL
;
playerData_pd
->
playerControl
.
crossFade
=
crossfade
;
playerData_pd
->
playerControl
.
softwareVolume
=
1000
;
playerData_pd
->
playerControl
.
totalPlayTime
=
0
;
notifyInit
(
&
playerData_pd
->
decoderControl
.
notify
);
playerData_pd
->
decoderControl
.
stop
=
0
;
playerData_pd
->
decoderControl
.
start
=
0
;
playerData_pd
->
decoderControl
.
state
=
DECODE_STATE_STOP
;
playerData_pd
->
decoderControl
.
seek
=
0
;
playerData_pd
->
decoderControl
.
error
=
DECODE_ERROR_NOERROR
;
playerData_pd
->
decoderControl
.
current_song
=
NULL
;
playerData_pd
.
audioDeviceStates
=
xmalloc
(
device_array_size
);
initOutputBuffer
(
&
(
playerData_pd
.
buffer
));
notifyInit
(
&
playerData_pd
.
playerControl
.
notify
);
playerData_pd
.
playerControl
.
stop
=
0
;
playerData_pd
.
playerControl
.
pause
=
0
;
playerData_pd
.
playerControl
.
play
=
0
;
playerData_pd
.
playerControl
.
error
=
PLAYER_ERROR_NOERROR
;
playerData_pd
.
playerControl
.
lockQueue
=
0
;
playerData_pd
.
playerControl
.
unlockQueue
=
0
;
playerData_pd
.
playerControl
.
state
=
PLAYER_STATE_STOP
;
playerData_pd
.
playerControl
.
queueState
=
PLAYER_QUEUE_BLANK
;
playerData_pd
.
playerControl
.
queueLockState
=
PLAYER_QUEUE_UNLOCKED
;
playerData_pd
.
playerControl
.
seek
=
0
;
playerData_pd
.
playerControl
.
closeAudio
=
0
;
playerData_pd
.
playerControl
.
current_song
=
NULL
;
playerData_pd
.
playerControl
.
errored_song
=
NULL
;
playerData_pd
.
playerControl
.
crossFade
=
crossfade
;
playerData_pd
.
playerControl
.
softwareVolume
=
1000
;
playerData_pd
.
playerControl
.
totalPlayTime
=
0
;
notifyInit
(
&
playerData_pd
.
decoderControl
.
notify
);
playerData_pd
.
decoderControl
.
stop
=
0
;
playerData_pd
.
decoderControl
.
start
=
0
;
playerData_pd
.
decoderControl
.
state
=
DECODE_STATE_STOP
;
playerData_pd
.
decoderControl
.
seek
=
0
;
playerData_pd
.
decoderControl
.
error
=
DECODE_ERROR_NOERROR
;
playerData_pd
.
decoderControl
.
current_song
=
NULL
;
}
PlayerData
*
getPlayerData
(
void
)
{
return
playerData_pd
;
return
&
playerData_pd
;
}
void
freePlayerData
(
void
)
...
...
@@ -122,6 +116,5 @@ void freePlayerData(void)
* access playerData_pd and we need to keep it available for them */
waitpid
(
-
1
,
NULL
,
0
);
free
(
playerData_pd
->
audioDeviceStates
);
free
(
playerData_pd
);
free
(
playerData_pd
.
audioDeviceStates
);
}
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