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
3b71e2ab
Commit
3b71e2ab
authored
Nov 05, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: call DecoderCommand::SEEK only on existing decoder
If the decoder was just started, it already seeks to the desired position.
parent
30cad0c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
Thread.cxx
src/player/Thread.cxx
+22
-17
No files found.
src/player/Thread.cxx
View file @
3b71e2ab
...
...
@@ -575,6 +575,9 @@ Player::SeekDecoder()
/* re-start the decoder */
StartDecoder
(
*
pipe
);
ActivateDecoder
();
if
(
!
WaitDecoderStartup
())
return
false
;
}
else
{
if
(
!
IsDecoderAtCurrentSong
())
{
/* the decoder is already decoding the "next" song,
...
...
@@ -585,29 +588,31 @@ Player::SeekDecoder()
delete
pc
.
next_song
;
pc
.
next_song
=
nullptr
;
queued
=
false
;
}
/* wait for the decoder to complete initialization */
/* wait for the decoder to complete initialization
(just in case that happens to be still in
progress) */
if
(
!
WaitDecoderStartup
())
return
false
;
if
(
!
WaitDecoderStartup
())
return
false
;
/* send the SEEK command */
/* send the SEEK command */
SongTime
where
=
pc
.
seek_time
;
if
(
!
pc
.
total_time
.
IsNegative
())
{
const
SongTime
total_time
(
pc
.
total_time
);
if
(
where
>
total_time
)
where
=
total_time
;
}
SongTime
where
=
pc
.
seek_time
;
if
(
!
pc
.
total_time
.
IsNegative
())
{
const
SongTime
total_time
(
pc
.
total_time
);
if
(
where
>
total_time
)
where
=
total_time
;
}
if
(
!
dc
.
Seek
(
where
+
start_time
))
{
/* decoder failure */
pc
.
LockCommandFinished
();
return
false
;
}
if
(
!
dc
.
Seek
(
where
+
start_time
))
{
/* decoder failure */
pc
.
LockCommandFinished
();
return
false
;
}
elapsed_time
=
where
;
elapsed_time
=
where
;
}
pc
.
LockCommandFinished
();
...
...
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