[vlc-commits] demux: mp4: remove webvtt samples conversion

Francois Cartegnie git at videolan.org
Thu Oct 26 11:47:33 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 19 16:50:41 2017 +0200| [08d70cc2191cde6423716ebceec81fe349764eb6] | committer: Francois Cartegnie

demux: mp4: remove webvtt samples conversion

Enables full support as WEBVTT

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08d70cc2191cde6423716ebceec81fe349764eb6
---

 modules/demux/mp4/essetup.c |  3 +--
 modules/demux/mp4/mp4.c     | 38 ++------------------------------------
 2 files changed, 3 insertions(+), 38 deletions(-)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 60436422a4..d893a163dc 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -1242,8 +1242,7 @@ int SetupSpuES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
             p_track->fmt.i_codec = VLC_CODEC_TTML;
             break;
         case ATOM_wvtt:
-            p_track->fmt.i_codec = VLC_CODEC_SUBT;
-            p_track->fmt.i_original_fourcc = ATOM_wvtt;
+            p_track->fmt.i_codec = VLC_CODEC_WEBVTT;
             break;
         case ATOM_c608: /* EIA608 closed captions */
             p_track->fmt.i_codec = VLC_CODEC_CEA608;
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 10a98c03cc..1307a1bc29 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -408,38 +408,6 @@ static int CreateTracks( demux_t *p_demux, unsigned i_tracks )
     return VLC_SUCCESS;
 }
 
-static block_t * MP4_WebVTT_Convert( demux_t *p_demux, block_t * p_block )
-{
-    stream_t *p_stream =
-            vlc_stream_MemoryNew( p_demux, p_block->p_buffer,
-                                  p_block->i_buffer, true );
-    if( p_stream )
-    {
-        MP4_Box_t *p_vroot = MP4_BoxNew(ATOM_wvtt);
-        if( p_vroot )
-        {
-            p_vroot->i_size = p_block->i_buffer;
-            if ( MP4_ReadBoxContainerChildren( p_stream, p_vroot, NULL ) == 1 )
-            {
-                MP4_Box_t *p_payl = MP4_BoxGet( p_vroot, "vttc/payl" );
-                if( p_payl && p_payl->i_size >= 9 )
-                {
-                    p_block->p_buffer += p_payl->i_pos + 8;
-                    p_block->i_buffer = p_payl->i_size - 8;
-                    p_block->p_buffer[p_block->i_buffer - 1] = '\0';
-                }
-                else p_block->i_buffer = 0;
-#ifndef NDEBUG
-                MP4_BoxDumpStructure(p_stream, p_vroot);
-#endif
-            }
-            MP4_BoxFree(p_vroot);
-        }
-        vlc_stream_Delete( p_stream );
-     }
-    return p_block;
-}
-
 static block_t * MP4_EIA608_Convert( block_t * p_block )
 {
     /* Rebuild codec data from encap */
@@ -581,18 +549,16 @@ static block_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track
     {
         switch( p_track->fmt.i_codec )
         {
+            case VLC_CODEC_WEBVTT:
             case VLC_CODEC_TTML:
             case VLC_CODEC_TX3G:
             case VLC_CODEC_SPU:
+            case VLC_CODEC_SUBT:
             /* accept as-is */
             break;
             case VLC_CODEC_CEA608:
                 p_block = MP4_EIA608_Convert( p_block );
             break;
-            case VLC_CODEC_SUBT:
-                if( p_track->fmt.i_original_fourcc == ATOM_wvtt )
-                    p_block = MP4_WebVTT_Convert( p_demux, p_block );
-            break;
         default:
             p_block->i_buffer = 0;
             break;



More information about the vlc-commits mailing list