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
cbba447e
Commit
cbba447e
authored
Dec 12, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtspreal: no need to ask for the size of the array as
We know it at compile time + some cleanups.
parent
a01be865
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
modules/access/rtsp/real.c
modules/access/rtsp/real.c
+16
-17
No files found.
modules/access/rtsp/real.c
View file @
cbba447e
...
...
@@ -33,7 +33,8 @@
#include "real.h"
#include "real_sdpplin.h"
const
unsigned
char
xor_table
[]
=
{
#define XOR_TABLE_LEN 37
static
const
unsigned
char
xor_table
[]
=
{
0x05
,
0x18
,
0x74
,
0xd0
,
0x0d
,
0x09
,
0x02
,
0x53
,
0xc0
,
0x01
,
0x05
,
0x05
,
0x67
,
0x03
,
0x19
,
0x70
,
0x08
,
0x27
,
0x66
,
0x10
,
0x10
,
0x72
,
0x08
,
0x09
,
...
...
@@ -338,16 +339,9 @@ void real_calc_response_and_checksum (char *response, char *chksum, char *challe
memcpy
(
ptr
,
challenge
,
ch_len
);
}
if
(
xor_table
!=
NULL
)
{
table_len
=
strlen
((
char
*
)
xor_table
);
if
(
table_len
>
56
)
table_len
=
56
;
/* xor challenge bytewise with xor_table */
for
(
i
=
0
;
i
<
table_len
;
i
++
)
for
(
i
=
0
;
i
<
XOR_TABLE_LEN
;
i
++
)
ptr
[
i
]
=
ptr
[
i
]
^
xor_table
[
i
];
}
calc_response_string
(
response
,
buf
);
...
...
@@ -550,15 +544,18 @@ int real_get_rdt_chunk_header(rtsp_client_t *rtsp_session, rmff_pheader_t *ph) {
n
=
rtsp_read_data
(
rtsp_session
,
header
,
8
);
if
(
n
<
8
)
return
0
;
if
(
header
[
0
]
!=
0x24
)
{
if
(
header
[
0
]
!=
0x24
)
{
lprintf
(
"rdt chunk not recognized: got 0x%02x
\n
"
,
header
[
0
]);
return
0
;
}
size
=
(
header
[
1
]
<<
16
)
+
(
header
[
2
]
<<
8
)
+
(
header
[
3
]);
flags1
=
header
[
4
];
if
((
flags1
!=
0x40
)
&&
(
flags1
!=
0x42
))
{
if
((
flags1
!=
0x40
)
&&
(
flags1
!=
0x42
))
{
lprintf
(
"got flags1: 0x%02x
\n
"
,
flags1
);
if
(
header
[
6
]
==
0x06
)
{
if
(
header
[
6
]
==
0x06
)
{
lprintf
(
"got end of stream packet
\n
"
);
return
0
;
}
...
...
@@ -613,7 +610,9 @@ rmff_header_t *real_setup_and_get_header(rtsp_client_t *rtsp_session, int bandw
char
challenge2
[
64
];
char
checksum
[
34
];
char
*
subscribe
=
NULL
;
char
*
buf
=
(
char
*
)
malloc
(
256
);
char
*
buf
=
malloc
(
256
);
if
(
!
buf
)
return
NULL
;
char
*
mrl
=
rtsp_get_mrl
(
rtsp_session
);
unsigned
int
size
;
int
status
;
...
...
@@ -666,7 +665,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_client_t *rtsp_session, int bandw
lprintf
(
"Stream description size: %i
\n
"
,
size
);
description
=
(
char
*
)
malloc
(
size
+
1
);
description
=
malloc
(
size
+
1
);
if
(
!
description
)
goto
error
;
if
(
rtsp_read_data
(
rtsp_session
,
(
uint8_t
*
)
description
,
size
)
<=
0
)
...
...
@@ -675,7 +674,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_client_t *rtsp_session, int bandw
//fprintf(stderr, "%s", description);
/* parse sdp (sdpplin) and create a header and a subscribe string */
subscribe
=
(
char
*
)
malloc
(
256
);
subscribe
=
malloc
(
256
);
if
(
!
subscribe
)
goto
error
;
...
...
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