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
e07073ff
Commit
e07073ff
authored
Oct 06, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_api: move code to _prepare_initial_seek()
.. and add a few code comments.
parent
64b0ba6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
7 deletions
+31
-7
decoder_api.c
src/decoder_api.c
+31
-7
No files found.
src/decoder_api.c
View file @
e07073ff
...
@@ -79,30 +79,54 @@ decoder_initialized(struct decoder *decoder,
...
@@ -79,30 +79,54 @@ decoder_initialized(struct decoder *decoder,
}
}
/**
/**
* Returns the current decoder command. May return a "virtual"
* Checks if we need an "initial seek". If so, then the initial seek
* synthesized command, e.g. to seek to the beginning of the CUE
* is prepared, and the function returns true.
* track.
*/
*/
G_GNUC_PURE
G_GNUC_PURE
static
enum
decoder_command
static
bool
decoder_
get_virtual_command
(
struct
decoder
*
decoder
)
decoder_
prepare_initial_seek
(
struct
decoder
*
decoder
)
{
{
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
assert
(
dc
->
pipe
!=
NULL
);
assert
(
dc
->
pipe
!=
NULL
);
if
(
decoder
->
initial_seek_running
)
if
(
decoder
->
initial_seek_running
)
return
DECODE_COMMAND_SEEK
;
/* initial seek has already begun - override any other
command */
return
true
;
if
(
decoder
->
initial_seek_pending
)
{
if
(
decoder
->
initial_seek_pending
)
{
if
(
dc
->
command
==
DECODE_COMMAND_NONE
)
{
if
(
dc
->
command
==
DECODE_COMMAND_NONE
)
{
/* begin initial seek */
decoder
->
initial_seek_pending
=
false
;
decoder
->
initial_seek_pending
=
false
;
decoder
->
initial_seek_running
=
true
;
decoder
->
initial_seek_running
=
true
;
return
DECODE_COMMAND_SEEK
;
return
true
;
}
}
/* skip initial seek when there's another command
(e.g. STOP) */
decoder
->
initial_seek_pending
=
false
;
decoder
->
initial_seek_pending
=
false
;
}
}
return
false
;
}
/**
* Returns the current decoder command. May return a "virtual"
* synthesized command, e.g. to seek to the beginning of the CUE
* track.
*/
G_GNUC_PURE
static
enum
decoder_command
decoder_get_virtual_command
(
struct
decoder
*
decoder
)
{
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
assert
(
dc
->
pipe
!=
NULL
);
if
(
decoder_prepare_initial_seek
(
decoder
))
return
DECODE_COMMAND_SEEK
;
return
dc
->
command
;
return
dc
->
command
;
}
}
...
...
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