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
be90199c
Commit
be90199c
authored
Oct 29, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_api: removed decoder_clear()
Call ob_clear() in decoder_command_finished() instead of implementing that call in every decoder plugin.
parent
d6c4441c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
7 additions
and
23 deletions
+7
-23
audiofile_plugin.c
src/decoder/audiofile_plugin.c
+0
-1
ffmpeg_plugin.c
src/decoder/ffmpeg_plugin.c
+0
-1
flac_plugin.c
src/decoder/flac_plugin.c
+0
-1
mp3_plugin.c
src/decoder/mp3_plugin.c
+1
-5
mp4_plugin.c
src/decoder/mp4_plugin.c
+2
-4
mpc_plugin.c
src/decoder/mpc_plugin.c
+0
-1
oggvorbis_plugin.c
src/decoder/oggvorbis_plugin.c
+0
-1
wavpack_plugin.c
src/decoder/wavpack_plugin.c
+0
-2
decoder_api.c
src/decoder_api.c
+4
-5
decoder_api.h
src/decoder_api.h
+0
-2
No files found.
src/decoder/audiofile_plugin.c
View file @
be90199c
...
...
@@ -92,7 +92,6 @@ static int audiofile_decode(struct decoder * decoder, char *path)
do
{
if
(
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_SEEK
)
{
decoder_clear
(
decoder
);
current
=
decoder_seek_where
(
decoder
)
*
audio_format
.
sample_rate
;
afSeekFrame
(
af_fp
,
AF_DEFAULT_TRACK
,
current
);
...
...
src/decoder/ffmpeg_plugin.c
View file @
be90199c
...
...
@@ -271,7 +271,6 @@ static int ffmpeg_decode_internal(BasePtrs *base)
if
(
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_SEEK
)
{
DEBUG
(
"seek
\n
"
);
decoder_clear
(
decoder
);
current
=
decoder_seek_where
(
decoder
)
*
AV_TIME_BASE
;
if
(
av_seek_frame
(
pFormatCtx
,
-
1
,
current
,
0
)
<
0
)
{
...
...
src/decoder/flac_plugin.c
View file @
be90199c
...
...
@@ -349,7 +349,6 @@ flac_decode_internal(struct decoder * decoder, struct input_stream *inStream,
FLAC__uint64
sampleToSeek
=
decoder_seek_where
(
decoder
)
*
data
.
audio_format
.
sample_rate
+
0
.
5
;
if
(
flac_seek_absolute
(
flacDec
,
sampleToSeek
))
{
decoder_clear
(
decoder
);
data
.
time
=
((
float
)
sampleToSeek
)
/
data
.
audio_format
.
sample_rate
;
data
.
position
=
0
;
...
...
src/decoder/mp3_plugin.c
View file @
be90199c
...
...
@@ -1018,7 +1018,6 @@ mp3_read(struct mp3_data *data, ReplayGainInfo **replay_gain_info_r)
decoder_seek_where
(
decoder
));
if
(
j
<
data
->
highest_frame
)
{
if
(
mp3_seek
(
data
,
data
->
frame_offsets
[
j
]))
{
decoder_clear
(
decoder
);
data
->
current_frame
=
j
;
decoder_command_finished
(
decoder
);
}
else
...
...
@@ -1026,7 +1025,6 @@ mp3_read(struct mp3_data *data, ReplayGainInfo **replay_gain_info_r)
}
else
{
data
->
seek_where
=
decoder_seek_where
(
decoder
);
data
->
mute_frame
=
MUTEFRAME_SEEK
;
decoder_clear
(
decoder
);
decoder_command_finished
(
decoder
);
}
}
...
...
@@ -1130,10 +1128,8 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
freeReplayGainInfo
(
replay_gain_info
);
if
(
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_SEEK
&&
data
.
mute_frame
==
MUTEFRAME_SEEK
)
{
decoder_clear
(
decoder
);
data
.
mute_frame
==
MUTEFRAME_SEEK
)
decoder_command_finished
(
decoder
);
}
decoder_flush
(
decoder
);
mp3_data_finish
(
&
data
);
...
...
src/decoder/mp4_plugin.c
View file @
be90199c
...
...
@@ -224,7 +224,6 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
if
(
seeking
&&
seekPositionFound
)
{
seekPositionFound
=
false
;
decoder_clear
(
mpd_decoder
);
seeking
=
0
;
decoder_command_finished
(
mpd_decoder
);
}
...
...
@@ -296,10 +295,9 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
if
(
!
initialized
)
return
-
1
;
if
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_SEEK
&&
seeking
)
{
decoder_clear
(
mpd_decoder
);
if
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_SEEK
&&
seeking
)
decoder_command_finished
(
mpd_decoder
);
}
decoder_flush
(
mpd_decoder
);
return
0
;
...
...
src/decoder/mpc_plugin.c
View file @
be90199c
...
...
@@ -168,7 +168,6 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
samplePos
=
decoder_seek_where
(
mpd_decoder
)
*
audio_format
.
sample_rate
;
if
(
mpc_decoder_seek_sample
(
&
decoder
,
samplePos
))
{
decoder_clear
(
mpd_decoder
);
s16
=
(
int16_t
*
)
chunk
;
chunkpos
=
0
;
decoder_command_finished
(
mpd_decoder
);
...
...
src/decoder/oggvorbis_plugin.c
View file @
be90199c
...
...
@@ -261,7 +261,6 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
if
(
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_SEEK
)
{
double
seek_where
=
decoder_seek_where
(
decoder
);
if
(
0
==
ov_time_seek_page
(
&
vf
,
seek_where
))
{
decoder_clear
(
decoder
);
chunkpos
=
0
;
decoder_command_finished
(
decoder
);
}
else
...
...
src/decoder/wavpack_plugin.c
View file @
be90199c
...
...
@@ -174,8 +174,6 @@ static void wavpack_decode(struct decoder * decoder,
if
(
canseek
)
{
int
where
;
decoder_clear
(
decoder
);
where
=
decoder_seek_where
(
decoder
)
*
audio_format
.
sample_rate
;
if
(
WavpackSeekSample
(
wpc
,
where
))
{
...
...
src/decoder_api.c
View file @
be90199c
...
...
@@ -77,6 +77,10 @@ void decoder_command_finished(mpd_unused struct decoder * decoder)
assert
(
dc
.
command
!=
DECODE_COMMAND_SEEK
||
dc
.
seekError
||
decoder
->
seeking
);
if
(
dc
.
command
==
DECODE_COMMAND_SEEK
)
/* delete frames from the old song position */
ob_clear
();
dc
.
command
=
DECODE_COMMAND_NONE
;
notify_signal
(
&
pc
.
notify
);
}
...
...
@@ -209,8 +213,3 @@ void decoder_flush(mpd_unused struct decoder *decoder)
{
ob_flush
();
}
void
decoder_clear
(
mpd_unused
struct
decoder
*
decoder
)
{
ob_clear
();
}
src/decoder_api.h
View file @
be90199c
...
...
@@ -161,6 +161,4 @@ decoder_data(struct decoder *decoder,
void
decoder_flush
(
struct
decoder
*
decoder
);
void
decoder_clear
(
struct
decoder
*
decoder
);
#endif
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