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
37f026a0
Commit
37f026a0
authored
Oct 05, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player_thread: handle SEEK while not playing
parent
f67136df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
NEWS
NEWS
+3
-0
player_thread.c
src/player_thread.c
+10
-2
No files found.
NEWS
View file @
37f026a0
...
@@ -10,6 +10,9 @@ ver 0.16.5 (2010/??/??)
...
@@ -10,6 +10,9 @@ ver 0.16.5 (2010/??/??)
- ffmpeg: higher precision timestamps
- ffmpeg: higher precision timestamps
- ffmpeg: don't require key frame for seeking
- ffmpeg: don't require key frame for seeking
- fix CUE track seeking
- fix CUE track seeking
* player:
- make seeking to CUE track more reliable
- the "seek" command works when MPD is stopped
* WIN32: close sockets properly
* WIN32: close sockets properly
* install systemd service file if systemd is available
* install systemd service file if systemd is available
...
...
src/player_thread.c
View file @
37f026a0
...
@@ -145,8 +145,12 @@ player_dc_start(struct player *player, struct music_pipe *pipe)
...
@@ -145,8 +145,12 @@ player_dc_start(struct player *player, struct music_pipe *pipe)
assert
(
player
->
queued
||
pc
.
command
==
PLAYER_COMMAND_SEEK
);
assert
(
player
->
queued
||
pc
.
command
==
PLAYER_COMMAND_SEEK
);
assert
(
pc
.
next_song
!=
NULL
);
assert
(
pc
.
next_song
!=
NULL
);
unsigned
start_ms
=
pc
.
next_song
->
start_ms
;
if
(
pc
.
command
==
PLAYER_COMMAND_SEEK
)
start_ms
+=
(
unsigned
)(
pc
.
seek_where
*
1000
);
dc_start
(
dc
,
pc
.
next_song
,
dc_start
(
dc
,
pc
.
next_song
,
pc
.
next_song
->
start_ms
,
pc
.
next_song
->
end_ms
,
start_ms
,
pc
.
next_song
->
end_ms
,
player_buffer
,
pipe
);
player_buffer
,
pipe
);
}
}
...
@@ -835,6 +839,10 @@ static void do_play(struct decoder_control *dc)
...
@@ -835,6 +839,10 @@ static void do_play(struct decoder_control *dc)
}
}
player_lock
();
player_lock
();
if
(
pc
.
command
==
PLAYER_COMMAND_SEEK
)
player
.
elapsed_time
=
pc
.
seek_where
;
pc
.
state
=
PLAYER_STATE_PLAY
;
pc
.
state
=
PLAYER_STATE_PLAY
;
player_command_finished_locked
();
player_command_finished_locked
();
...
@@ -1013,6 +1021,7 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
...
@@ -1013,6 +1021,7 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
while
(
1
)
{
while
(
1
)
{
switch
(
pc
.
command
)
{
switch
(
pc
.
command
)
{
case
PLAYER_COMMAND_SEEK
:
case
PLAYER_COMMAND_QUEUE
:
case
PLAYER_COMMAND_QUEUE
:
assert
(
pc
.
next_song
!=
NULL
);
assert
(
pc
.
next_song
!=
NULL
);
...
@@ -1026,7 +1035,6 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
...
@@ -1026,7 +1035,6 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
/* fall through */
/* fall through */
case
PLAYER_COMMAND_SEEK
:
case
PLAYER_COMMAND_PAUSE
:
case
PLAYER_COMMAND_PAUSE
:
pc
.
next_song
=
NULL
;
pc
.
next_song
=
NULL
;
player_command_finished_locked
();
player_command_finished_locked
();
...
...
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