[vlc-devel] commit: For private stream_type, fallback on registration descriptor in TS demuxer. (Laurent Aimar )
git version control
git at videolan.org
Fri Feb 26 23:53:35 CET 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Feb 26 23:50:25 2010 +0100| [c5154680e5159e3952248aa3f7312a79552ff075] | committer: Laurent Aimar
For private stream_type, fallback on registration descriptor in TS demuxer.
It closes #3339 (the stream is correctly detected), but as the 302M content is
not PCM data (probably AC3 or Dolby E), the audio is not correctly decoded.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c5154680e5159e3952248aa3f7312a79552ff075
---
modules/demux/ts.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 88be47f..4838ebe 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -3781,6 +3781,38 @@ static void PMTSetupEsHDMV( demux_t *p_demux, ts_pid_t *pid,
break;
}
}
+
+static void PMTSetupEsRegistration( demux_t *p_demux, ts_pid_t *pid,
+ const dvbpsi_pmt_es_t *p_es )
+{
+ static const struct
+ {
+ char psz_tag[5];
+ int i_cat;
+ vlc_fourcc_t i_codec;
+ } p_regs[] = {
+ { "AC-3", AUDIO_ES, VLC_CODEC_A52 },
+ { "DTS1", AUDIO_ES, VLC_CODEC_DTS },
+ { "DTS2", AUDIO_ES, VLC_CODEC_DTS },
+ { "DTS3", AUDIO_ES, VLC_CODEC_DTS },
+ { "BSSD", AUDIO_ES, VLC_CODEC_302M },
+ { "VC-1", VIDEO_ES, VLC_CODEC_VC1 },
+ { "drac", VIDEO_ES, VLC_CODEC_DIRAC },
+ { "", UNKNOWN_ES, 0 }
+ };
+ es_format_t *p_fmt = &pid->es->fmt;
+
+ for( int i = 0; p_regs[i].i_cat != UNKNOWN_ES; i++ )
+ {
+ if( PMTEsHasRegistration( p_demux, p_es, p_regs[i].psz_tag ) )
+ {
+ p_fmt->i_cat = p_regs[i].i_cat;
+ p_fmt->i_codec = p_regs[i].i_codec;
+ break;
+ }
+ }
+}
+
static void PMTParseEsIso639( demux_t *p_demux, ts_pid_t *pid,
const dvbpsi_pmt_es_t *p_es )
{
@@ -4068,6 +4100,10 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
{
PMTSetupEsHDMV( p_demux, pid, p_es );
}
+ else if( p_es->i_type >= 0x80 )
+ {
+ PMTSetupEsRegistration( p_demux, pid, p_es );
+ }
if( pid->es->fmt.i_cat == AUDIO_ES ||
( pid->es->fmt.i_cat == SPU_ES &&
More information about the vlc-devel
mailing list