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
2e9af822
Commit
2e9af822
authored
Feb 27, 2008
by
Pavlov Konstantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport [24245] and [24246]
parent
53ac769e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
22 deletions
+39
-22
modules/access/rtsp/real_sdpplin.c
modules/access/rtsp/real_sdpplin.c
+39
-22
No files found.
modules/access/rtsp/real_sdpplin.c
View file @
2e9af822
...
@@ -92,7 +92,7 @@ static char *nl(char *data) {
...
@@ -92,7 +92,7 @@ static char *nl(char *data) {
static
int
filter
(
const
char
*
in
,
const
char
*
filter
,
char
**
out
,
size_t
outlen
)
{
static
int
filter
(
const
char
*
in
,
const
char
*
filter
,
char
**
out
,
size_t
outlen
)
{
int
flen
=
strlen
(
filter
);
int
flen
=
strlen
(
filter
);
in
t
len
;
size_
t
len
;
if
(
!
in
)
return
0
;
if
(
!
in
)
return
0
;
...
@@ -185,12 +185,14 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
...
@@ -185,12 +185,14 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
}
}
if
(
filter
(
*
data
,
"a=OpaqueData:buffer;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
*
data
,
"a=OpaqueData:buffer;"
,
&
buf
,
BUFLEN
))
{
decoded
=
b64_decode
(
buf
,
decoded
,
&
(
desc
->
mlti_data_size
));
decoded
=
b64_decode
(
buf
,
decoded
,
&
(
desc
->
mlti_data_size
));
if
(
decoded
!=
NULL
)
{
desc
->
mlti_data
=
malloc
(
sizeof
(
char
)
*
desc
->
mlti_data_size
);
desc
->
mlti_data
=
malloc
(
sizeof
(
char
)
*
desc
->
mlti_data_size
);
memcpy
(
desc
->
mlti_data
,
decoded
,
desc
->
mlti_data_size
);
memcpy
(
desc
->
mlti_data
,
decoded
,
desc
->
mlti_data_size
);
handled
=
1
;
handled
=
1
;
*
data
=
nl
(
*
data
);
*
data
=
nl
(
*
data
);
lprintf
(
"mlti_data_size: %i
\n
"
,
desc
->
mlti_data_size
);
lprintf
(
"mlti_data_size: %i
\n
"
,
desc
->
mlti_data_size
);
}
}
}
if
(
filter
(
*
data
,
"a=ASMRuleBook:string;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
*
data
,
"a=ASMRuleBook:string;"
,
&
buf
,
BUFLEN
))
{
desc
->
asm_rule_book
=
strdup
(
buf
);
desc
->
asm_rule_book
=
strdup
(
buf
);
handled
=
1
;
handled
=
1
;
...
@@ -237,12 +239,19 @@ sdpplin_t *sdpplin_parse(char *data) {
...
@@ -237,12 +239,19 @@ sdpplin_t *sdpplin_parse(char *data) {
free
(
desc
);
free
(
desc
);
return
NULL
;
return
NULL
;
}
}
desc
->
stream
=
NULL
;
memset
(
desc
,
0
,
sizeof
(
sdpplin_t
));
memset
(
desc
,
0
,
sizeof
(
sdpplin_t
));
while
(
data
&&
*
data
)
{
while
(
data
&&
*
data
)
{
handled
=
0
;
handled
=
0
;
if
(
filter
(
data
,
"m="
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
data
,
"m="
,
&
buf
,
BUFLEN
))
{
if
(
!
desc
->
stream
)
{
fprintf
(
stderr
,
"sdpplin.c: stream identifier found before stream count, skipping."
);
continue
;
}
stream
=
sdpplin_parse_stream
(
&
data
);
stream
=
sdpplin_parse_stream
(
&
data
);
lprintf
(
"got data for stream id %u
\n
"
,
stream
->
stream_id
);
lprintf
(
"got data for stream id %u
\n
"
,
stream
->
stream_id
);
desc
->
stream
[
stream
->
stream_id
]
=
stream
;
desc
->
stream
[
stream
->
stream_id
]
=
stream
;
...
@@ -250,28 +259,36 @@ sdpplin_t *sdpplin_parse(char *data) {
...
@@ -250,28 +259,36 @@ sdpplin_t *sdpplin_parse(char *data) {
}
}
if
(
filter
(
data
,
"a=Title:buffer;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
data
,
"a=Title:buffer;"
,
&
buf
,
BUFLEN
))
{
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
if
(
decoded
!=
NULL
)
{
desc
->
title
=
strdup
(
decoded
);
desc
->
title
=
strdup
(
decoded
);
handled
=
1
;
handled
=
1
;
data
=
nl
(
data
);
data
=
nl
(
data
);
}
}
}
if
(
filter
(
data
,
"a=Author:buffer;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
data
,
"a=Author:buffer;"
,
&
buf
,
BUFLEN
))
{
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
if
(
decoded
!=
NULL
)
{
desc
->
author
=
strdup
(
decoded
);
desc
->
author
=
strdup
(
decoded
);
handled
=
1
;
handled
=
1
;
data
=
nl
(
data
);
data
=
nl
(
data
);
}
}
}
if
(
filter
(
data
,
"a=Copyright:buffer;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
data
,
"a=Copyright:buffer;"
,
&
buf
,
BUFLEN
))
{
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
if
(
decoded
!=
NULL
)
{
desc
->
copyright
=
strdup
(
decoded
);
desc
->
copyright
=
strdup
(
decoded
);
handled
=
1
;
handled
=
1
;
data
=
nl
(
data
);
data
=
nl
(
data
);
}
}
}
if
(
filter
(
data
,
"a=Abstract:buffer;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
data
,
"a=Abstract:buffer;"
,
&
buf
,
BUFLEN
))
{
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
decoded
=
b64_decode
(
buf
,
decoded
,
&
len
);
if
(
decoded
!=
NULL
)
{
desc
->
abstract
=
strdup
(
decoded
);
desc
->
abstract
=
strdup
(
decoded
);
handled
=
1
;
handled
=
1
;
data
=
nl
(
data
);
data
=
nl
(
data
);
}
}
}
if
(
filter
(
data
,
"a=StreamCount:integer;"
,
&
buf
,
BUFLEN
))
{
if
(
filter
(
data
,
"a=StreamCount:integer;"
,
&
buf
,
BUFLEN
))
{
desc
->
stream_count
=
atoi
(
buf
);
desc
->
stream_count
=
atoi
(
buf
);
desc
->
stream
=
malloc
(
sizeof
(
sdpplin_stream_t
*
)
*
desc
->
stream_count
);
desc
->
stream
=
malloc
(
sizeof
(
sdpplin_stream_t
*
)
*
desc
->
stream_count
);
...
...
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