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
7406b9de
Commit
7406b9de
authored
Feb 10, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS Mux: simplify mux pmt parsing
parent
01a6703d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
35 deletions
+19
-35
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+19
-35
No files found.
modules/mux/mpeg/ts.c
View file @
7406b9de
...
@@ -524,26 +524,17 @@ static int Open( vlc_object_t *p_this )
...
@@ -524,26 +524,17 @@ static int Open( vlc_object_t *p_this )
This would mean 0x451, 0x200, 0x28a, 0x240 would fall under one pmt (program), 0x450,0x201,0x28b,0x241 would fall under another
This would mean 0x451, 0x200, 0x28a, 0x240 would fall under one pmt (program), 0x450,0x201,0x28b,0x241 would fall under another
*/
*/
char
*
muxpmt
=
var_GetNonEmptyString
(
p_mux
,
SOUT_CFG_PREFIX
"muxpmt"
);
char
*
muxpmt
=
var_GetNonEmptyString
(
p_mux
,
SOUT_CFG_PREFIX
"muxpmt"
);
if
(
muxpmt
)
for
(
char
*
psz
=
muxpmt
;
psz
;
)
{
{
char
*
psz_next
;
char
*
psz_next
;
char
*
psz
=
muxpmt
;
uint16_t
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
uint16_t
i_pid
;
psz
=
*
psz_next
?
&
psz_next
[
1
]
:
NULL
;
psz_next
=
psz
;
while
(
psz
!=
NULL
)
{
i_pid
=
strtoul
(
psz
,
&
psz_next
,
0
);
if
(
psz_next
[
0
]
!=
'\0'
)
psz
=
&
psz_next
[
1
];
if
(
i_pid
==
0
)
if
(
i_pid
==
0
)
{
{
p_sys
->
i_num_pmt
++
;
if
(
++
p_sys
->
i_num_pmt
>
MAX_PMT
)
if
(
p_sys
->
i_num_pmt
>
MAX_PMT
)
{
{
msg_Err
(
p_mux
,
msg_Err
(
p_mux
,
"Number of PMTs > %d)"
,
MAX_PMT
);
"Number of PMTs greater than compiled maximum (%d)"
,
MAX_PMT
);
p_sys
->
i_num_pmt
=
MAX_PMT
;
p_sys
->
i_num_pmt
=
MAX_PMT
;
}
}
}
}
...
@@ -551,24 +542,17 @@ static int Open( vlc_object_t *p_this )
...
@@ -551,24 +542,17 @@ static int Open( vlc_object_t *p_this )
{
{
p_sys
->
pmtmap
[
p_sys
->
i_pmtslots
].
i_pid
=
i_pid
;
p_sys
->
pmtmap
[
p_sys
->
i_pmtslots
].
i_pid
=
i_pid
;
p_sys
->
pmtmap
[
p_sys
->
i_pmtslots
].
i_prog
=
p_sys
->
i_num_pmt
-
1
;
p_sys
->
pmtmap
[
p_sys
->
i_pmtslots
].
i_prog
=
p_sys
->
i_num_pmt
-
1
;
p_sys
->
i_pmtslots
++
;
if
(
++
p_sys
->
i_pmtslots
>
MAX_PMT_PID
)
if
(
p_sys
->
i_pmtslots
>
MAX_PMT_PID
)
{
{
msg_Err
(
p_mux
,
msg_Err
(
p_mux
,
"Number of pids in PMT > %d"
,
MAX_PMT_PID
);
"Number of pids in PMT greater than compiled maximum (%d)"
,
MAX_PMT_PID
);
p_sys
->
i_pmtslots
=
MAX_PMT_PID
;
p_sys
->
i_pmtslots
=
MAX_PMT_PID
;
}
}
}
}
}
/* Now sort according to pids for fast search later on */
/* Now sort according to pids for fast search later on */
qsort
(
(
void
*
)
p_sys
->
pmtmap
,
p_sys
->
i_pmtslots
,
qsort
(
(
void
*
)
p_sys
->
pmtmap
,
p_sys
->
i_pmtslots
,
sizeof
(
pmt_map_t
),
pmtcompare
);
sizeof
(
pmt_map_t
),
pmtcompare
);
if
(
!*
psz_next
)
psz
=
NULL
;
}
free
(
muxpmt
);
free
(
muxpmt
);
}
unsigned
short
subi
[
3
];
unsigned
short
subi
[
3
];
vlc_rand_bytes
(
subi
,
sizeof
(
subi
));
vlc_rand_bytes
(
subi
,
sizeof
(
subi
));
...
...
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