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
08b139f3
Commit
08b139f3
authored
Nov 11, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/flac: use stream_info instead of audio_format
Use the sample rate stored in the stream_info struct instead of the audio_format struct.
parent
3973aeec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
flac_plugin.c
src/decoder/flac_plugin.c
+2
-2
oggflac_plugin.c
src/decoder/oggflac_plugin.c
+2
-2
No files found.
src/decoder/flac_plugin.c
View file @
08b139f3
...
...
@@ -415,7 +415,7 @@ flac_decoder_initialize(struct flac_data *data, FLAC__StreamDecoder *sd,
decoder_initialized
(
data
->
decoder
,
&
data
->
audio_format
,
seekable
,
(
float
)
duration
/
(
float
)
data
->
audio_format
.
sample_rate
);
(
float
)
data
->
stream_info
.
sample_rate
);
return
true
;
}
...
...
@@ -440,7 +440,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
if
(
cmd
==
DECODE_COMMAND_SEEK
)
{
FLAC__uint64
seek_sample
=
t_start
+
decoder_seek_where
(
decoder
)
*
data
->
audio_format
.
sample_rate
;
data
->
stream_info
.
sample_rate
;
if
(
seek_sample
>=
t_start
&&
(
t_end
==
0
||
seek_sample
<=
t_end
)
&&
FLAC__stream_decoder_seek_absolute
(
flac_dec
,
seek_sample
))
{
...
...
src/decoder/oggflac_plugin.c
View file @
08b139f3
...
...
@@ -318,7 +318,7 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
decoder_initialized
(
mpd_decoder
,
&
data
.
audio_format
,
input_stream
->
seekable
,
(
float
)
data
.
stream_info
.
total_samples
/
(
float
)
data
.
audio_format
.
sample_rate
);
(
float
)
data
.
stream_info
.
sample_rate
);
while
(
true
)
{
OggFLAC__seekable_stream_decoder_process_single
(
decoder
);
...
...
@@ -328,7 +328,7 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream)
}
if
(
decoder_get_command
(
mpd_decoder
)
==
DECODE_COMMAND_SEEK
)
{
FLAC__uint64
seek_sample
=
decoder_seek_where
(
mpd_decoder
)
*
data
.
audio_format
.
sample_rate
+
0
.
5
;
data
.
stream_info
.
sample_rate
;
if
(
OggFLAC__seekable_stream_decoder_seek_absolute
(
decoder
,
seek_sample
))
{
data
.
next_frame
=
seek_sample
;
...
...
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