Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
994a2555
Commit
994a2555
authored
Sep 01, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream: put stream_Seek() out of line
parent
b1082a5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
26 deletions
+32
-26
include/vlc_stream.h
include/vlc_stream.h
+8
-6
src/input/stream.c
src/input/stream.c
+23
-20
src/libvlccore.sym
src/libvlccore.sym
+1
-0
No files found.
include/vlc_stream.h
View file @
994a2555
...
@@ -82,7 +82,6 @@ enum stream_query_e
...
@@ -82,7 +82,6 @@ enum stream_query_e
STREAM_CAN_PAUSE
,
/**< arg1= bool * res=cannot fail*/
STREAM_CAN_PAUSE
,
/**< arg1= bool * res=cannot fail*/
STREAM_CAN_CONTROL_PACE
,
/**< arg1= bool * res=cannot fail*/
STREAM_CAN_CONTROL_PACE
,
/**< arg1= bool * res=cannot fail*/
/* */
/* */
STREAM_SET_POSITION
,
/**< arg1= uint64_t res=can fail */
STREAM_GET_SIZE
=
6
,
/**< arg1= uint64_t * res=can fail */
STREAM_GET_SIZE
=
6
,
/**< arg1= uint64_t * res=can fail */
STREAM_IS_DIRECTORY
,
/**< arg1= bool *, arg2= bool *, arg3=bool *, res=cannot fail*/
STREAM_IS_DIRECTORY
,
/**< arg1= bool *, arg2= bool *, arg3=bool *, res=cannot fail*/
...
@@ -148,6 +147,14 @@ VLC_API ssize_t stream_Peek(stream_t *, const uint8_t **, size_t) VLC_USED;
...
@@ -148,6 +147,14 @@ VLC_API ssize_t stream_Peek(stream_t *, const uint8_t **, size_t) VLC_USED;
*/
*/
VLC_API
uint64_t
stream_Tell
(
const
stream_t
*
)
VLC_USED
;
VLC_API
uint64_t
stream_Tell
(
const
stream_t
*
)
VLC_USED
;
/**
* Sets the current stream position.
*
* @param offset byte offset from the beginning of the stream
* @return zero on success, a negative value on error
*/
VLC_API
int
stream_Seek
(
stream_t
*
,
uint64_t
offset
)
VLC_USED
;
VLC_API
int
stream_vaControl
(
stream_t
*
s
,
int
i_query
,
va_list
args
);
VLC_API
int
stream_vaControl
(
stream_t
*
s
,
int
i_query
,
va_list
args
);
VLC_API
void
stream_Delete
(
stream_t
*
s
);
VLC_API
void
stream_Delete
(
stream_t
*
s
);
VLC_API
int
stream_Control
(
stream_t
*
s
,
int
i_query
,
...
);
VLC_API
int
stream_Control
(
stream_t
*
s
,
int
i_query
,
...
);
...
@@ -174,11 +181,6 @@ static inline int64_t stream_Size( stream_t *s )
...
@@ -174,11 +181,6 @@ static inline int64_t stream_Size( stream_t *s )
return
i_pos
;
return
i_pos
;
}
}
static
inline
int
stream_Seek
(
stream_t
*
s
,
uint64_t
i_pos
)
{
return
stream_Control
(
s
,
STREAM_SET_POSITION
,
i_pos
);
}
/**
/**
* Get the Content-Type of a stream, or NULL if unknown.
* Get the Content-Type of a stream, or NULL if unknown.
* Result must be free()'d.
* Result must be free()'d.
...
...
src/input/stream.c
View file @
994a2555
...
@@ -445,6 +445,29 @@ uint64_t stream_Tell(const stream_t *s)
...
@@ -445,6 +445,29 @@ uint64_t stream_Tell(const stream_t *s)
return
pos
;
return
pos
;
}
}
int
stream_Seek
(
stream_t
*
s
,
uint64_t
offset
)
{
stream_priv_t
*
priv
=
(
stream_priv_t
*
)
s
;
if
(
s
->
pf_seek
==
NULL
)
return
VLC_EGENERIC
;
int
ret
=
s
->
pf_seek
(
s
,
offset
);
if
(
ret
!=
VLC_SUCCESS
)
return
ret
;
priv
->
offset
=
offset
;
block_t
*
peek
=
priv
->
peek
;
if
(
peek
!=
NULL
)
{
priv
->
peek
=
NULL
;
block_Release
(
peek
);
}
return
ret
;
}
static
int
stream_ControlInternal
(
stream_t
*
s
,
int
cmd
,
...)
static
int
stream_ControlInternal
(
stream_t
*
s
,
int
cmd
,
...)
{
{
va_list
ap
;
va_list
ap
;
...
@@ -467,26 +490,6 @@ int stream_vaControl(stream_t *s, int cmd, va_list args)
...
@@ -467,26 +490,6 @@ int stream_vaControl(stream_t *s, int cmd, va_list args)
switch
(
cmd
)
switch
(
cmd
)
{
{
case
STREAM_SET_POSITION
:
{
uint64_t
pos
=
va_arg
(
args
,
uint64_t
);
if
(
s
->
pf_seek
==
NULL
)
return
VLC_EGENERIC
;
int
ret
=
s
->
pf_seek
(
s
,
pos
);
if
(
ret
!=
VLC_SUCCESS
)
return
ret
;
if
(
priv
->
peek
!=
NULL
)
{
block_Release
(
priv
->
peek
);
priv
->
peek
=
NULL
;
}
priv
->
offset
=
pos
;
return
VLC_SUCCESS
;
}
case
STREAM_GET_PRIVATE_BLOCK
:
case
STREAM_GET_PRIVATE_BLOCK
:
{
{
block_t
**
b
=
va_arg
(
args
,
block_t
**
);
block_t
**
b
=
va_arg
(
args
,
block_t
**
);
...
...
src/libvlccore.sym
View file @
994a2555
...
@@ -403,6 +403,7 @@ stream_MemoryNew
...
@@ -403,6 +403,7 @@ stream_MemoryNew
stream_Peek
stream_Peek
stream_Read
stream_Read
stream_ReadLine
stream_ReadLine
stream_Seek
stream_Tell
stream_Tell
stream_UrlNew
stream_UrlNew
stream_vaControl
stream_vaControl
...
...
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