[vlc-commits] avformat: enable SPU_ES muxing

Alexandre Janniaux git at videolan.org
Thu Feb 13 12:03:47 CET 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Wed Dec 11 16:23:14 2019 +0100| [d613568eddc1f26a2e8bb85a2eb5c92ed1d56a60] | committer: Jean-Baptiste Kempf

avformat: enable SPU_ES muxing

The codec support in avformat should be mapped by the GetFfmpegCodec
call at the beginning of the function. In particular, this patch will
allow muxing subrip/text SPU within Matroska files.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/avformat/mux.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index a02206efbf..161aeabb8c 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -220,10 +220,16 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
         i_codec_id = AV_CODEC_ID_MP3;
     }
 
-    if( fmt->i_cat != VIDEO_ES && fmt->i_cat != AUDIO_ES)
+    /* Whitelist allowed ES categories */
+    switch( fmt->i_cat )
     {
-        msg_Warn( p_mux, "Unhandled ES category" );
-        return VLC_EGENERIC;
+        case VIDEO_ES:
+        case AUDIO_ES:
+        case SPU_ES:
+            break;
+        default:
+            msg_Warn( p_mux, "Unhandled ES category" );
+            return VLC_EGENERIC;
     }
 
     /* */



More information about the vlc-commits mailing list