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
9ae3acf2
Commit
9ae3acf2
authored
Jan 21, 2011
by
Yuriy Kaminskiy
Committed by
Max Kellermann
Jan 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpg123 decoder: implement seeking
parent
731ea9b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
NEWS
NEWS
+2
-0
mpg123_decoder_plugin.c
src/decoder/mpg123_decoder_plugin.c
+14
-2
No files found.
NEWS
View file @
9ae3acf2
ver 0.17 (2010/??/??)
* input:
- cdio_paranoia: new input plugin to play audio CDs
* decoder:
- mpg123: implement seeking
* output:
- osx: allow user to specify other audio devices
...
...
src/decoder/mpg123_decoder_plugin.c
View file @
9ae3acf2
...
...
@@ -24,6 +24,7 @@
#include <glib.h>
#include <mpg123.h>
#include <stdio.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "mpg123"
...
...
@@ -125,7 +126,7 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
/* tell MPD core we're ready */
decoder_initialized
(
decoder
,
&
audio_format
,
fals
e
,
decoder_initialized
(
decoder
,
&
audio_format
,
tru
e
,
(
float
)
num_samples
/
(
float
)
audio_format
.
sample_rate
);
...
...
@@ -172,7 +173,18 @@ mpd_mpg123_file_decode(struct decoder *decoder, const char *path_fs)
cmd
=
decoder_data
(
decoder
,
NULL
,
buffer
,
nbytes
,
info
.
bitrate
);
/* seeking not yet implemented */
if
(
cmd
==
DECODE_COMMAND_SEEK
)
{
off_t
c
=
decoder_seek_where
(
decoder
)
*
audio_format
.
sample_rate
;
c
=
mpg123_seek
(
handle
,
c
,
SEEK_SET
);
if
(
c
<
0
)
decoder_seek_error
(
decoder
);
else
{
decoder_command_finished
(
decoder
);
decoder_timestamp
(
decoder
,
c
/
(
double
)
audio_format
.
sample_rate
);
}
cmd
=
DECODE_COMMAND_NONE
;
}
}
while
(
cmd
==
DECODE_COMMAND_NONE
);
/* cleanup */
...
...
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