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
26f0f922
Commit
26f0f922
authored
Aug 26, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/opus: use integer seek times
parent
bdc4ae2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
OpusDecoderPlugin.cxx
src/decoder/plugins/OpusDecoderPlugin.cxx
+4
-4
No files found.
src/decoder/plugins/OpusDecoderPlugin.cxx
View file @
26f0f922
...
@@ -99,7 +99,7 @@ public:
...
@@ -99,7 +99,7 @@ public:
DecoderCommand
HandleTags
(
const
ogg_packet
&
packet
);
DecoderCommand
HandleTags
(
const
ogg_packet
&
packet
);
DecoderCommand
HandleAudio
(
const
ogg_packet
&
packet
);
DecoderCommand
HandleAudio
(
const
ogg_packet
&
packet
);
bool
Seek
(
OggSyncState
&
oy
,
double
wher
e
);
bool
Seek
(
OggSyncState
&
oy
,
uint64_t
where_fram
e
);
};
};
MPDOpusDecoder
::~
MPDOpusDecoder
()
MPDOpusDecoder
::~
MPDOpusDecoder
()
...
@@ -328,13 +328,13 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
...
@@ -328,13 +328,13 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
}
}
bool
bool
MPDOpusDecoder
::
Seek
(
OggSyncState
&
oy
,
double
where_s
)
MPDOpusDecoder
::
Seek
(
OggSyncState
&
oy
,
uint64_t
where_frame
)
{
{
assert
(
eos_granulepos
>
0
);
assert
(
eos_granulepos
>
0
);
assert
(
input_stream
.
IsSeekable
());
assert
(
input_stream
.
IsSeekable
());
assert
(
input_stream
.
KnownSize
());
assert
(
input_stream
.
KnownSize
());
const
ogg_int64_t
where_granulepos
(
where_
s
*
opus_sample_rat
e
);
const
ogg_int64_t
where_granulepos
(
where_
fram
e
);
/* interpolate the file offset where we expect to find the
/* interpolate the file offset where we expect to find the
given granule position */
given granule position */
...
@@ -365,7 +365,7 @@ mpd_opus_stream_decode(Decoder &decoder,
...
@@ -365,7 +365,7 @@ mpd_opus_stream_decode(Decoder &decoder,
while
(
true
)
{
while
(
true
)
{
auto
cmd
=
d
.
HandlePackets
();
auto
cmd
=
d
.
HandlePackets
();
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
if
(
d
.
Seek
(
oy
,
decoder_seek_where
(
decoder
)))
if
(
d
.
Seek
(
oy
,
decoder_seek_where
_frame
(
decoder
)))
decoder_command_finished
(
decoder
);
decoder_command_finished
(
decoder
);
else
else
decoder_seek_error
(
decoder
);
decoder_seek_error
(
decoder
);
...
...
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