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
ca66eeb3
Commit
ca66eeb3
authored
Feb 10, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS Mux: deindent, cosmetics, use stack rather than heap
parent
73f01617
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
135 deletions
+121
-135
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+121
-135
No files found.
modules/mux/mpeg/ts.c
View file @
ca66eeb3
...
...
@@ -2088,8 +2088,7 @@ static void GetPMTmpeg4(sout_mux_t *p_mux)
{
sout_mux_sys_t
*
p_sys
=
p_mux
->
p_sys
;
uint8_t
iod
[
4096
];
bits_buffer_t
bits
;
bits_buffer_t
bits_fix_IOD
;
bits_buffer_t
bits
,
bits_fix_IOD
;
/* Make valgrind happy : it works at byte level not bit one so
* bit_write confuse it (but DON'T CHANGE the way that bit_write is
...
...
@@ -2118,13 +2117,12 @@ static void GetPMTmpeg4(sout_mux_t *p_mux)
bits_write
(
&
bits
,
8
,
0xff
);
/* graphicProfile (no ) */
for
(
int
i_stream
=
0
;
i_stream
<
p_mux
->
i_nb_inputs
;
i_stream
++
)
{
ts_stream_t
*
p_stream
;
p_stream
=
(
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i_stream
]
->
p_sys
;
ts_stream_t
*
p_stream
=
(
ts_stream_t
*
)
p_mux
->
pp_inputs
[
i_stream
]
->
p_sys
;
if
(
p_stream
->
i_stream_id
!=
0xfa
&&
p_stream
->
i_stream_id
!=
0xfb
&&
p_stream
->
i_stream_id
!=
0xfe
)
continue
;
if
(
p_stream
->
i_stream_id
==
0xfa
||
p_stream
->
i_stream_id
==
0xfb
||
p_stream
->
i_stream_id
==
0xfe
)
{
bits_buffer_t
bits_fix_ESDescr
,
bits_fix_Decoder
;
/* ES descriptor */
bits_align
(
&
bits
);
...
...
@@ -2213,15 +2211,12 @@ static void GetPMTmpeg4(sout_mux_t *p_mux)
GetDescriptorLength24b
(
bits
.
i_data
-
bits_fix_ESDescr
.
i_data
-
3
)
);
}
}
bits_align
(
&
bits
);
/* fix IOD length */
bits_write
(
&
bits_fix_IOD
,
24
,
GetDescriptorLength24b
(
bits
.
i_data
-
bits_fix_IOD
.
i_data
-
3
)
);
GetDescriptorLength24b
(
bits
.
i_data
-
bits_fix_IOD
.
i_data
-
3
));
dvbpsi_PMTAddDescriptor
(
&
p_sys
->
dvbpmt
[
0
],
0x1d
,
bits
.
i_data
,
bits
.
p_data
);
dvbpsi_PMTAddDescriptor
(
&
p_sys
->
dvbpmt
[
0
],
0x1d
,
bits
.
i_data
,
bits
.
p_data
);
}
static
void
GetPMT
(
sout_mux_t
*
p_mux
,
sout_buffer_chain_t
*
c
)
...
...
@@ -2247,8 +2242,9 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
1
,
/* b_current_next */
p_sys
->
i_pcr_pid
);
if
(
p_sys
->
b_sdt
)
{
if
(
!
p_sys
->
b_sdt
)
continue
;
dvbpsi_sdt_service_t
*
p_service
=
dvbpsi_SDTAddService
(
&
sdt
,
p_sys
->
i_pmt_program_number
[
i
],
/* service id */
0
,
/* eit schedule */
...
...
@@ -2256,38 +2252,28 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
4
,
/* running status ("4=RUNNING") */
0
);
/* free ca */
#define psz_sdtprov p_sys->sdt_descriptors[i].psz_provider
#define psz_sdtserv p_sys->sdt_descriptors[i].psz_service_name
const
char
*
psz_sdtprov
=
p_sys
->
sdt_descriptors
[
i
].
psz_provider
;
const
char
*
psz_sdtserv
=
p_sys
->
sdt_descriptors
[
i
].
psz_service_name
;
if
(
!
psz_sdtprov
||
!
psz_sdtserv
)
continue
;
size_t
provlen
=
VLC_CLIP
(
strlen
(
psz_sdtprov
),
0
,
255
);
size_t
servlen
=
VLC_CLIP
(
strlen
(
psz_sdtserv
),
0
,
255
);
uint8_t
psz_sdt_desc
[
3
+
provlen
+
servlen
];
/* FIXME: Ineffecient malloc's & ugly code...... */
if
(
(
psz_sdtprov
!=
NULL
)
&&
(
psz_sdtserv
!=
NULL
)
)
{
uint8_t
*
psz_sdt_desc
=
malloc
(
3
+
strlen
(
psz_sdtprov
)
+
strlen
(
psz_sdtserv
)
);
if
(
psz_sdt_desc
)
{
psz_sdt_desc
[
0
]
=
0x01
;
/* digital television service */
/* service provider name length */
psz_sdt_desc
[
1
]
=
(
char
)
strlen
(
psz_sdtprov
)
;
memcpy
(
&
psz_sdt_desc
[
2
],
psz_sdtprov
,
strlen
(
psz_sdtprov
)
);
psz_sdt_desc
[
1
]
=
(
char
)
provlen
;
memcpy
(
&
psz_sdt_desc
[
2
],
psz_sdtprov
,
provlen
);
/* service name length */
psz_sdt_desc
[
2
+
strlen
(
psz_sdtprov
)
]
=
(
char
)
strlen
(
psz_sdtserv
);
memcpy
(
&
psz_sdt_desc
[
3
+
strlen
(
psz_sdtprov
)],
psz_sdtserv
,
strlen
(
psz_sdtserv
)
);
psz_sdt_desc
[
2
+
provlen
]
=
(
char
)
servlen
;
memcpy
(
&
psz_sdt_desc
[
3
+
provlen
],
psz_sdtserv
,
servlen
);
dvbpsi_SDTServiceAddDescriptor
(
p_service
,
0x48
,
3
+
strlen
(
psz_sdtprov
)
+
strlen
(
psz_sdtserv
),
(
uint8_t
*
)
psz_sdt_desc
);
free
(
psz_sdt_desc
);
psz_sdt_desc
=
NULL
;
}
}
#undef psz_sdtprov
#undef psz_sdtserv
}
3
+
provlen
+
servlen
,
psz_sdt_desc
);
}
if
(
p_sys
->
i_mpeg4_streams
>
0
)
...
...
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