Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
035904be
Commit
035904be
authored
Aug 15, 2003
by
Laurent Aimar
Browse files
* pes: fix private stream with mpeg1.
parent
a36d6a8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/mux/mpeg/pes.c
View file @
035904be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* pes.c: PES packetizer used by the MPEG multiplexers
* pes.c: PES packetizer used by the MPEG multiplexers
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: pes.c,v 1.1
0
2003/08/1
4 23:37:54
fenrir Exp $
* $Id: pes.c,v 1.1
1
2003/08/1
5 01:58:46
fenrir Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
* Eric Petit <titer@videolan.org>
...
@@ -51,6 +51,20 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
...
@@ -51,6 +51,20 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
vlc_bool_t
b_mpeg2
)
vlc_bool_t
b_mpeg2
)
{
{
bits_buffer_t
bits
;
bits_buffer_t
bits
;
int
i_extra
=
0
;
/* For PES_PRIVATE_STREAM_1 there is an extra header after the
pes header */
/* i_private_id != -1 because TS use 0xbd without private_id */
if
(
i_stream_id
==
PES_PRIVATE_STREAM_1
&&
i_private_id
!=
-
1
)
{
i_extra
=
1
;
if
(
(
i_private_id
&
0xf8
)
==
0x80
)
{
i_extra
+=
3
;
}
}
bits_initwrite
(
&
bits
,
30
,
p_hdr
);
bits_initwrite
(
&
bits
,
30
,
p_hdr
);
...
@@ -77,19 +91,6 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
...
@@ -77,19 +91,6 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
if
(
b_mpeg2
)
if
(
b_mpeg2
)
{
{
int
i_pts_dts
;
int
i_pts_dts
;
int
i_extra
=
0
;
/* For PES_PRIVATE_STREAM_1 there is an extra header after the
pes header */
/* i_private_id != -1 because TS use 0xbd without private_id */
if
(
i_stream_id
==
PES_PRIVATE_STREAM_1
&&
i_private_id
!=
-
1
)
{
i_extra
=
1
;
if
(
(
i_private_id
&
0xf8
)
==
0x80
)
{
i_extra
+=
3
;
}
}
if
(
i_pts
>=
0
&&
i_dts
>=
0
)
if
(
i_pts
>=
0
&&
i_dts
>=
0
)
{
{
...
@@ -163,17 +164,17 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
...
@@ -163,17 +164,17 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
if
(
i_pts
>=
0
&&
i_dts
>=
0
)
if
(
i_pts
>=
0
&&
i_dts
>=
0
)
{
{
bits_write
(
&
bits
,
16
,
i_es_size
+
10
/* + stuffing */
);
bits_write
(
&
bits
,
16
,
i_es_size
+
i_extra
+
10
/* + stuffing */
);
i_pts_dts
=
0x03
;
i_pts_dts
=
0x03
;
}
}
else
if
(
i_pts
>=
0
)
else
if
(
i_pts
>=
0
)
{
{
bits_write
(
&
bits
,
16
,
i_es_size
+
5
/* + stuffing */
);
bits_write
(
&
bits
,
16
,
i_es_size
+
i_extra
+
5
/* + stuffing */
);
i_pts_dts
=
0x02
;
i_pts_dts
=
0x02
;
}
}
else
else
{
{
bits_write
(
&
bits
,
16
,
i_es_size
+
1
/* + stuffing */
);
bits_write
(
&
bits
,
16
,
i_es_size
+
i_extra
+
1
/* + stuffing */
);
i_pts_dts
=
0x00
;
i_pts_dts
=
0x00
;
}
}
...
...
Write
Preview
Supports
Markdown
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