[vlc-commits] mux: ts: fix and always set DTS descriptor

Francois Cartegnie git at videolan.org
Wed Mar 14 18:03:46 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Mar 14 11:12:50 2018 +0100| [9d93eb5e2a3226712a044c64ab8bc822bb4221a2] | committer: Francois Cartegnie

mux: ts: fix and always set DTS descriptor

(cherry picked from commit ebfff8ab2948ead7cd1f563a3edb87428672b8eb)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9d93eb5e2a3226712a044c64ab8bc822bb4221a2
---

 modules/mux/mpeg/tables.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/mux/mpeg/tables.c b/modules/mux/mpeg/tables.c
index ef46a42757..edf6445517 100644
--- a/modules/mux/mpeg/tables.c
+++ b/modules/mux/mpeg/tables.c
@@ -543,16 +543,18 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
         }
         else if( p_stream->fmt->i_codec == VLC_CODEC_DTS )
         {
+            uint8_t i_ver;
             /* DTS registration descriptor (ETSI TS 101 154 Annex F) */
-            if(popcount(p_stream->fmt->audio.i_bytes_per_frame) == 1)
+            if(popcount(p_stream->fmt->audio.i_frame_length) == 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 );
-                }
+                i_ver = ctz( p_stream->fmt->audio.i_frame_length >> 8 );
+                if(i_ver == 0 || i_ver > 3)
+                   i_ver = 1;
+                i_ver += '0';
             }
+            else i_ver = '0';
+            uint8_t data[4] = { 'D', 'T', 'S', i_ver };
+            dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
         }
         else if( p_stream->fmt->i_codec == VLC_CODEC_A52 )
         {



More information about the vlc-commits mailing list