]> git.sesse.net Git - vlc/commitdiff
cc codec: don't use a static variable in the middle of the code for no reason what...
authorDerk-Jan Hartman <hartman@videolan.org>
Sun, 3 Aug 2008 11:06:20 +0000 (13:06 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 3 Aug 2008 11:06:20 +0000 (13:06 +0200)
modules/codec/cc.c

index 5b09488a5aec16a8a211f42e67ac38868b371709..b4743eb2901bcb9d0d84f9a927972b11c037bfce 100644 (file)
@@ -155,6 +155,7 @@ struct decoder_sys_t
 
     int     i_block;
     block_t *pp_block[CC_MAX_REORDER_SIZE];
+    int64_t i_last_pts;
 
     int i_field;
     int i_channel;
@@ -206,6 +207,7 @@ static int Open( vlc_object_t *p_this )
     /* init of p_sys */
     memset( p_sys, 0, sizeof( *p_sys ) );
     p_sys->i_block = 0;
+    p_sys->i_last_pts = 0;
 
     p_sys->i_field = i_field;
     p_sys->i_channel = i_channel;
@@ -391,12 +393,12 @@ static subpicture_t *Convert( decoder_t *p_dec, block_t *p_block )
     if( p_block )
         block_Release( p_block );
 
-    static int64_t i_last = 0;
-    if( b_changed )//&& i_pts - i_last > 100*1000 )
+    p_sys->i_last_pts = 0;
+    if( b_changed )//&& i_pts - p_sys->i_last_pts > 100*1000 )
     {
         char *psz_subtitle = Eia608Text( &p_sys->eia608, false );
         char *psz_html     = NULL;//Eia608Text( &p_sys->eia608, true );
-        i_last = i_pts;
+        p_sys->i_last_pts = i_pts;
         return Subtitle( p_dec, psz_subtitle, psz_html, i_pts );
     }
     return NULL;