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
ed42e1e2
Commit
ed42e1e2
authored
Feb 10, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TS Mux: generate lang array directly in the needed format
parent
ca66eeb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
modules/mux/mpeg/ts.c
modules/mux/mpeg/ts.c
+11
-20
No files found.
modules/mux/mpeg/ts.c
View file @
ed42e1e2
...
...
@@ -681,7 +681,7 @@ static int Open( vlc_object_t *p_this )
if
(
!
val
.
i_int
)
/* Does this make any sense? */
val
.
i_int
=
0x42
;
for
(
int
i
=
0
;
i
<
p_sys
->
i_num_pmt
;
i
++
)
p_sys
->
pmt
[
i
].
i_pid
=
val
.
i_int
+
i
;
p_sys
->
pmt
[
i
].
i_pid
=
val
.
i_int
+
i
;
p_sys
->
i_pid_free
=
p_sys
->
pmt
[
p_sys
->
i_num_pmt
-
1
].
i_pid
+
1
;
...
...
@@ -1019,8 +1019,8 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
return
VLC_EGENERIC
;
}
p_stream
->
i_langs
=
1
+
p_input
->
p_fmt
->
i_extra_languages
;
p_stream
->
lang
=
calloc
(
1
,
p_stream
->
i_langs
*
3
);
p_stream
->
i_langs
=
1
+
p_input
->
p_fmt
->
i_extra_languages
;
p_stream
->
lang
=
calloc
(
1
,
p_stream
->
i_langs
*
4
);
if
(
!
p_stream
->
lang
)
{
free
(
p_stream
);
...
...
@@ -1041,8 +1041,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
const
char
*
code
=
GetIso639_2LangCode
(
lang
);
if
(
*
code
)
{
memcpy
(
&
p_stream
->
lang
[
i
*
3
],
code
,
3
);
msg_Dbg
(
p_mux
,
" - lang=%3.3s"
,
&
p_stream
->
lang
[
i
*
3
]
);
memcpy
(
&
p_stream
->
lang
[
i
*
4
],
code
,
3
);
p_stream
->
lang
[
i
*
4
+
3
]
=
0x00
;
/* audio type: 0x00 undefined */
msg_Dbg
(
p_mux
,
" - lang=%3.3s"
,
&
p_stream
->
lang
[
i
*
4
]
);
}
}
...
...
@@ -1256,9 +1257,9 @@ static bool MuxStreams(sout_mux_t *p_mux )
p_input
=
p_mux
->
pp_inputs
[
i
];
ts_stream_t
*
p_stream
=
(
ts_stream_t
*
)
p_input
->
p_sys
;
if
(
(
p_stream
!=
p_pcr_stream
||
if
(
(
p_stream
!=
p_pcr_stream
||
p_stream
->
i_pes_length
>=
i_shaping_delay
)
&&
p_stream
->
i_pes_dts
+
p_stream
->
i_pes_length
>=
p_stream
->
i_pes_dts
+
p_stream
->
i_pes_length
>=
p_pcr_stream
->
i_pes_dts
+
p_pcr_stream
->
i_pes_length
)
continue
;
...
...
@@ -2397,20 +2398,10 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
continue
;
}
if
(
p_stream
->
lang
[
0
]
!=
0
)
if
(
p_stream
->
i_langs
)
{
uint8_t
data
[
4
*
p_stream
->
i_langs
];
/* I construct the content myself, way faster than looking at
* over complicated/mind broken libdvbpsi way */
for
(
int
i
=
0
;
i
<
p_stream
->
i_langs
;
i
++
)
{
data
[
i
*
4
+
0
]
=
p_stream
->
lang
[
i
*
3
+
0
];
data
[
i
*
4
+
1
]
=
p_stream
->
lang
[
i
*
3
+
1
];
data
[
i
*
4
+
2
]
=
p_stream
->
lang
[
i
*
3
+
2
];
data
[
i
*
4
+
3
]
=
0x00
;
/* audio type: 0x00 undefined */
}
dvbpsi_PMTESAddDescriptor
(
p_es
,
0x0a
,
4
*
p_stream
->
i_langs
,
data
);
dvbpsi_PMTESAddDescriptor
(
p_es
,
0x0a
,
4
*
p_stream
->
i_langs
,
p_stream
->
lang
);
}
}
...
...
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