Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
a0ae0628
Commit
a0ae0628
authored
Dec 03, 2001
by
Stéphane Borel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-added eof for ts seekable streams -close netlist when ts input ends
parent
3e22409a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
plugins/mpeg/input_ts.c
plugins/mpeg/input_ts.c
+16
-3
src/input/input_netlist.c
src/input/input_netlist.c
+27
-9
No files found.
plugins/mpeg/input_ts.c
View file @
a0ae0628
...
...
@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ts.c,v 1.
39 2001/11/28 15:08:05 massiot
Exp $
* $Id: input_ts.c,v 1.
40 2001/12/03 17:34:08 stef
Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
...
...
@@ -225,7 +225,9 @@ static void TSEnd( input_thread_t * p_input )
if
(
p_pat_es
!=
NULL
)
input_DelES
(
p_input
,
p_pat_es
);
free
(
p_input
->
p_plugin_data
);
input_NetlistEnd
(
p_input
);
}
/*****************************************************************************
...
...
@@ -300,6 +302,7 @@ static int TSRead( input_thread_t * p_input,
if
(
(
i_read
==
-
1
)
&&
(
(
errno
==
EAGAIN
)
||
(
errno
=
EWOULDBLOCK
)
)
)
{
/* just ignore that error */
intf_ErrMsg
(
"input error: 0 bytes read"
);
i_read
=
0
;
}
#endif
...
...
@@ -308,9 +311,15 @@ static int TSRead( input_thread_t * p_input,
intf_ErrMsg
(
"input error: TS readv error"
);
return
(
-
1
);
}
/* EOF */
if
(
i_read
==
0
&&
p_input
->
stream
.
b_seekable
)
{
return
(
1
);
}
input_NetlistMviovec
(
p_input
->
p_method_data
,
(
int
)(
i_read
/
TS_PACKET_SIZE
)
,
pp_packets
);
(
int
)(
((
i_read
-
1
)
/
TS_PACKET_SIZE
)
+
1
)
,
pp_packets
);
/* check correct TS header */
for
(
i_loop
=
0
;
i_loop
*
TS_PACKET_SIZE
<
i_read
;
i_loop
++
)
...
...
@@ -320,6 +329,10 @@ static int TSRead( input_thread_t * p_input,
"0x%.2x, should be 0x47)"
,
pp_packets
[
i_loop
]
->
p_buffer
[
0
]
);
}
for
(
;
i_loop
<
INPUT_READ_ONCE
;
i_loop
++
)
{
pp_packets
[
i_loop
]
=
NULL
;
}
p_input
->
stream
.
p_selected_area
->
i_tell
+=
i_read
;
}
...
...
src/input/input_netlist.c
View file @
a0ae0628
...
...
@@ -6,7 +6,7 @@
* will only be given back to netlist when refcount is zero.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_netlist.c,v 1.4
6 2001/12/02 17:32:19
stef Exp $
* $Id: input_netlist.c,v 1.4
7 2001/12/03 17:34:08
stef Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
* Stphane Borel <stef@videolan.org>
...
...
@@ -289,7 +289,7 @@ struct iovec * input_NetlistGetiovec( void * p_method_data )
(
p_netlist
->
i_iovec_end
-
p_netlist
->
i_iovec_start
)
&
p_netlist
->
i_nb_iovec
)
<
p_netlist
->
i_read_once
)
{
intf_WarnMsg
(
12
,
"input info: waiting for free iovec"
);
intf_WarnMsg
(
4
,
"input info: waiting for free iovec"
);
msleep
(
INPUT_IDLE_SLEEP
);
while
(
(
...
...
@@ -299,14 +299,14 @@ struct iovec * input_NetlistGetiovec( void * p_method_data )
msleep
(
INPUT_IDLE_SLEEP
);
}
intf_WarnMsg
(
12
,
"input info: found free iovec"
);
intf_WarnMsg
(
4
,
"input info: found free iovec"
);
}
if
(
(
(
p_netlist
->
i_data_end
-
p_netlist
->
i_data_start
)
&
p_netlist
->
i_nb_data
)
<
p_netlist
->
i_read_once
)
{
intf_WarnMsg
(
12
,
"input info: waiting for free data packet"
);
intf_WarnMsg
(
4
,
"input info: waiting for free data packet"
);
msleep
(
INPUT_IDLE_SLEEP
);
while
(
(
...
...
@@ -316,7 +316,7 @@ struct iovec * input_NetlistGetiovec( void * p_method_data )
msleep
(
INPUT_IDLE_SLEEP
);
}
intf_WarnMsg
(
12
,
"input info: found free data packet"
);
intf_WarnMsg
(
4
,
"input info: found free data packet"
);
}
/* readv only takes contiguous buffers
...
...
@@ -373,7 +373,11 @@ void input_NetlistMviovec( void * p_method_data, int i_nb_iovec,
pp_data
[
i_loop
]
->
pi_refcount
=
p_netlist
->
pi_refcount
+
p_netlist
->
i_iovec_start
;
//(*pp_data[i_loop]->pi_refcount)++;
if
(
(
*
pp_data
[
i_loop
]
->
pi_refcount
)
!=
0
)
{
intf_ErrMsg
(
"netlist error: refcount should be 0 (%d)"
,
(
*
pp_data
[
i_loop
]
->
pi_refcount
)
);
}
(
*
pp_data
[
i_loop
]
->
pi_refcount
)
=
1
;
p_netlist
->
i_iovec_start
++
;
...
...
@@ -485,7 +489,11 @@ struct data_packet_s * input_NetlistNewPacket( void * p_method_data,
p_packet
->
b_discard_payload
=
0
;
p_packet
->
pi_refcount
=
p_netlist
->
pi_refcount
+
p_netlist
->
i_iovec_start
;
//(*p_packet->pi_refcount)++;
if
(
(
*
p_packet
->
pi_refcount
)
!=
0
)
{
intf_ErrMsg
(
"netlist error: refcount should be 0 (%d)"
,
(
*
p_packet
->
pi_refcount
)
);
}
(
*
p_packet
->
pi_refcount
)
=
1
;
p_netlist
->
i_iovec_start
++
;
...
...
@@ -568,7 +576,7 @@ void input_NetlistDeletePacket( void * p_method_data, data_packet_t * p_data )
/* Update reference counter */
(
*
p_data
->
pi_refcount
)
--
;
if
(
(
*
p_data
->
pi_refcount
)
<
=
0
)
if
(
(
*
p_data
->
pi_refcount
)
=
=
0
)
{
(
*
p_data
->
pi_refcount
)
=
0
;
p_netlist
->
i_iovec_end
++
;
...
...
@@ -576,6 +584,11 @@ void input_NetlistDeletePacket( void * p_method_data, data_packet_t * p_data )
p_netlist
->
p_free_iovec
[
p_netlist
->
i_iovec_end
].
iov_base
=
p_data
->
p_buffer
;
}
else
if
(
(
*
p_data
->
pi_refcount
)
<
0
)
{
intf_ErrMsg
(
"netlist error: refcount can't be negative (%d)"
,
(
*
p_data
->
pi_refcount
)
);
}
/* unlock */
vlc_mutex_unlock
(
&
p_netlist
->
lock
);
...
...
@@ -615,7 +628,7 @@ void input_NetlistDeletePES( void * p_method_data, pes_packet_t * p_pes )
/* Update reference counter */
(
*
p_current_packet
->
pi_refcount
)
--
;
if
(
(
*
p_current_packet
->
pi_refcount
)
<
=
0
)
if
(
(
*
p_current_packet
->
pi_refcount
)
=
=
0
)
{
(
*
p_current_packet
->
pi_refcount
)
=
0
;
p_netlist
->
i_iovec_end
++
;
...
...
@@ -623,6 +636,11 @@ void input_NetlistDeletePES( void * p_method_data, pes_packet_t * p_pes )
p_netlist
->
p_free_iovec
[
p_netlist
->
i_iovec_end
].
iov_base
=
p_current_packet
->
p_buffer
;
}
else
if
(
(
*
p_current_packet
->
pi_refcount
)
<
0
)
{
intf_ErrMsg
(
"netlist error: refcount can't be negative (%d)"
,
(
*
p_current_packet
->
pi_refcount
)
);
}
p_next_packet
=
p_current_packet
->
p_next
;
p_current_packet
->
p_next
=
NULL
;
...
...
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