[vlc-commits] commit: transcode: destroy spu on transcode_spu_close (Ilkka Ollakka )

git at videolan.org git at videolan.org
Sun Sep 26 12:16:22 CEST 2010


vlc/vlc-1.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Sep 22 12:48:41 2010 +0300| [15a0601371935bb2d36945a1fc8b22ea098623c2] | committer: Rémi Duraffort 

transcode: destroy spu on transcode_spu_close

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()
(cherry picked from commit 41b8c2e1f660c767ee7a96ab69204b94b1470ca8)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 modules/stream_out/transcode/spu.c       |   11 +++++++++--
 modules/stream_out/transcode/transcode.c |    2 +-
 modules/stream_out/transcode/transcode.h |    2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/transcode/spu.c b/modules/stream_out/transcode/spu.c
index 04325d9..32b0608 100644
--- a/modules/stream_out/transcode/spu.c
+++ b/modules/stream_out/transcode/spu.c
@@ -100,8 +100,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 );
@@ -111,6 +112,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,
@@ -180,7 +187,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;
         }
     }
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index fc13f7a..7a51214 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -643,7 +643,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;
         }
     }
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index 23f9ab7..cde0072 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -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 *);



More information about the vlc-commits mailing list