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
181f072e
Commit
181f072e
authored
Mar 03, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No functionnal changes (ts).
parent
c557ef6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
302 additions
and
290 deletions
+302
-290
modules/demux/ts.c
modules/demux/ts.c
+302
-290
No files found.
modules/demux/ts.c
View file @
181f072e
...
@@ -3020,17 +3020,25 @@ static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
...
@@ -3020,17 +3020,25 @@ static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
/*****************************************************************************
/*****************************************************************************
* PMT callback and helpers
* PMT callback and helpers
*****************************************************************************/
*****************************************************************************/
static
void
PMTSetupEsISO14496
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
static
dvbpsi_descriptor_t
*
PMTEsFindDescriptor
(
const
dvbpsi_pmt_es_t
*
p_es
,
const
ts_prg_psi_t
*
prg
,
const
dvbpsi_pmt_es_t
*
p_es
)
int
i_tag
)
{
{
/* MPEG-4 stream: search SL_DESCRIPTOR */
dvbpsi_descriptor_t
*
p_dr
=
p_es
->
p_first_descriptor
;;
dvbpsi_descriptor_t
*
p_dr
=
p_es
->
p_first_descriptor
;;
while
(
p_dr
&&
(
p_dr
->
i_tag
!=
0x1f
)
)
while
(
p_dr
&&
(
p_dr
->
i_tag
!=
i_tag
)
)
p_dr
=
p_dr
->
p_next
;
p_dr
=
p_dr
->
p_next
;
return
p_dr
;
}
static
void
PMTSetupEsISO14496
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
const
ts_prg_psi_t
*
prg
,
const
dvbpsi_pmt_es_t
*
p_es
)
{
es_format_t
*
p_fmt
=
&
pid
->
es
->
fmt
;
/* MPEG-4 stream: search SL_DESCRIPTOR */
dvbpsi_descriptor_t
*
p_dr
=
PMTEsFindDescriptor
(
p_es
,
0x1f
);
if
(
p_dr
&&
p_dr
->
i_length
==
2
)
if
(
p_dr
&&
p_dr
->
i_length
==
2
)
{
{
int
i_es_id
=
(
p_dr
->
p_data
[
0
]
<<
8
)
|
p_dr
->
p_data
[
1
];
const
int
i_es_id
=
(
p_dr
->
p_data
[
0
]
<<
8
)
|
p_dr
->
p_data
[
1
];
msg_Warn
(
p_demux
,
"found SL_descriptor es_id=%d"
,
i_es_id
);
msg_Warn
(
p_demux
,
"found SL_descriptor es_id=%d"
,
i_es_id
);
...
@@ -3048,102 +3056,103 @@ static void PMTSetupEsISO14496( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3048,102 +3056,103 @@ static void PMTSetupEsISO14496( demux_t *p_demux, ts_pid_t *pid,
}
}
}
}
}
}
if
(
!
pid
->
es
->
p_mpeg4desc
)
if
(
pid
->
es
->
p_mpeg4desc
!=
NULL
)
{
{
decoder_config_descriptor_t
*
dcd
=
msg_Err
(
p_demux
,
"MPEG-4 descriptor not found"
);
&
pid
->
es
->
p_mpeg4desc
->
dec_descr
;
return
;
}
if
(
dcd
->
i_streamType
==
0x04
)
/* VisualStream */
const
decoder_config_descriptor_t
*
dcd
=
&
pid
->
es
->
p_mpeg4desc
->
dec_descr
;
if
(
dcd
->
i_streamType
==
0x04
)
/* VisualStream */
{
p_fmt
->
i_cat
=
VIDEO_ES
;
switch
(
dcd
->
i_objectTypeIndication
)
{
{
pid
->
es
->
fmt
.
i_cat
=
VIDEO_ES
;
case
0x0B
:
/* mpeg4 sub */
switch
(
dcd
->
i_objectTypeIndication
)
p_fmt
->
i_cat
=
SPU_ES
;
{
p_fmt
->
i_codec
=
VLC_FOURCC
(
's'
,
'u'
,
'b'
,
't'
);
case
0x0B
:
/* mpeg4 sub */
break
;
pid
->
es
->
fmt
.
i_cat
=
SPU_ES
;
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
's'
,
'u'
,
'b'
,
't'
);
break
;
case
0x20
:
/* mpeg4 */
case
0x20
:
/* mpeg4 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
);
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'v'
);
break
;
break
;
case
0x21
:
/* h264 */
case
0x21
:
/* h264 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'h'
,
'2'
,
'6'
,
'4'
);
p_fmt
->
i_codec
=
VLC_FOURCC
(
'h'
,
'2'
,
'6'
,
'4'
);
break
;
break
;
case
0x60
:
case
0x60
:
case
0x61
:
case
0x61
:
case
0x62
:
case
0x62
:
case
0x63
:
case
0x63
:
case
0x64
:
case
0x64
:
case
0x65
:
/* mpeg2 */
case
0x65
:
/* mpeg2 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
break
;
break
;
case
0x6a
:
/* mpeg1 */
case
0x6a
:
/* mpeg1 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
break
;
break
;
case
0x6c
:
/* mpeg1 */
case
0x6c
:
/* mpeg1 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'j'
,
'p'
,
'e'
,
'g'
);
p_fmt
->
i_codec
=
VLC_FOURCC
(
'j'
,
'p'
,
'e'
,
'g'
);
break
;
break
;
default:
default:
pid
->
es
->
fmt
.
i_cat
=
UNKNOWN_ES
;
p_fmt
->
i_cat
=
UNKNOWN_ES
;
break
;
break
;
}
}
else
if
(
dcd
->
i_streamType
==
0x05
)
/* AudioStream */
{
pid
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
switch
(
dcd
->
i_objectTypeIndication
)
{
case
0x40
:
/* mpeg4 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
break
;
case
0x66
:
case
0x67
:
case
0x68
:
/* mpeg2 aac */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
break
;
case
0x69
:
/* mpeg2 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
);
break
;
case
0x6b
:
/* mpeg1 */
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
);
break
;
default:
pid
->
es
->
fmt
.
i_cat
=
UNKNOWN_ES
;
break
;
}
}
}
else
}
else
if
(
dcd
->
i_streamType
==
0x05
)
/* AudioStream */
{
p_fmt
->
i_cat
=
AUDIO_ES
;
switch
(
dcd
->
i_objectTypeIndication
)
{
{
pid
->
es
->
fmt
.
i_cat
=
UNKNOWN_ES
;
case
0x40
:
/* mpeg4 */
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
break
;
case
0x66
:
case
0x67
:
case
0x68
:
/* mpeg2 aac */
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
break
;
case
0x69
:
/* mpeg2 */
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
);
break
;
case
0x6b
:
/* mpeg1 */
p_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
);
break
;
default:
p_fmt
->
i_cat
=
UNKNOWN_ES
;
break
;
}
}
}
else
{
p_fmt
->
i_cat
=
UNKNOWN_ES
;
}
if
(
pid
->
es
->
fmt
.
i_cat
!=
UNKNOWN_ES
)
if
(
p_fmt
->
i_cat
!=
UNKNOWN_ES
)
{
p_fmt
->
i_extra
=
dcd
->
i_decoder_specific_info_len
;
if
(
p_fmt
->
i_extra
>
0
)
{
{
pid
->
es
->
fmt
.
i_extra
=
dcd
->
i_decoder_specific_info_len
;
p_fmt
->
p_extra
=
malloc
(
p_fmt
->
i_extra
);
if
(
pid
->
es
->
fmt
.
i_extra
>
0
)
if
(
p_fmt
->
p_extra
)
{
memcpy
(
p_fmt
->
p_extra
,
pid
->
es
->
fmt
.
p_extra
=
malloc
(
pid
->
es
->
fmt
.
i_extra
);
dcd
->
p_decoder_specific_info
,
if
(
pid
->
es
->
fmt
.
p_extra
)
p_fmt
->
i_extra
);
memcpy
(
pid
->
es
->
fmt
.
p_extra
,
else
dcd
->
p_decoder_specific_info
,
p_fmt
->
i_extra
=
0
;
pid
->
es
->
fmt
.
i_extra
);
}
}
}
}
}
}
}
static
void
PMTSetupEs0x06
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
static
void
PMTSetupEs0x06
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
const
dvbpsi_pmt_es_t
*
p_es
)
const
dvbpsi_pmt_es_t
*
p_es
)
{
{
es_format_t
*
p_fmt
=
&
pid
->
es
->
fmt
;
dvbpsi_descriptor_t
*
p_dr
;
dvbpsi_descriptor_t
*
p_dr
;
for
(
p_dr
=
p_es
->
p_first_descriptor
;
p_dr
!=
NULL
;
for
(
p_dr
=
p_es
->
p_first_descriptor
;
p_dr
!=
NULL
;
p_dr
=
p_dr
->
p_next
)
p_dr
=
p_dr
->
p_next
)
{
{
msg_Dbg
(
p_demux
,
" * es pid=%d type=%d dr->i_tag=0x%x"
,
p_es
->
i_pid
,
p_es
->
i_type
,
p_dr
->
i_tag
);
if
(
p_dr
->
i_tag
==
0x05
)
if
(
p_dr
->
i_tag
==
0x05
)
{
{
/* Registration Descriptor */
/* Registration Descriptor */
...
@@ -3157,22 +3166,22 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3157,22 +3166,22 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
{
{
/* ATSC with stream_type 0x81 (but this descriptor
/* ATSC with stream_type 0x81 (but this descriptor
* is then not mandatory */
* is then not mandatory */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
);
}
}
else
if
(
!
memcmp
(
p_dr
->
p_data
,
"DTS1"
,
4
)
||
else
if
(
!
memcmp
(
p_dr
->
p_data
,
"DTS1"
,
4
)
||
!
memcmp
(
p_dr
->
p_data
,
"DTS2"
,
4
)
||
!
memcmp
(
p_dr
->
p_data
,
"DTS2"
,
4
)
||
!
memcmp
(
p_dr
->
p_data
,
"DTS3"
,
4
)
)
!
memcmp
(
p_dr
->
p_data
,
"DTS3"
,
4
)
)
{
{
/*registration descriptor(ETSI TS 101 154 Annex F)*/
/*registration descriptor(ETSI TS 101 154 Annex F)*/
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
);
}
}
else
if
(
!
memcmp
(
p_dr
->
p_data
,
"BSSD"
,
4
)
)
else
if
(
!
memcmp
(
p_dr
->
p_data
,
"BSSD"
,
4
)
)
{
{
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
b_packetized
=
true
;
p
_fmt
->
b_packetized
=
true
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'a'
,
'e'
,
's'
,
'3'
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'a'
,
'e'
,
's'
,
'3'
);
}
}
else
else
{
{
...
@@ -3186,27 +3195,27 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3186,27 +3195,27 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
else
if
(
p_dr
->
i_tag
==
0x6a
)
else
if
(
p_dr
->
i_tag
==
0x6a
)
{
{
/* DVB with stream_type 0x06 */
/* DVB with stream_type 0x06 */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
);
}
}
else
if
(
p_dr
->
i_tag
==
0x81
)
else
if
(
p_dr
->
i_tag
==
0x81
)
{
{
/* ATSC with stream_type 0x06 */
/* ATSC with stream_type 0x06 */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
);
}
}
else
if
(
p_dr
->
i_tag
==
0x7a
)
else
if
(
p_dr
->
i_tag
==
0x7a
)
{
{
/* DVB with stream_type 0x06 (ETS EN 300 468) */
/* DVB with stream_type 0x06 (ETS EN 300 468) */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'e'
,
'a'
,
'c'
,
'3'
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'e'
,
'a'
,
'c'
,
'3'
);
}
}
else
if
(
p_dr
->
i_tag
==
0x73
)
else
if
(
p_dr
->
i_tag
==
0x73
)
{
{
/* DTS audio descriptor (ETSI TS 101 154 Annex F) */
/* DTS audio descriptor (ETSI TS 101 154 Annex F) */
msg_Dbg
(
p_demux
,
" * DTS audio descriptor not decoded"
);
msg_Dbg
(
p_demux
,
" * DTS audio descriptor not decoded"
);
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
);
}
}
else
if
(
p_dr
->
i_tag
==
0x45
)
else
if
(
p_dr
->
i_tag
==
0x45
)
{
{
...
@@ -3230,14 +3239,16 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3230,14 +3239,16 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
else
if
(
p_dr
->
i_tag
==
0x56
)
else
if
(
p_dr
->
i_tag
==
0x56
)
{
{
msg_Dbg
(
p_demux
,
" * EBU Teletext descriptor"
);
msg_Dbg
(
p_demux
,
" * EBU Teletext descriptor"
);
p
id
->
es
->
fmt
.
i_cat
=
SPU_ES
;
p
_fmt
->
i_cat
=
SPU_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
't'
,
'e'
,
'l'
,
'x'
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
't'
,
'e'
,
'l'
,
'x'
);
p
id
->
es
->
fmt
.
i_extra
=
p_dr
->
i_length
;
p
_fmt
->
i_extra
=
p_dr
->
i_length
;
p
id
->
es
->
fmt
.
p_extra
=
p_dr
->
i_length
?
p
_fmt
->
p_extra
=
p_dr
->
i_length
?
malloc
(
p_dr
->
i_length
)
:
NULL
;
malloc
(
p_dr
->
i_length
)
:
NULL
;
if
(
p
id
->
es
->
fmt
.
p_extra
)
if
(
p
_fmt
->
p_extra
)
memcpy
(
p
id
->
es
->
fmt
.
p_extra
,
p_dr
->
p_data
,
memcpy
(
p
_fmt
->
p_extra
,
p_dr
->
p_data
,
p_dr
->
i_length
);
p_dr
->
i_length
);
else
p_fmt
->
i_extra
=
0
;
#if defined _DVBPSI_DR_56_H_ && defined DVBPSI_VERSION \
#if defined _DVBPSI_DR_56_H_ && defined DVBPSI_VERSION \
&& DVBPSI_VERSION_INT > ((0<<16)+(1<<8)+5)
&& DVBPSI_VERSION_INT > ((0<<16)+(1<<8)+5)
...
@@ -3269,7 +3280,8 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3269,7 +3280,8 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
else
else
{
{
p_es
=
malloc
(
sizeof
(
ts_es_t
)
);
p_es
=
malloc
(
sizeof
(
ts_es_t
)
);
if
(
!
p_es
)
break
;
if
(
!
p_es
)
break
;
es_format_Copy
(
&
p_es
->
fmt
,
&
pid
->
es
->
fmt
);
es_format_Copy
(
&
p_es
->
fmt
,
&
pid
->
es
->
fmt
);
free
(
p_es
->
fmt
.
psz_language
);
free
(
p_es
->
fmt
.
psz_language
);
...
@@ -3314,26 +3326,28 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3314,26 +3326,28 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
}
}
}
}
if
(
!
i
)
if
(
!
i
)
p
id
->
es
->
fmt
.
i_cat
=
UNKNOWN_ES
;
p
_fmt
->
i_cat
=
UNKNOWN_ES
;
}
}
else
else
#endif
/* defined _DVBPSI_DR_56_H_ && DVBPSI_VERSION(0,1,6) */
#endif
/* defined _DVBPSI_DR_56_H_ && DVBPSI_VERSION(0,1,6) */
{
{
p
id
->
es
->
fmt
.
subs
.
teletext
.
i_magazine
=
-
1
;
p
_fmt
->
subs
.
teletext
.
i_magazine
=
-
1
;
p
id
->
es
->
fmt
.
subs
.
teletext
.
i_page
=
0
;
p
_fmt
->
subs
.
teletext
.
i_page
=
0
;
p
id
->
es
->
fmt
.
psz_description
=
strdup
(
_
(
ppsz_teletext_type
[
1
])
);
p
_fmt
->
psz_description
=
strdup
(
_
(
ppsz_teletext_type
[
1
])
);
}
}
}
}
else
if
(
p_dr
->
i_tag
==
0x59
)
else
if
(
p_dr
->
i_tag
==
0x59
)
{
{
/* DVB subtitles */
/* DVB subtitles */
p
id
->
es
->
fmt
.
i_cat
=
SPU_ES
;
p
_fmt
->
i_cat
=
SPU_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'd'
,
'v'
,
'b'
,
's'
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'd'
,
'v'
,
'b'
,
's'
);
p
id
->
es
->
fmt
.
i_extra
=
p_dr
->
i_length
;
p
_fmt
->
i_extra
=
p_dr
->
i_length
;
p
id
->
es
->
fmt
.
p_extra
=
malloc
(
p_dr
->
i_length
);
p
_fmt
->
p_extra
=
malloc
(
p_dr
->
i_length
);
if
(
p
id
->
es
->
fmt
.
p_extra
)
if
(
p
_fmt
->
p_extra
)
memcpy
(
p
id
->
es
->
fmt
.
p_extra
,
p_dr
->
p_data
,
memcpy
(
p
_fmt
->
p_extra
,
p_dr
->
p_data
,
p_dr
->
i_length
);
p_dr
->
i_length
);
else
p_fmt
->
i_extra
=
0
;
#ifdef _DVBPSI_DR_59_H_
#ifdef _DVBPSI_DR_59_H_
...
@@ -3359,7 +3373,8 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3359,7 +3373,8 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
else
else
{
{
p_es
=
malloc
(
sizeof
(
ts_es_t
)
);
p_es
=
malloc
(
sizeof
(
ts_es_t
)
);
if
(
!
p_es
)
break
;
if
(
!
p_es
)
break
;
es_format_Copy
(
&
p_es
->
fmt
,
&
pid
->
es
->
fmt
);
es_format_Copy
(
&
p_es
->
fmt
,
&
pid
->
es
->
fmt
);
free
(
p_es
->
fmt
.
psz_language
);
p_es
->
fmt
.
psz_language
=
NULL
;
free
(
p_es
->
fmt
.
psz_language
);
p_es
->
fmt
.
psz_language
=
NULL
;
free
(
p_es
->
fmt
.
psz_description
);
p_es
->
fmt
.
psz_description
=
NULL
;
free
(
p_es
->
fmt
.
psz_description
);
p_es
->
fmt
.
psz_description
=
NULL
;
...
@@ -3413,13 +3428,13 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3413,13 +3428,13 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
}
}
if
(
!
i
)
if
(
!
i
)
p
id
->
es
->
fmt
.
i_cat
=
UNKNOWN_ES
;
p
_fmt
->
i_cat
=
UNKNOWN_ES
;
}
}
else
else
#endif
/* _DVBPSI_DR_59_H_ */
#endif
/* _DVBPSI_DR_59_H_ */
{
{
p
id
->
es
->
fmt
.
subs
.
dvb
.
i_id
=
-
1
;
p
_fmt
->
subs
.
dvb
.
i_id
=
-
1
;
p
id
->
es
->
fmt
.
psz_description
=
strdup
(
_
(
"DVB subtitles"
)
);
p
_fmt
->
psz_description
=
strdup
(
_
(
"DVB subtitles"
)
);
}
}
}
}
}
}
...
@@ -3428,73 +3443,71 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3428,73 +3443,71 @@ static void PMTSetupEs0x06( demux_t *p_demux, ts_pid_t *pid,
static
void
PMTSetupEs0xEA
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
static
void
PMTSetupEs0xEA
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
const
dvbpsi_pmt_es_t
*
p_es
)
const
dvbpsi_pmt_es_t
*
p_es
)
{
{
dvbpsi_descriptor_t
*
p_dr
;
/* Registration Descriptor */
dvbpsi_descriptor_t
*
p_dr
=
PMTEsFindDescriptor
(
p_es
,
0x05
);
if
(
!
p_dr
)
{
msg_Err
(
p_demux
,
"Registration descriptor not found"
);
return
;
}
for
(
p_dr
=
p_es
->
p_first_descriptor
;
p_dr
!=
NULL
;
if
(
p_dr
->
i_length
<
4
)
// XXX VC-1 has extended this descriptor with sub-descriptor
p_dr
=
p_dr
->
p_next
)
{
{
msg_Dbg
(
p_demux
,
" * es pid=%d type=%d dr->i_tag=0x%x"
,
msg_Warn
(
p_demux
,
"invalid Registration Descriptor"
);
p_es
->
i_pid
,
p_es
->
i_type
,
p_dr
->
i_tag
);
return
;
}
if
(
p_dr
->
i_tag
==
0x05
)
if
(
!
memcmp
(
p_dr
->
p_data
,
"VC-1"
,
4
)
)
{
{
/* Registration Descriptor */
es_format_t
*
p_fmt
=
&
pid
->
es
->
fmt
;
if
(
p_dr
->
i_length
<
4
)
// XXX VC-1 has extended this descriptor with sub-descriptor
{
/* registration descriptor for VC-1 (SMPTE rp227) */
msg_Warn
(
p_demux
,
"invalid Registration Descriptor"
);
p_fmt
->
i_cat
=
VIDEO_ES
;
}
p_fmt
->
i_codec
=
VLC_FOURCC
(
'W'
,
'V'
,
'C'
,
'1'
);
else
{
/* XXX With Simple and Main profile the SEQUENCE
if
(
!
memcmp
(
p_dr
->
p_data
,
"VC-1"
,
4
)
)
* header is modified: video width and height are
{
* inserted just after the start code as 2 int16_t
/* registration descriptor for VC-1 (SMPTE rp227) */
* The packetizer will take care of that. */
pid
->
es
->
fmt
.
i_cat
=
VIDEO_ES
;
}
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'W'
,
'V'
,
'C'
,
'1'
);
else
{
/* XXX With Simple and Main profile the SEQUENCE
msg_Warn
(
p_demux
,
* header is modified: video width and height are
"unknown Registration Descriptor (%4.4s)"
,
* inserted just after the start code as 2 int16_t
p_dr
->
p_data
);
* The packetizer will take care of that. */
}
else
{
msg_Warn
(
p_demux
,
"unknown Registration Descriptor (%4.4s)"
,
p_dr
->
p_data
);
}
}
}
}
}
}
}
static
void
PMTSetupEs0xD1
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
static
void
PMTSetupEs0xD1
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
const
dvbpsi_pmt_es_t
*
p_es
)
const
dvbpsi_pmt_es_t
*
p_es
)
{
{
dvbpsi_descriptor_t
*
p_dr
;
/* Registration Descriptor */
dvbpsi_descriptor_t
*
p_dr
=
PMTEsFindDescriptor
(
p_es
,
0x05
);
if
(
!
p_dr
)
{
msg_Err
(
p_demux
,
"Registration descriptor not found"
);
return
;
}
if
(
p_dr
->
i_length
<
4
)
{
msg_Warn
(
p_demux
,
"invalid Registration Descriptor"
);
return
;
}
for
(
p_dr
=
p_es
->
p_first_descriptor
;
p_dr
!=
NULL
;
if
(
!
memcmp
(
p_dr
->
p_data
,
"drac"
,
4
)
)
p_dr
=
p_dr
->
p_next
)
{
{
msg_Dbg
(
p_demux
,
" * es pid=%d type=%d dr->i_tag=0x%x"
,
es_format_t
*
p_fmt
=
&
pid
->
es
->
fmt
;
p_es
->
i_pid
,
p_es
->
i_type
,
p_dr
->
i_tag
);
if
(
p_dr
->
i_tag
==
0x05
)
/* registration descriptor for Dirac
{
* (backwards compatable with VC-2 (SMPTE Sxxxx:2008)) */
/* Registration Descriptor */
p_fmt
->
i_cat
=
VIDEO_ES
;
if
(
!
memcmp
(
p_dr
->
p_data
,
"drac"
,
4
)
)
p_fmt
->
i_codec
=
VLC_FOURCC
(
'd'
,
'r'
,
'a'
,
'c'
);
{
}
/* registration descriptor for Dirac
else
* (backwards compatable with VC-2 (SMPTE Sxxxx:2008)) */
{
pid
->
es
->
fmt
.
i_cat
=
VIDEO_ES
;
msg_Warn
(
p_demux
,
pid
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'd'
,
'r'
,
'a'
,
'c'
);
"unknown Registration Descriptor (%4.4s)"
,
}
p_dr
->
p_data
);
else
{
msg_Warn
(
p_demux
,
"unknown Registration Descriptor (%4.4s)"
,
p_dr
->
p_data
);
}
}
}
}
}
}
...
@@ -3502,71 +3515,67 @@ static void PMTSetupEs0xA0( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3502,71 +3515,67 @@ static void PMTSetupEs0xA0( demux_t *p_demux, ts_pid_t *pid,
const
dvbpsi_pmt_es_t
*
p_es
)
const
dvbpsi_pmt_es_t
*
p_es
)
{
{
/* MSCODEC sent by vlc */
/* MSCODEC sent by vlc */
dvbpsi_descriptor_t
*
p_dr
=
p_es
->
p_first_descriptor
;
dvbpsi_descriptor_t
*
p_dr
=
PMTEsFindDescriptor
(
p_es
,
0xa0
);
if
(
!
p_dr
||
p_dr
->
i_length
<
10
)
while
(
p_dr
&&
(
p_dr
->
i_tag
!=
0xa0
)
)
p_dr
=
p_dr
->
p_next
;
if
(
p_dr
&&
p_dr
->
i_length
>=
8
)
{
{
pid
->
es
->
fmt
.
i_cat
=
VIDEO_ES
;
msg_Warn
(
p_demux
,
pid
->
es
->
fmt
.
i_codec
=
"private MSCODEC (vlc) without bih private descriptor"
);
VLC_FOURCC
(
p_dr
->
p_data
[
0
],
p_dr
->
p_data
[
1
],
return
;
p_dr
->
p_data
[
2
],
p_dr
->
p_data
[
3
]
);
pid
->
es
->
fmt
.
video
.
i_width
=
(
p_dr
->
p_data
[
4
]
<<
8
)
|
p_dr
->
p_data
[
5
];
pid
->
es
->
fmt
.
video
.
i_height
=
(
p_dr
->
p_data
[
6
]
<<
8
)
|
p_dr
->
p_data
[
7
];
pid
->
es
->
fmt
.
i_extra
=
(
p_dr
->
p_data
[
8
]
<<
8
)
|
p_dr
->
p_data
[
9
];
if
(
pid
->
es
->
fmt
.
i_extra
>
0
)
{
pid
->
es
->
fmt
.
p_extra
=
malloc
(
pid
->
es
->
fmt
.
i_extra
);
if
(
pid
->
es
->
fmt
.
p_extra
)
memcpy
(
pid
->
es
->
fmt
.
p_extra
,
&
p_dr
->
p_data
[
10
],
pid
->
es
->
fmt
.
i_extra
);
}
}
}
else
es_format_t
*
p_fmt
=
&
pid
->
es
->
fmt
;
p_fmt
->
i_cat
=
VIDEO_ES
;
p_fmt
->
i_codec
=
VLC_FOURCC
(
p_dr
->
p_data
[
0
],
p_dr
->
p_data
[
1
],
p_dr
->
p_data
[
2
],
p_dr
->
p_data
[
3
]
);
p_fmt
->
video
.
i_width
=
GetWBE
(
&
p_dr
->
p_data
[
4
]
);
p_fmt
->
video
.
i_height
=
GetWBE
(
&
p_dr
->
p_data
[
6
]
);
p_fmt
->
i_extra
=
GetWBE
(
&
p_dr
->
p_data
[
8
]
);
if
(
p_fmt
->
i_extra
>
0
)
{
{
msg_Warn
(
p_demux
,
"private MSCODEC (vlc) without bih private "
p_fmt
->
p_extra
=
malloc
(
p_fmt
->
i_extra
);
"descriptor"
);
if
(
p_fmt
->
p_extra
)
memcpy
(
p_fmt
->
p_extra
,
&
p_dr
->
p_data
[
10
],
__MIN
(
p_fmt
->
i_extra
,
p_dr
->
i_length
-
10
)
);
else
p_fmt
->
i_extra
=
0
;
}
}
/* For such stream we will gather them ourself and don't launch a
/* For such stream we will gather them ourself and don't launch a
* packetizer.
* packetizer.
* Yes it's ugly but it's the only way to have DIV3 working */
* Yes it's ugly but it's the only way to have DIV3 working */
p
id
->
es
->
fmt
.
b_packetized
=
true
;
p
_fmt
->
b_packetized
=
true
;
}
}
static
void
PMTSetupEsHDMV
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
static
void
PMTSetupEsHDMV
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
const
dvbpsi_pmt_es_t
*
p_es
)
const
dvbpsi_pmt_es_t
*
p_es
)
{
{
es_format_t
*
p_fmt
=
&
pid
->
es
->
fmt
;
/* Blu-Ray mapping */
/* Blu-Ray mapping */
switch
(
p_es
->
i_type
)
switch
(
p_es
->
i_type
)
{
{
case
0x80
:
case
0x80
:
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'b'
,
'p'
,
'c'
,
'm'
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'b'
,
'p'
,
'c'
,
'm'
);
break
;
break
;
case
0x82
:
case
0x82
:
case
0x85
:
/* DTS-HD High resolution audio */
case
0x85
:
/* DTS-HD High resolution audio */
case
0x86
:
/* DTS-HD Master audio */
case
0x86
:
/* DTS-HD Master audio */
case
0xA2
:
/* Secondary DTS audio */
case
0xA2
:
/* Secondary DTS audio */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
);
break
;
break
;
case
0x83
:
/* TrueHD AC3 */
case
0x83
:
/* TrueHD AC3 */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'l'
,
'p'
,
' '
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'm'
,
'l'
,
'p'
,
' '
);
break
;
break
;
case
0x84
:
/* E-AC3 */
case
0x84
:
/* E-AC3 */
case
0x87
:
/* E-AC3 */
case
0x87
:
/* E-AC3 */
case
0xA1
:
/* Secondary E-AC3 */
case
0xA1
:
/* Secondary E-AC3 */
p
id
->
es
->
fmt
.
i_cat
=
AUDIO_ES
;
p
_fmt
->
i_cat
=
AUDIO_ES
;
p
id
->
es
->
fmt
.
i_codec
=
VLC_FOURCC
(
'e'
,
'a'
,
'c'
,
'3'
);
p
_fmt
->
i_codec
=
VLC_FOURCC
(
'e'
,
'a'
,
'c'
,
'3'
);
break
;
break
;
case
0x90
:
/* Presentation graphics */
case
0x90
:
/* Presentation graphics */
case
0x91
:
/* Interactive graphics */
case
0x91
:
/* Interactive graphics */
...
@@ -3576,107 +3585,107 @@ static void PMTSetupEsHDMV( demux_t *p_demux, ts_pid_t *pid,
...
@@ -3576,107 +3585,107 @@ static void PMTSetupEsHDMV( demux_t *p_demux, ts_pid_t *pid,
}
}
}
}
static
void
PMTParseEsIso639
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
static
void
PMTParseEsIso639
(
demux_t
*
p_demux
,
ts_pid_t
*
pid
,
const
dvbpsi_pmt_es_t
*
p_es
)
const
dvbpsi_pmt_es_t
*
p_es
)
{
{
/* get language descriptor */
/* get language descriptor */
dvbpsi_descriptor_t
*
p_dr
=
p_es
->
p_first_descriptor
;
dvbpsi_descriptor_t
*
p_dr
=
PMTEsFindDescriptor
(
p_es
,
0x0a
);
while
(
p_dr
&&
(
p_dr
->
i_tag
!=
0x0a
)
)
p_dr
=
p_dr
->
p_next
;
if
(
p_dr
)
if
(
!
p_dr
)
return
;
dvbpsi_iso639_dr_t
*
p_decoded
=
dvbpsi_DecodeISO639Dr
(
p_dr
);
if
(
!
p_decoded
)
{
{
dvbpsi_iso639_dr_t
*
p_decoded
=
dvbpsi_DecodeISO639Dr
(
p_dr
);
msg_Err
(
p_demux
,
"Failed to decode a ISO 639 descriptor"
);
return
;
}
if
(
p_decoded
)
{
#if defined(DR_0A_API_VER) && (DR_0A_API_VER >= 2)
#if defined(DR_0A_API_VER) && (DR_0A_API_VER >= 2)
pid
->
es
->
fmt
.
psz_language
=
malloc
(
4
);
pid
->
es
->
fmt
.
psz_language
=
malloc
(
4
);
if
(
pid
->
es
->
fmt
.
psz_language
)
if
(
pid
->
es
->
fmt
.
psz_language
)
{
memcpy
(
pid
->
es
->
fmt
.
psz_language
,
p_decoded
->
code
[
0
].
iso_639_code
,
3
);
pid
->
es
->
fmt
.
psz_language
[
3
]
=
0
;
msg_Dbg
(
p_demux
,
"found language: %s"
,
pid
->
es
->
fmt
.
psz_language
);
}
switch
(
p_decoded
->
code
[
0
].
i_audio_type
)
{
case
0
:
pid
->
es
->
fmt
.
psz_description
=
NULL
;
break
;
case
1
:
pid
->
es
->
fmt
.
psz_description
=
strdup
(
_
(
"clean effects"
));
break
;
case
2
:
pid
->
es
->
fmt
.
psz_description
=
strdup
(
_
(
"hearing impaired"
));
break
;
case
3
:
pid
->
es
->
fmt
.
psz_description
=
strdup
(
_
(
"visual impaired commentary"
));
break
;
default:
msg_Dbg
(
p_demux
,
"unknown audio type: %d"
,
p_decoded
->
code
[
0
].
i_audio_type
);
pid
->
es
->
fmt
.
psz_description
=
NULL
;
break
;
}
pid
->
es
->
fmt
.
i_extra_languages
=
p_decoded
->
i_code_count
-
1
;
if
(
pid
->
es
->
fmt
.
i_extra_languages
>
0
)
pid
->
es
->
fmt
.
p_extra_languages
=
malloc
(
sizeof
(
*
pid
->
es
->
fmt
.
p_extra_languages
)
*
pid
->
es
->
fmt
.
i_extra_languages
);
if
(
pid
->
es
->
fmt
.
p_extra_languages
)
{
for
(
int
i
=
0
;
i
<
pid
->
es
->
fmt
.
i_extra_languages
;
i
++
)
{
msg_Dbg
(
p_demux
,
"bang"
);
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
=
malloc
(
4
);
if
(
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
)
{
{
memcpy
(
pid
->
es
->
fmt
.
psz_language
,
memcpy
(
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
,
p_decoded
->
code
[
0
].
iso_639_code
,
3
);
p_decoded
->
code
[
i
+
1
].
iso_639_code
,
3
);
pid
->
es
->
fmt
.
psz_language
[
3
]
=
0
;
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
[
3
]
=
'\0'
;
msg_Dbg
(
p_demux
,
"found language: %s"
,
pid
->
es
->
fmt
.
psz_language
);
}
}
switch
(
p_decoded
->
code
[
0
].
i_audio_type
)
switch
(
p_decoded
->
code
[
i
].
i_audio_type
)
{
{
case
0
:
case
0
:
pid
->
es
->
fmt
.
psz_description
=
NULL
;
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_description
=
NULL
;
break
;
break
;
case
1
:
case
1
:
pid
->
es
->
fmt
.
psz_description
=
pid
->
es
->
fmt
.
p
_extra_languages
[
i
].
p
sz_description
=
strdup
(
_
(
"clean effects"
));
strdup
(
_
(
"clean effects"
));
break
;
break
;
case
2
:
case
2
:
pid
->
es
->
fmt
.
psz_description
=
pid
->
es
->
fmt
.
p
_extra_languages
[
i
].
p
sz_description
=
strdup
(
_
(
"hearing impaired"
));
strdup
(
_
(
"hearing impaired"
));
break
;
break
;
case
3
:
case
3
:
pid
->
es
->
fmt
.
psz_description
=
pid
->
es
->
fmt
.
p
_extra_languages
[
i
].
p
sz_description
=
strdup
(
_
(
"visual impaired commentary"
));
strdup
(
_
(
"visual impaired commentary"
));
break
;
break
;
default:
default:
msg_Dbg
(
p_demux
,
"unknown audio type: %d"
,
msg_Dbg
(
p_demux
,
"unknown audio type: %d"
,
p_decoded
->
code
[
0
].
i_audio_type
);
p_decoded
->
code
[
i
].
i_audio_type
);
pid
->
es
->
fmt
.
psz_description
=
NULL
;
pid
->
es
->
fmt
.
psz_description
=
NULL
;
break
;
break
;
}
}
pid
->
es
->
fmt
.
i_extra_languages
=
p_decoded
->
i_code_count
-
1
;
if
(
pid
->
es
->
fmt
.
i_extra_languages
>
0
)
pid
->
es
->
fmt
.
p_extra_languages
=
malloc
(
sizeof
(
*
pid
->
es
->
fmt
.
p_extra_languages
)
*
pid
->
es
->
fmt
.
i_extra_languages
);
if
(
pid
->
es
->
fmt
.
p_extra_languages
)
{
for
(
int
i
=
0
;
i
<
pid
->
es
->
fmt
.
i_extra_languages
;
i
++
)
{
msg_Dbg
(
p_demux
,
"bang"
);
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
=
malloc
(
4
);
if
(
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
)
{
memcpy
(
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
,
p_decoded
->
code
[
i
+
1
].
iso_639_code
,
3
);
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_language
[
3
]
=
'\0'
;
}
switch
(
p_decoded
->
code
[
i
].
i_audio_type
)
{
case
0
:
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_description
=
NULL
;
break
;
case
1
:
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_description
=
strdup
(
_
(
"clean effects"
));
break
;
case
2
:
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_description
=
strdup
(
_
(
"hearing impaired"
));
break
;
case
3
:
pid
->
es
->
fmt
.
p_extra_languages
[
i
].
psz_description
=
strdup
(
_
(
"visual impaired commentary"
));
break
;
default:
msg_Dbg
(
p_demux
,
"unknown audio type: %d"
,
p_decoded
->
code
[
i
].
i_audio_type
);
pid
->
es
->
fmt
.
psz_description
=
NULL
;
break
;
}
}
}
#else
pid
->
es
->
fmt
.
psz_language
=
malloc
(
4
);
if
(
pid
->
es
->
fmt
.
psz_language
)
{
memcpy
(
pid
->
es
->
fmt
.
psz_language
,
p_decoded
->
i_iso_639_code
,
3
);
pid
->
es
->
fmt
.
psz_language
[
3
]
=
0
;
}
#endif
}
}
}
}
#else
pid
->
es
->
fmt
.
psz_language
=
malloc
(
4
);
if
(
pid
->
es
->
fmt
.
psz_language
)
{
memcpy
(
pid
->
es
->
fmt
.
psz_language
,
p_decoded
->
i_iso_639_code
,
3
);
pid
->
es
->
fmt
.
psz_language
[
3
]
=
0
;
}
#endif
}
}
static
void
PMTCallBack
(
demux_t
*
p_demux
,
dvbpsi_pmt_t
*
p_pmt
)
static
void
PMTCallBack
(
demux_t
*
p_demux
,
dvbpsi_pmt_t
*
p_pmt
)
...
@@ -3827,6 +3836,13 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
...
@@ -3827,6 +3836,13 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
continue
;
continue
;
}
}
for
(
p_dr
=
p_es
->
p_first_descriptor
;
p_dr
!=
NULL
;
p_dr
=
p_dr
->
p_next
)
{
msg_Dbg
(
p_demux
,
" * es pid=%d type=%d dr->i_tag=0x%x"
,
p_es
->
i_pid
,
p_es
->
i_type
,
p_dr
->
i_tag
);
}
PIDInit
(
pid
,
false
,
pmt
->
psi
);
PIDInit
(
pid
,
false
,
pmt
->
psi
);
PIDFillFormat
(
pid
,
p_es
->
i_type
);
PIDFillFormat
(
pid
,
p_es
->
i_type
);
pid
->
i_owner_number
=
prg
->
i_number
;
pid
->
i_owner_number
=
prg
->
i_number
;
...
@@ -3930,16 +3946,12 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
...
@@ -3930,16 +3946,12 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
}
}
p_sys
->
pid
[
p_es
->
i_pid
]
=
*
pid
;
p_sys
->
pid
[
p_es
->
i_pid
]
=
*
pid
;
for
(
p_dr
=
p_es
->
p_first_descriptor
;
p_dr
!=
NULL
;
p_dr
=
PMTEsFindDescriptor
(
p_es
,
0x09
)
;
p_dr
=
p_dr
->
p_next
)
if
(
p_dr
&&
p_dr
->
i_length
>=
2
)
{
{
if
(
p_dr
->
i_tag
==
0x9
)
uint16_t
i_sysid
=
(
p_dr
->
p_data
[
0
]
<<
8
)
|
p_dr
->
p_data
[
1
];
{
msg_Dbg
(
p_demux
,
" * descriptor : CA (0x9) SysID 0x%x"
,
uint16_t
i_sysid
=
((
uint16_t
)
p_dr
->
p_data
[
0
]
<<
8
)
i_sysid
);
|
p_dr
->
p_data
[
1
];
msg_Dbg
(
p_demux
,
" * descriptor : CA (0x9) SysID 0x%x"
,
i_sysid
);
}
}
}
if
(
ProgramIsSelected
(
p_demux
,
prg
->
i_number
)
&&
if
(
ProgramIsSelected
(
p_demux
,
prg
->
i_number
)
&&
...
...
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