[vlc-commits] mux: ts: apply proper dts registration
Francois Cartegnie
git at videolan.org
Tue Dec 13 19:59:41 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 13 19:39:16 2016 +0100| [1afb09af94d6a787d23dbc788ac7c5070175c130] | committer: Francois Cartegnie
mux: ts: apply proper dts registration
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1afb09af94d6a787d23dbc788ac7c5070175c130
---
modules/mux/mpeg/tables.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/mux/mpeg/tables.c b/modules/mux/mpeg/tables.c
index f2a574b..aeb40bc 100644
--- a/modules/mux/mpeg/tables.c
+++ b/modules/mux/mpeg/tables.c
@@ -456,10 +456,15 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
else if( p_stream->pes->i_codec == VLC_CODEC_DTS )
{
/* DTS registration descriptor (ETSI TS 101 154 Annex F) */
-
- /* DTS format identifier, frame size 1024 - FIXME */
- uint8_t data[4] = { 'D', 'T', 'S', '2' };
- dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
+ if(popcount(p_stream->fmt->audio.i_bytes_per_frame) == 1)
+ {
+ uint8_t i_ver = ctz( p_stream->fmt->audio.i_bytes_per_frame >> 8 );
+ if(i_ver > 0 && i_ver < 4)
+ {
+ uint8_t data[4] = { 'D', 'T', 'S', '0' + i_ver };
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
+ }
+ }
}
else if( p_stream->pes->i_codec == VLC_CODEC_EAC3 )
{
More information about the vlc-commits
mailing list