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
d8ea3394
Commit
d8ea3394
authored
Oct 03, 2002
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed miscellaneous problems with the RTP plug-in.
parent
1687209f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
50 deletions
+33
-50
modules/access/rtp.c
modules/access/rtp.c
+30
-48
modules/demux/mpeg/system.c
modules/demux/mpeg/system.c
+3
-2
No files found.
modules/access/rtp.c
View file @
d8ea3394
...
...
@@ -2,9 +2,9 @@
* rtp.c: RTP access plug-in
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: rtp.c,v 1.
3 2002/10/03 20:49:31 jpsaman
Exp $
* $Id: rtp.c,v 1.
4 2002/10/03 21:45:16 massiot
Exp $
*
* Authors:
Christophe Massiot <massiot
@via.ecp.fr>
* Authors:
Tristan Leteurtre <tooney
@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -40,14 +40,20 @@
# include <io.h>
#endif
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#include "network.h"
#define RTP_HEADER_LEN 12
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
);
static
int
RTPNetworkRead
(
input_thread_t
*
,
byte_t
*
,
size_t
);
static
ssize_t
RTPNetworkRead
(
input_thread_t
*
,
byte_t
*
,
size_t
);
/*****************************************************************************
* Module descriptor
*****************************************************************************/
...
...
@@ -259,25 +265,24 @@ static int Open( vlc_object_t *p_this )
/*****************************************************************************
* RTPNetworkRead : Read for the network, and parses the RTP header
*****************************************************************************/
static
in
t
RTPNetworkRead
(
input_thread_t
*
p_input
,
byte_t
*
p_buffer
,
static
ssize_
t
RTPNetworkRead
(
input_thread_t
*
p_input
,
byte_t
*
p_buffer
,
size_t
i_len
)
{
int
i_rtp_version
;
int
i_CSRC_count
;
int
i_payload_type
;
int
i
;
byte_t
p_tmp_buffer
[
1500
]
;
byte_t
*
p_tmp_buffer
=
alloca
(
p_input
->
i_mtu
)
;
/
/ Get the Raw data from the socket
// We first assume that RTP header size is the classic RTP_HEADER_LEN
ssize_t
i_ret
=
input_FDNetworkRead
(
p_input
,
p_tmp_buffer
,
i_len
+
RTP_HEADER_LEN
);
/
* Get the raw data from the socket.
* We first assume that RTP header size is the classic RTP_HEADER_LEN. */
ssize_t
i_ret
=
input_FDNetworkRead
(
p_input
,
p_tmp_buffer
,
p_input
->
i_mtu
);
if
(
!
i_ret
)
return
0
;
/
/ Parse the header and make some verifications
// See RFC 1889 & RFC 2250
/
* Parse the header and make some verifications.
* See RFC 1889 & RFC 2250. */
i_rtp_version
=
(
p_tmp_buffer
[
0
]
&
0xC0
)
>>
6
;
i_CSRC_count
=
(
p_tmp_buffer
[
0
]
&
0x0F
);
...
...
@@ -287,45 +292,22 @@ static int RTPNetworkRead( input_thread_t * p_input, byte_t * p_buffer,
msg_Dbg
(
p_input
,
"RTP version is %u, should be 2"
,
i_rtp_version
);
if
(
i_payload_type
!=
33
)
msg_Dbg
(
p_input
,
"RTP payload type is %u, only 33 (Mpeg2-TS) \
is supported"
,
i_payload_type
);
msg_Dbg
(
p_input
,
"RTP payload type is %u, only 33 (Mpeg2-TS)
"
\
"
is supported"
,
i_payload_type
);
// If both bytes are wrong, maybe a synchro error occurred...
if
((
i_rtp_version
!=
2
)
&&
(
i_payload_type
!=
33
))
{
msg_Dbg
(
p_input
,
"Too many RTP errors, trying to re-synchronize"
);
//Trying to re-synchronize
for
(
i
=
0
;
(
i
<
i_len
)
||
(((
p_tmp_buffer
[
0
]
&
0xC0
)
>>
6
==
2
)
&&
(
p_tmp_buffer
[
1
]
&
0x7F
)
==
33
)
;
i
++
);
/* Return the packet without the RTP header. */
i_ret
-=
(
RTP_HEADER_LEN
+
4
*
i_CSRC_count
);
if
(
i
!=
i_len
)
if
(
i_ret
>
i_len
)
{
input_FDNetworkRead
(
p_input
,
p_tmp_buffer
,
i
);
return
0
;
/* This should NOT happen. */
msg_Warn
(
p_input
,
"RTP input trashing %d bytes"
,
i_ret
-
i_len
);
i_ret
=
i_len
;
}
}
/*
// if i_CSRC_count != 0, the header is in fact longer than RTP_HEADER_LEN
// so we have to read some extra bytes
// This case is supposed to be very rare (vls does not handle that),
// so in practical this second input_FDNetworkRead is never done...
if (i_CSRC_count)
{ i_ret += input_FDNetworkRead(p_input,
p_tmp_buffer + i_len + RTP_HEADER_LEN,
4 * i_CSRC_count );
}
*/
// Return the packet without the RTP header
i_ret
-=
(
RTP_HEADER_LEN
+
4
*
i_CSRC_count
);
p_input
->
p_vlc
->
pf_memcpy
(
p_buffer
,
p_tmp_buffer
+
RTP_HEADER_LEN
+
4
*
i_CSRC_count
,
i_ret
);
return
(
i_ret
)
;
return
i_ret
;
}
modules/demux/mpeg/system.c
View file @
d8ea3394
...
...
@@ -2,7 +2,7 @@
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: system.c,v 1.
4 2002/10/01 21:47:25
massiot Exp $
* $Id: system.c,v 1.
5 2002/10/03 21:45:16
massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
...
...
@@ -1291,7 +1291,8 @@ static void DemuxTS( input_thread_t * p_input, data_packet_t * p_data,
{
/* Duplicate packet: mark it as being to be trashed. */
msg_Warn
(
p_input
,
"duplicate packet received by TS demux"
);
"duplicate packet received by TS demux (%d)"
,
i_dummy
);
b_trash
=
1
;
}
else
if
(
p_es_demux
->
i_continuity_counter
==
0xFF
)
...
...
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