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
4f56fdc3
Commit
4f56fdc3
authored
Aug 03, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mad: make "current_frame" zero-based
Increment "current_frame" after processing the frame.
parent
c87d6825
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
MadDecoderPlugin.cxx
src/decoder/plugins/MadDecoderPlugin.cxx
+6
-5
No files found.
src/decoder/plugins/MadDecoderPlugin.cxx
View file @
4f56fdc3
...
...
@@ -863,7 +863,7 @@ MadDecoder::SyncAndSend() noexcept
drop_start_frames
--
;
return
DecoderCommand
::
NONE
;
}
else
if
((
drop_end_frames
>
0
)
&&
(
current_frame
==
(
max_frames
+
1
-
drop_end_frames
))
)
{
current_frame
==
max_frames
-
drop_end_frames
)
{
/* stop decoding, effectively dropping all remaining
frames */
return
DecoderCommand
::
STOP
;
...
...
@@ -877,7 +877,7 @@ MadDecoder::SyncAndSend() noexcept
unsigned
pcm_length
=
synth
.
pcm
.
length
;
if
(
drop_end_samples
&&
(
current_frame
==
max_frames
-
drop_end_frames
)
)
{
current_frame
==
max_frames
-
drop_end_frames
-
1
)
{
if
(
drop_end_samples
>=
pcm_length
)
pcm_length
=
0
;
else
...
...
@@ -889,7 +889,7 @@ MadDecoder::SyncAndSend() noexcept
return
cmd
;
if
(
drop_end_samples
&&
(
current_frame
==
max_frames
-
drop_end_frames
)
)
current_frame
==
max_frames
-
drop_end_frames
-
1
)
/* stop decoding, effectively dropping
* all remaining samples */
return
DecoderCommand
::
STOP
;
...
...
@@ -900,20 +900,21 @@ MadDecoder::SyncAndSend() noexcept
inline
bool
MadDecoder
::
Read
()
noexcept
{
UpdateTimerNextFrame
();
switch
(
mute_frame
)
{
DecoderCommand
cmd
;
case
MadDecoderMuteFrame
:
:
SKIP
:
mute_frame
=
MadDecoderMuteFrame
::
NONE
;
UpdateTimerNextFrame
();
break
;
case
MadDecoderMuteFrame
:
:
SEEK
:
if
(
elapsed_time
>=
seek_time
)
mute_frame
=
MadDecoderMuteFrame
::
NONE
;
UpdateTimerNextFrame
();
break
;
case
MadDecoderMuteFrame
:
:
NONE
:
cmd
=
SyncAndSend
();
UpdateTimerNextFrame
();
if
(
cmd
==
DecoderCommand
::
SEEK
)
{
assert
(
input_stream
.
IsSeekable
());
...
...
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