]> git.sesse.net Git - vlc/commitdiff
transcode: destroy spu on transcode_spu_close
authorIlkka Ollakka <ileoo@videolan.org>
Wed, 22 Sep 2010 09:48:41 +0000 (12:48 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Wed, 22 Sep 2010 09:52:17 +0000 (12:52 +0300)
Fixes issue for me when doing transcode{}:gather: --sout-keep and subtitle
overlaying from dvbs. Otherwise keeps last subtitles on video if new channel
doesn't contain dvbs track.

also consistenty as spu_Create is called on transcode_spu_new()

modules/stream_out/transcode/spu.c
modules/stream_out/transcode/transcode.c
modules/stream_out/transcode/transcode.h

index 85f45d3238d61ef8bfb829f954e9624e639eee0d..3f1540bbd3c519c21430020ed10e5cfd482bf63a 100644 (file)
@@ -99,8 +99,9 @@ int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_t *id )
     return VLC_SUCCESS;
 }
 
-void transcode_spu_close( sout_stream_id_t *id)
+void transcode_spu_close( sout_stream_t *p_stream, sout_stream_id_t *id)
 {
+    sout_stream_sys_t *p_sys = p_stream->p_sys;
     /* Close decoder */
     if( id->p_decoder->p_module )
         module_unneed( id->p_decoder, id->p_decoder->p_module );
@@ -110,6 +111,12 @@ void transcode_spu_close( sout_stream_id_t *id)
     /* Close encoder */
     if( id->p_encoder->p_module )
         module_unneed( id->p_encoder, id->p_encoder->p_module );
+
+    if( p_sys->p_spu )
+    {
+        spu_Destroy( p_sys->p_spu );
+        p_sys->p_spu = NULL;
+    }
 }
 
 int transcode_spu_process( sout_stream_t *p_stream,
@@ -179,7 +186,7 @@ bool transcode_spu_add( sout_stream_t *p_stream, es_format_t *p_fmt,
 
         if( !id->id )
         {
-            transcode_spu_close( id );
+            transcode_spu_close( p_stream, id );
             return false;
         }
     }
index 6db76ca5cdcefe6e32d1d14ed5b68fae4e397834..fd5fad2db914915c6cfab2b33a3ce98671ebc082 100644 (file)
@@ -616,7 +616,7 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
             if( p_sys->b_osd )
                 transcode_osd_close( p_stream, id );
             else
-                transcode_spu_close( id );
+                transcode_spu_close( p_stream, id );
             break;
         }
     }
index 23f9ab75e6496332ec671f35c5347214428b63e7..cde007298faa7012dba83d7e73614c451dcfc460 100644 (file)
@@ -107,7 +107,7 @@ bool transcode_osd_add    ( sout_stream_t *, es_format_t *, sout_stream_id_t *);
 /* SPU */
 
 int  transcode_spu_new    ( sout_stream_t *, sout_stream_id_t * );
-void transcode_spu_close  ( sout_stream_id_t * );
+void transcode_spu_close  ( sout_stream_t *, sout_stream_id_t * );
 int  transcode_spu_process( sout_stream_t *, sout_stream_id_t *,
                                    block_t *, block_t ** );
 bool transcode_spu_add    ( sout_stream_t *, es_format_t *, sout_stream_id_t *);