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
76ae0951
Commit
76ae0951
authored
Aug 22, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: use stream_Seek/Size/Tell wrappers.
parent
233ac074
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
27 deletions
+24
-27
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+8
-11
modules/demux/asf/libasf.c
modules/demux/asf/libasf.c
+6
-5
modules/demux/au.c
modules/demux/au.c
+4
-5
modules/demux/wav.c
modules/demux/wav.c
+6
-6
No files found.
modules/demux/asf/asf.c
View file @
76ae0951
...
...
@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: asf.c,v 1.3
4 2003/08/18 19:18:4
7 fenrir Exp $
* $Id: asf.c,v 1.3
5 2003/08/22 20:32:2
7 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -317,26 +317,25 @@ static int Open( vlc_object_t * p_this )
p_sys
->
i_data_begin
=
p_sys
->
p_root
->
p_data
->
i_object_pos
+
50
;
if
(
p_sys
->
p_root
->
p_data
->
i_object_size
!=
0
)
{
/
/ local file
{
/
* local file */
p_sys
->
i_data_end
=
p_sys
->
p_root
->
p_data
->
i_object_pos
+
p_sys
->
p_root
->
p_data
->
i_object_size
;
}
else
{
/
/ live/broacast
{
/
* live/broacast */
p_sys
->
i_data_end
=
-
1
;
}
/
/ go to first packet
stream_
Control
(
p_sys
->
s
,
STREAM_SET_POSITION
,
(
int64_t
)
p_sys
->
i_data_begin
);
/
* go to first packet */
stream_
Seek
(
p_sys
->
s
,
p_sys
->
i_data_begin
);
/* try to calculate movie time */
if
(
p_sys
->
p_fp
->
i_data_packets_count
>
0
)
{
int64_t
i_count
;
int64_t
i_size
;
int64_t
i_size
=
stream_Tell
(
p_sys
->
s
)
;
stream_Control
(
p_sys
->
s
,
STREAM_GET_SIZE
,
&
i_size
);
if
(
p_sys
->
i_data_end
>
0
&&
i_size
>
p_sys
->
i_data_end
)
{
i_size
=
p_sys
->
i_data_end
;
...
...
@@ -487,8 +486,7 @@ static int Demux( input_thread_t *p_input )
msleep
(
p_input
->
i_pts_delay
);
stream_Control
(
p_sys
->
s
,
STREAM_GET_POSITION
,
&
i_offset
);
i_offset
-=
p_sys
->
i_data_begin
;
i_offset
=
stream_Tell
(
p_sys
->
s
)
-
p_sys
->
i_data_begin
;
if
(
i_offset
<
0
)
{
i_offset
=
0
;
...
...
@@ -497,9 +495,8 @@ static int Demux( input_thread_t *p_input )
{
i_offset
-=
i_offset
%
p_sys
->
p_fp
->
i_min_data_packet_size
;
}
i_offset
+=
p_sys
->
i_data_begin
;
if
(
stream_
Control
(
p_sys
->
s
,
STREAM_SET_POSITION
,
i_offset
)
)
if
(
stream_
Seek
(
p_sys
->
s
,
i_offset
+
p_sys
->
i_data_begin
)
)
{
msg_Warn
(
p_input
,
"cannot resynch after seek (EOF?)"
);
return
-
1
;
...
...
modules/demux/asf/libasf.c
View file @
76ae0951
...
...
@@ -2,7 +2,7 @@
* libasf.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.c,v 1.1
5 2003/08/18 19:18:4
7 fenrir Exp $
* $Id: libasf.c,v 1.1
6 2003/08/22 20:32:2
7 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -86,7 +86,7 @@ static int ASF_ReadObjectCommon( stream_t *s, asf_object_t *p_obj )
}
ASF_GetGUID
(
&
p_common
->
i_object_id
,
p_peek
);
p_common
->
i_object_size
=
GetQWLE
(
p_peek
+
16
);
stream_Control
(
s
,
STREAM_GET_POSITION
,
&
p_common
->
i_object_po
s
);
p_common
->
i_object_pos
=
stream_Tell
(
s
);
p_common
->
p_next
=
NULL
;
#ifdef ASF_DEBUG
msg_Dbg
(
(
vlc_object_t
*
)
s
,
...
...
@@ -125,8 +125,9 @@ static int ASF_NextObject( stream_t *s, asf_object_t *p_obj )
}
return
(
stream_Control
(
s
,
STREAM_SET_POSITION
,
p_obj
->
common
.
i_object_pos
+
p_obj
->
common
.
i_object_size
)
);
return
stream_Seek
(
s
,
p_obj
->
common
.
i_object_pos
+
p_obj
->
common
.
i_object_size
);
}
static
void
ASF_FreeObject_Null
(
asf_object_t
*
pp_obj
)
...
...
@@ -721,7 +722,7 @@ asf_object_root_t *ASF_ReadObjectRoot( stream_t *s, int b_seekable )
p_root
->
i_type
=
ASF_OBJECT_TYPE_ROOT
;
memcpy
(
&
p_root
->
i_object_id
,
&
asf_object_null_guid
,
sizeof
(
guid_t
)
);
p_root
->
i_object_pos
=
0
;
stream_Control
(
s
,
STREAM_GET_SIZE
,
&
p_root
->
i_object_size
);
p_root
->
i_object_size
=
stream_Tell
(
s
);
p_root
->
p_first
=
NULL
;
p_root
->
p_last
=
NULL
;
p_root
->
p_next
=
NULL
;
...
...
modules/demux/au.c
View file @
76ae0951
...
...
@@ -2,7 +2,7 @@
* au.c : au file input module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: au.c,v 1.
4 2003/08/17 23:02:52
fenrir Exp $
* $Id: au.c,v 1.
5 2003/08/22 20:32:27
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -376,15 +376,14 @@ static int DemuxPCM( input_thread_t *p_input )
if
(
p_input
->
stream
.
p_selected_program
->
i_synchro_state
==
SYNCHRO_REINIT
)
{
int64_t
i_pos
;
int64_t
i_pos
=
stream_Tell
(
p_sys
->
s
)
;
stream_Control
(
p_sys
->
s
,
STREAM_GET_POSITION
,
&
i_pos
);
if
(
p_sys
->
wf
.
nBlockAlign
!=
0
)
{
i_pos
+=
p_sys
->
wf
.
nBlockAlign
-
i_pos
%
p_sys
->
wf
.
nBlockAlign
;
if
(
stream_
Control
(
p_sys
->
s
,
STREAM_SET_POSITION
,
i_pos
)
)
if
(
stream_
Seek
(
p_sys
->
s
,
i_pos
)
)
{
msg_Err
(
p_input
,
"S
TREAM_SET_POSITION failed
(cannot resync)"
);
msg_Err
(
p_input
,
"S
eek failed
(cannot resync)"
);
}
}
}
...
...
modules/demux/wav.c
View file @
76ae0951
...
...
@@ -2,7 +2,7 @@
* wav.c : wav file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: wav.c,v 1.
4 2003/08/18 00:17:44
fenrir Exp $
* $Id: wav.c,v 1.
5 2003/08/22 20:32:27
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -164,7 +164,7 @@ static int Open( vlc_object_t * p_this )
goto
error
;
}
stream_Control
(
p_sys
->
s
,
STREAM_GET_POSITION
,
&
p_sys
->
i_data_po
s
);
p_sys
->
i_data_pos
=
stream_Tell
(
p_sys
->
s
);
stream_Read
(
p_sys
->
s
,
NULL
,
8
);
/* cannot fail */
...
...
@@ -276,13 +276,13 @@ static int Demux( input_thread_t *p_input )
if
(
p_input
->
stream
.
p_selected_program
->
i_synchro_state
==
SYNCHRO_REINIT
)
{
stream_Control
(
p_sys
->
s
,
STREAM_GET_POSITION
,
&
i_po
s
);
i_pos
=
stream_Tell
(
p_sys
->
s
);
if
(
p_sys
->
p_wf
->
nBlockAlign
!=
0
)
{
i_pos
+=
p_sys
->
p_wf
->
nBlockAlign
-
i_pos
%
p_sys
->
p_wf
->
nBlockAlign
;
if
(
stream_
Control
(
p_sys
->
s
,
STREAM_SET_POSITION
,
i_pos
)
)
if
(
stream_
Seek
(
p_sys
->
s
,
i_pos
)
)
{
msg_Err
(
p_input
,
"
STREAM_SET_POSITION
failed (cannot resync)"
);
msg_Err
(
p_input
,
"
stream_Sekk
failed (cannot resync)"
);
}
}
}
...
...
@@ -291,7 +291,7 @@ static int Demux( input_thread_t *p_input )
p_input
->
stream
.
p_selected_program
,
p_sys
->
i_time
*
9
/
100
);
stream_Control
(
p_sys
->
s
,
STREAM_GET_POSITION
,
&
i_po
s
);
i_pos
=
stream_Tell
(
p_sys
->
s
);
if
(
p_sys
->
i_data_size
>
0
&&
i_pos
>=
p_sys
->
i_data_pos
+
p_sys
->
i_data_size
)
...
...
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