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
ad37c88f
Commit
ad37c88f
authored
Sep 14, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input_plugin: add method update()
Update the struct attributes, important for facades like the "rewind" plugin. To replace buffer().
parent
8c6e8a6e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
0 deletions
+33
-0
rewind_input_plugin.c
src/input/rewind_input_plugin.c
+10
-0
input_plugin.h
src/input_plugin.h
+6
-0
input_stream.c
src/input_stream.c
+10
-0
input_stream.h
src/input_stream.h
+7
-0
No files found.
src/input/rewind_input_plugin.c
View file @
ad37c88f
...
...
@@ -105,6 +105,15 @@ input_rewind_close(struct input_stream *is)
g_free
(
r
);
}
static
void
input_rewind_update
(
struct
input_stream
*
is
)
{
struct
input_rewind
*
r
=
(
struct
input_rewind
*
)
is
;
if
(
!
reading_from_buffer
(
r
))
copy_attributes
(
r
);
}
static
struct
tag
*
input_rewind_tag
(
struct
input_stream
*
is
)
{
...
...
@@ -210,6 +219,7 @@ input_rewind_seek(struct input_stream *is, goffset offset, int whence,
static
const
struct
input_plugin
rewind_input_plugin
=
{
.
close
=
input_rewind_close
,
.
update
=
input_rewind_update
,
.
tag
=
input_rewind_tag
,
.
buffer
=
input_rewind_buffer
,
.
read
=
input_rewind_read
,
...
...
src/input_plugin.h
View file @
ad37c88f
...
...
@@ -51,6 +51,12 @@ struct input_plugin {
struct
input_stream
*
(
*
open
)(
const
char
*
uri
,
GError
**
error_r
);
void
(
*
close
)(
struct
input_stream
*
is
);
/**
* Update the public attributes. Call before access. Can be
* NULL if the plugin always keeps its attributes up to date.
*/
void
(
*
update
)(
struct
input_stream
*
is
);
struct
tag
*
(
*
tag
)(
struct
input_stream
*
is
);
int
(
*
buffer
)(
struct
input_stream
*
is
,
GError
**
error_r
);
size_t
(
*
read
)(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
,
...
...
src/input_stream.c
View file @
ad37c88f
...
...
@@ -67,6 +67,16 @@ input_stream_open(const char *url, GError **error_r)
return
false
;
}
void
input_stream_update
(
struct
input_stream
*
is
)
{
assert
(
is
!=
NULL
);
assert
(
is
->
plugin
!=
NULL
);
if
(
is
->
plugin
->
update
!=
NULL
)
is
->
plugin
->
update
(
is
);
}
bool
input_stream_seek
(
struct
input_stream
*
is
,
goffset
offset
,
int
whence
,
GError
**
error_r
)
...
...
src/input_stream.h
View file @
ad37c88f
...
...
@@ -87,6 +87,13 @@ void
input_stream_close
(
struct
input_stream
*
is
);
/**
* Update the public attributes. Call before accessing attributes
* such as "ready" or "offset".
*/
void
input_stream_update
(
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