[vlc-devel] commit: avcodec: disable subtitle encoding (Pierre Ynard )

git version control git at videolan.org
Mon Sep 14 09:35:11 CEST 2009


vlc | branch: 1.0-bugfix | Pierre Ynard <linkfanel at yahoo.fr> | Mon Sep 14 09:32:51 2009 +0200| [3693093c088883570e247e494f30f845302e6a85] | committer: Pierre Ynard 

avcodec: disable subtitle encoding

The avcodec module can be successfully opened to encode subtitle formats
that it recognizes, but support is absent and pf_encode_sub is never
set, which leads to a crash.
(cherry picked from commit 2631cc77ba624894a204814219e8adf449207b21)

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

 modules/codec/avcodec/encoder.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 1eb037f..275c352 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -237,6 +237,12 @@ int OpenEncoder( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    if( p_enc->fmt_out.i_cat == SPU_ES )
+    {
+        /* We don't support subtitle encoding */
+        return VLC_EGENERIC;
+    }
+
     /* Initialization must be done before avcodec_find_encoder() */
     InitLibavcodec( p_this );
 




More information about the vlc-devel mailing list