Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
58469fda
Commit
58469fda
authored
16 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Recognize supported media type for SDP from SAP, not only from files
parent
7913df22
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/services_discovery/sap.c
+19
-17
19 additions, 17 deletions
modules/services_discovery/sap.c
with
19 additions
and
17 deletions
modules/services_discovery/sap.c
+
19
−
17
View file @
58469fda
...
...
@@ -285,6 +285,22 @@ static inline int min_int( int a, int b )
return
a
>
b
?
b
:
a
;
}
static
bool
IsWellKnownPayload
(
int
type
)
{
switch
(
type
)
{
/* Should be in sync with modules/demux/rtp.c */
case
0
:
/* PCMU/8000 */
case
8
:
/* PCMA/8000 */
case
10
:
/* L16/44100/2 */
case
11
:
/* L16/44100 */
case
14
:
/* MPA/90000 */
case
32
:
/* MPV/90000 */
case
33
:
/* MP2/90000 */
return
true
;
}
return
false
;
}
/*****************************************************************************
* Open: initialize and create stuff
*****************************************************************************/
...
...
@@ -391,19 +407,8 @@ static int OpenDemux( vlc_object_t *p_this )
{
p_sdp
->
psz_uri
=
NULL
;
}
switch
(
p_sdp
->
i_media_type
)
{
/* Should be in sync with modules/demux/rtp.c */
case
0
:
/* PCMU/8000 */
case
8
:
/* PCMA/8000 */
case
10
:
/* L16/44100/2 */
case
11
:
/* L16/44100 */
case
14
:
/* MPA/90000 */
case
32
:
/* MPV/90000 */
case
33
:
/* MP2/90000 */
break
;
default:
goto
error
;
}
if
(
!
IsWellKnownPayload
(
p_sdp
->
i_media_type
))
goto
error
;
if
(
p_sdp
->
psz_uri
==
NULL
)
goto
error
;
p_demux
->
p_sys
=
(
demux_sys_t
*
)
malloc
(
sizeof
(
demux_sys_t
)
);
...
...
@@ -789,10 +794,7 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
p_sdp
->
psz_uri
=
NULL
;
/* Multi-media or no-parse -> pass to LIVE.COM */
if
(
(
p_sdp
->
i_media_type
!=
14
&&
p_sdp
->
i_media_type
!=
32
&&
p_sdp
->
i_media_type
!=
33
)
||
p_sd
->
p_sys
->
b_parse
==
false
)
if
(
!
IsWellKnownPayload
(
p_sdp
->
i_media_type
)
||
!
p_sd
->
p_sys
->
b_parse
)
{
free
(
p_sdp
->
psz_uri
);
if
(
asprintf
(
&
p_sdp
->
psz_uri
,
"sdp://%s"
,
p_sdp
->
psz_sdp
)
==
-
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment