Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
75424d35
Commit
75424d35
authored
May 21, 2002
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/input/input_ext-plugins.c, src/input/input_ext-intf.c: boundary checks
on seek.
parent
be685831
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
src/input/input_ext-intf.c
src/input/input_ext-intf.c
+12
-4
src/input/input_ext-plugins.c
src/input/input_ext-plugins.c
+16
-4
No files found.
src/input/input_ext-intf.c
View file @
75424d35
...
...
@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.3
5 2002/03/05 17:46:33 stef
Exp $
* $Id: input_ext-intf.c,v 1.3
6 2002/05/21 00:23:37 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -130,10 +130,18 @@ void input_Seek( input_thread_t * p_input, off_t i_position )
char
psz_time2
[
OFFSETTOTIME_MAX_SIZE
];
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
p_selected_area
->
i_seek
=
i_position
;
if
(
i_position
<
0
)
{
i_position
=
0
;
}
else
if
(
i_position
>=
p_input
->
stream
.
p_selected_area
->
i_size
)
{
i_position
=
p_input
->
stream
.
p_selected_area
->
i_size
;
}
intf_WarnMsg
(
3
,
"input: seeking position %lld/%lld (%s/%s)"
,
i_position
,
p_input
->
stream
.
p_selected_area
->
i_size
,
p_input
->
stream
.
p_selected_area
->
i_seek
=
i_position
;
intf_WarnMsg
(
3
,
"input: seeking position %lld/%lld (%s/%s)"
,
i_position
,
p_input
->
stream
.
p_selected_area
->
i_size
,
input_OffsetToTime
(
p_input
,
psz_time1
,
i_position
),
input_OffsetToTime
(
p_input
,
psz_time2
,
p_input
->
stream
.
p_selected_area
->
i_size
)
);
...
...
src/input/input_ext-plugins.c
View file @
75424d35
...
...
@@ -2,7 +2,7 @@
* input_ext-plugins.c: useful functions for access and demux plug-ins
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: input_ext-plugins.c,v 1.
9 2002/05/18 17:47:4
7 sam Exp $
* $Id: input_ext-plugins.c,v 1.
10 2002/05/21 00:23:3
7 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -790,13 +790,25 @@ ssize_t input_FDNetworkRead( input_thread_t * p_input, byte_t * p_buffer,
*****************************************************************************/
void
input_FDSeek
(
input_thread_t
*
p_input
,
off_t
i_pos
)
{
#define S p_input->stream
input_socket_t
*
p_access_data
=
(
input_socket_t
*
)
p_input
->
p_access_data
;
lseek
(
p_access_data
->
i_handle
,
i_pos
,
SEEK_SET
);
vlc_mutex_lock
(
&
p_input
->
stream
.
stream_lock
);
p_input
->
stream
.
p_selected_area
->
i_tell
=
i_pos
;
vlc_mutex_unlock
(
&
p_input
->
stream
.
stream_lock
);
vlc_mutex_lock
(
&
S
.
stream_lock
);
S
.
p_selected_area
->
i_tell
=
i_pos
;
if
(
S
.
p_selected_area
->
i_tell
>
S
.
p_selected_area
->
i_size
)
{
intf_ErrMsg
(
"input error: seeking too far"
);
S
.
p_selected_area
->
i_tell
=
S
.
p_selected_area
->
i_size
;
}
else
if
(
S
.
p_selected_area
->
i_tell
<
0
)
{
intf_ErrMsg
(
"input error: seeking too early"
);
S
.
p_selected_area
->
i_tell
=
0
;
}
vlc_mutex_unlock
(
&
S
.
stream_lock
);
#undef S
}
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