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
f275a1a1
Commit
f275a1a1
authored
Apr 12, 2008
by
Eric Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a few more warnings from -Wshadow
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7300
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
4e4441fd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
36 deletions
+38
-36
decode.c
src/decode.c
+4
-4
aac_plugin.c
src/inputPlugins/aac_plugin.c
+11
-12
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+13
-12
wavpack_plugin.c
src/inputPlugins/wavpack_plugin.c
+5
-3
outputBuffer.h
src/outputBuffer.h
+1
-1
player.h
src/player.h
+2
-2
playlist.h
src/playlist.h
+2
-2
No files found.
src/decode.c
View file @
f275a1a1
...
...
@@ -401,7 +401,7 @@ static int playChunk(PlayerControl * pc, OutputBufferChunk * chunk,
static
void
decodeParent
(
PlayerControl
*
pc
,
DecoderControl
*
dc
,
OutputBuffer
*
cb
)
{
int
pause
=
0
;
int
do_
pause
=
0
;
int
buffering
=
1
;
unsigned
int
bbp
=
buffered_before_play
;
/** cross fading enabled for the current song? 0=must check;
...
...
@@ -428,7 +428,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
while
(
1
)
{
processDecodeInput
(
pc
,
dc
,
cb
,
&
pause
,
&
bbp
,
&
doCrossFade
,
&
do_
pause
,
&
bbp
,
&
doCrossFade
,
&
decodeWaitedOn
,
&
next
);
if
(
pc
->
stop
)
{
dropBufferedAudio
();
...
...
@@ -461,7 +461,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
}
else
{
player_wakeup_decoder
();
}
if
(
pause
)
{
if
(
do_
pause
)
{
dropBufferedAudio
();
closeAudioDevice
();
}
...
...
@@ -519,7 +519,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
race conditions and weirdness */
end
=
cb
->
end
;
if
(
pause
)
if
(
do_
pause
)
player_sleep
();
else
if
(
!
outputBufferEmpty
(
cb
)
&&
cb
->
begin
!=
next
)
{
OutputBufferChunk
*
beginChunk
=
...
...
src/inputPlugins/aac_plugin.c
View file @
f275a1a1
...
...
@@ -273,18 +273,18 @@ static float getAacFloatTotalTime(char *file)
static
int
getAacTotalTime
(
char
*
file
)
{
int
time
=
-
1
;
int
file_
time
=
-
1
;
float
length
;
if
((
length
=
getAacFloatTotalTime
(
file
))
>=
0
)
time
=
length
+
0
.
5
;
file_
time
=
length
+
0
.
5
;
return
time
;
return
file_
time
;
}
static
int
aac_decode
(
OutputBuffer
*
cb
,
DecoderControl
*
dc
,
char
*
path
)
{
float
time
;
float
file_
time
;
float
totalTime
;
faacDecHandle
decoder
;
faacDecFrameInfo
frameInfo
;
...
...
@@ -343,7 +343,7 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
dc
->
totalTime
=
totalTime
;
time
=
0
.
0
;
file_
time
=
0
.
0
;
advanceAacBuffer
(
&
b
,
bread
);
...
...
@@ -388,7 +388,7 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
bitRate
=
frameInfo
.
bytesconsumed
*
8
.
0
*
frameInfo
.
channels
*
sampleRate
/
frameInfo
.
samples
/
1000
+
0
.
5
;
time
+=
file_
time
+=
(
float
)(
frameInfo
.
samples
)
/
frameInfo
.
channels
/
sampleRate
;
}
...
...
@@ -396,7 +396,8 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
sampleBufferLen
=
sampleCount
*
2
;
sendDataToOutputBuffer
(
cb
,
NULL
,
dc
,
0
,
sampleBuffer
,
sampleBufferLen
,
time
,
bitRate
,
NULL
);
sampleBufferLen
,
file_time
,
bitRate
,
NULL
);
if
(
dc
->
seek
)
{
dc
->
seekError
=
1
;
dc
->
seek
=
0
;
...
...
@@ -428,14 +429,12 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
static
MpdTag
*
aacTagDup
(
char
*
file
)
{
MpdTag
*
ret
=
NULL
;
int
time
;
int
file_time
=
getAacTotalTime
(
file
)
;
time
=
getAacTotalTime
(
file
);
if
(
time
>=
0
)
{
if
(
file_time
>=
0
)
{
if
((
ret
=
id3Dup
(
file
))
==
NULL
)
ret
=
newMpdTag
();
ret
->
time
=
time
;
ret
->
time
=
file_
time
;
}
else
{
DEBUG
(
"aacTagDup: Failed to get total song time from: %s
\n
"
,
file
);
...
...
src/inputPlugins/mp4_plugin.c
View file @
f275a1a1
...
...
@@ -90,7 +90,7 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
mp4ff_t
*
mp4fh
;
mp4ff_callback_t
*
mp4cb
;
int32_t
track
;
float
time
;
float
file_
time
;
int32_t
scale
;
faacDecHandle
decoder
;
faacDecFrameInfo
frameInfo
;
...
...
@@ -163,7 +163,7 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
dc
->
audioFormat
.
sampleRate
=
sampleRate
;
dc
->
audioFormat
.
channels
=
channels
;
time
=
mp4ff_get_track_duration_use_offsets
(
mp4fh
,
track
);
file_
time
=
mp4ff_get_track_duration_use_offsets
(
mp4fh
,
track
);
scale
=
mp4ff_time_scale
(
mp4fh
,
track
);
if
(
mp4Buffer
)
...
...
@@ -176,11 +176,11 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
free
(
mp4cb
);
return
-
1
;
}
dc
->
totalTime
=
((
float
)
time
)
/
scale
;
dc
->
totalTime
=
((
float
)
file_
time
)
/
scale
;
numSamples
=
mp4ff_num_samples
(
mp4fh
,
track
);
time
=
0
.
0
;
file_
time
=
0
.
0
;
seekTable
=
xmalloc
(
sizeof
(
float
)
*
numSamples
);
...
...
@@ -194,14 +194,14 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
while
(
seekTable
[
i
]
<
dc
->
seekWhere
)
i
++
;
sampleId
=
i
-
1
;
time
=
seekTable
[
sampleId
];
file_
time
=
seekTable
[
sampleId
];
}
dur
=
mp4ff_get_sample_duration
(
mp4fh
,
track
,
sampleId
);
offset
=
mp4ff_get_sample_offset
(
mp4fh
,
track
,
sampleId
);
if
(
sampleId
>
seekTableEnd
)
{
seekTable
[
sampleId
]
=
time
;
seekTable
[
sampleId
]
=
file_
time
;
seekTableEnd
=
sampleId
;
}
...
...
@@ -211,9 +211,9 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
dur
=
0
;
else
dur
-=
offset
;
time
+=
((
float
)
dur
)
/
scale
;
file_
time
+=
((
float
)
dur
)
/
scale
;
if
(
seeking
&&
time
>
dc
->
seekWhere
)
if
(
seeking
&&
file_
time
>
dc
->
seekWhere
)
seekPositionFound
=
1
;
if
(
seeking
&&
seekPositionFound
)
{
...
...
@@ -279,7 +279,8 @@ static int mp4_decode(OutputBuffer * cb, DecoderControl * dc,
sampleBuffer
+=
offset
*
channels
*
2
;
sendDataToOutputBuffer
(
cb
,
inStream
,
dc
,
1
,
sampleBuffer
,
sampleBufferLen
,
time
,
bitRate
,
NULL
);
sampleBufferLen
,
file_time
,
bitRate
,
NULL
);
if
(
dc
->
stop
)
{
eof
=
1
;
break
;
...
...
@@ -311,7 +312,7 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
mp4ff_t
*
mp4fh
;
mp4ff_callback_t
*
cb
;
int32_t
track
;
int32_t
time
;
int32_t
file_
time
;
int32_t
scale
;
int
i
;
...
...
@@ -343,7 +344,7 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
}
ret
=
newMpdTag
();
time
=
mp4ff_get_track_duration_use_offsets
(
mp4fh
,
track
);
file_
time
=
mp4ff_get_track_duration_use_offsets
(
mp4fh
,
track
);
scale
=
mp4ff_time_scale
(
mp4fh
,
track
);
if
(
scale
<
0
)
{
mp4ff_close
(
mp4fh
);
...
...
@@ -352,7 +353,7 @@ static MpdTag *mp4DataDup(char *file, int *mp4MetadataFound)
freeMpdTag
(
ret
);
return
NULL
;
}
ret
->
time
=
((
float
)
time
)
/
scale
+
0
.
5
;
ret
->
time
=
((
float
)
file_
time
)
/
scale
+
0
.
5
;
for
(
i
=
0
;
i
<
mp4ff_meta_get_num_items
(
mp4fh
);
i
++
)
{
char
*
item
;
...
...
src/inputPlugins/wavpack_plugin.c
View file @
f275a1a1
...
...
@@ -133,7 +133,7 @@ static void wavpack_decode(OutputBuffer *cb, DecoderControl *dc,
{
void
(
*
format_samples
)(
int
Bps
,
void
*
buffer
,
uint32_t
samcnt
);
char
chunk
[
CHUNK_SIZE
];
float
time
;
float
file_
time
;
int
samplesreq
,
samplesgot
;
int
allsamples
;
int
position
,
outsamplesize
;
...
...
@@ -204,14 +204,16 @@ static void wavpack_decode(OutputBuffer *cb, DecoderControl *dc,
int
bitrate
=
(
int
)(
WavpackGetInstantBitrate
(
wpc
)
/
1000
+
0
.
5
);
position
+=
samplesgot
;
time
=
(
float
)
position
/
dc
->
audioFormat
.
sampleRate
;
file_time
=
(
float
)
position
/
dc
->
audioFormat
.
sampleRate
;
format_samples
(
Bps
,
chunk
,
samplesgot
*
dc
->
audioFormat
.
channels
);
sendDataToOutputBuffer
(
cb
,
NULL
,
dc
,
0
,
chunk
,
samplesgot
*
outsamplesize
,
time
,
bitrate
,
replayGainInfo
);
file_time
,
bitrate
,
replayGainInfo
);
}
}
while
(
samplesgot
==
samplesreq
);
...
...
src/outputBuffer.h
View file @
f275a1a1
...
...
@@ -94,7 +94,7 @@ int sendDataToOutputBuffer(OutputBuffer * cb,
int
seekable
,
void
*
data
,
size_t
datalen
,
float
time
,
float
data_
time
,
mpd_uint16
bitRate
,
ReplayGainInfo
*
replayGainInfo
);
#endif
src/player.h
View file @
f275a1a1
...
...
@@ -88,7 +88,7 @@ void player_sleep(void);
int
playerPlay
(
int
fd
,
Song
*
song
);
int
playerSetPause
(
int
fd
,
int
pause
);
int
playerSetPause
(
int
fd
,
int
pause
_flag
);
int
playerPause
(
int
fd
);
...
...
@@ -122,7 +122,7 @@ void playerQueueLock(void);
void
playerQueueUnlock
(
void
);
int
playerSeek
(
int
fd
,
Song
*
song
,
float
time
);
int
playerSeek
(
int
fd
,
Song
*
song
,
float
seek_
time
);
void
setPlayerCrossFade
(
float
crossFadeInSeconds
);
...
...
src/playlist.h
View file @
f275a1a1
...
...
@@ -124,9 +124,9 @@ unsigned long getPlaylistVersion(void);
void
playPlaylistIfPlayerStopped
(
void
);
int
seekSongInPlaylist
(
int
fd
,
int
song
,
float
time
);
int
seekSongInPlaylist
(
int
fd
,
int
song
,
float
seek_
time
);
int
seekSongInPlaylistById
(
int
fd
,
int
id
,
float
time
);
int
seekSongInPlaylistById
(
int
fd
,
int
id
,
float
seek_
time
);
void
playlistVersionChange
(
void
);
...
...
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