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
960b9a96
Commit
960b9a96
authored
Jan 07, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input_stream: add method _cheap_seeking()
Move code from the Vorbis decoder plugin.
parent
acb45caa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
Makefile.am
Makefile.am
+2
-0
VorbisDecoderPlugin.cxx
src/decoder/VorbisDecoderPlugin.cxx
+1
-3
input_stream.c
src/input_stream.c
+7
-0
input_stream.h
src/input_stream.h
+7
-0
No files found.
Makefile.am
View file @
960b9a96
...
...
@@ -1063,6 +1063,7 @@ test_run_input_SOURCES = test/run_input.c \
src/io_thread.c src/io_thread.h
\
src/conf.c src/tokenizer.c src/utils.c src/string_util.c
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx src/TagSave.cxx
\
src/uri.c
\
src/fd_util.c
test_dump_text_file_LDADD
=
\
...
...
@@ -1075,6 +1076,7 @@ test_dump_text_file_SOURCES = test/dump_text_file.c \
src/conf.c src/tokenizer.c src/utils.c src/string_util.c
\
src/Tag.cxx src/TagNames.c src/TagPool.cxx
\
src/text_input_stream.c src/fifo_buffer.c
\
src/uri.c
\
src/fd_util.c
test_dump_playlist_LDADD
=
\
...
...
src/decoder/VorbisDecoderPlugin.cxx
View file @
960b9a96
...
...
@@ -139,9 +139,7 @@ vorbis_is_open(struct vorbis_input_stream *vis, OggVorbis_File *vf,
{
vis
->
decoder
=
decoder
;
vis
->
input_stream
=
input_stream
;
vis
->
seekable
=
input_stream
->
seekable
&&
(
input_stream
->
uri
==
NULL
||
!
uri_has_scheme
(
input_stream
->
uri
));
vis
->
seekable
=
input_stream_cheap_seeking
(
input_stream
);
int
ret
=
ov_open_callbacks
(
vis
,
vf
,
NULL
,
0
,
vorbis_is_callbacks
);
if
(
ret
<
0
)
{
...
...
src/input_stream.c
View file @
960b9a96
...
...
@@ -22,6 +22,7 @@
#include "input_registry.h"
#include "input_plugin.h"
#include "input/rewind_input_plugin.h"
#include "uri.h"
#include <glib.h>
#include <assert.h>
...
...
@@ -115,6 +116,12 @@ input_stream_lock_wait_ready(struct input_stream *is)
}
bool
input_stream_cheap_seeking
(
const
struct
input_stream
*
is
)
{
return
is
->
seekable
&&
(
is
->
uri
==
NULL
||
!
uri_has_scheme
(
is
->
uri
));
}
bool
input_stream_seek
(
struct
input_stream
*
is
,
goffset
offset
,
int
whence
,
GError
**
error_r
)
{
...
...
src/input_stream.h
View file @
960b9a96
...
...
@@ -168,6 +168,13 @@ void
input_stream_lock_wait_ready
(
struct
input_stream
*
is
);
/**
* Determines whether seeking is cheap. This is true for local files.
*/
gcc_pure
gcc_nonnull
(
1
)
bool
input_stream_cheap_seeking
(
const
struct
input_stream
*
is
);
/**
* Seeks to the specified position in the stream. This will most
* likely fail if the "seekable" flag is false.
*
...
...
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