]> git.sesse.net Git - vlc/blobdiff - modules/video_output/snapshot.c
Cleanup.
[vlc] / modules / video_output / snapshot.c
index 6ae4e65ab552965b7fd1d0921349d66204928d0e..a087268760f66bdc048decf06ae2b65ad4f33e7b 100644 (file)
  *****************************************************************************/
 
 /*****************************************************************************
- * This module is a pseudo video output the offers the possibility to
+ * This module is a pseudo video output that offers the possibility to
  * keep a cache of low-res snapshots.
  * The snapshot structure is defined in include/snapshot.h
  * In order to access the current snapshot cache, object variables are used:
  *   snapshot-list-pointer : the pointer on the first element in the list
- *   snapshot-datasize     : size of a snapshot 
+ *   snapshot-datasize     : size of a snapshot
  *                           (also available in snapshot_t->i_datasize)
  *   snapshot-cache-size   : size of the cache list
  *
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
-#include <vlc/vout.h>
-#include <vlc/intf.h>
-#include <snapshot.h>
+#include <vlc_vout.h>
+#include <vlc_interface.h>
+#include <vlc_input.h>
 
 /*****************************************************************************
  * Local prototypes
@@ -73,7 +76,7 @@ static void Display   ( vout_thread_t *, picture_t * );
 
 vlc_module_begin( );
     set_description( _( "Snapshot module" ) );
-    set_shortname( N_("Snapshot") );
+    set_shortname( _("Snapshot") );
 
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VOUT );
@@ -322,23 +325,15 @@ static int Init( vout_thread_t *p_vout )
 static void Destroy( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = ( vout_thread_t * )p_this;
-    vlc_object_t *p_vlc;
     int i_index;
 
+    var_Destroy( p_vout->p_sys->p_input, "snapshot-id" );
+
     vlc_object_release( p_vout->p_sys->p_input );
     var_Destroy( p_this, "snapshot-width" );
     var_Destroy( p_this, "snapshot-height" );
     var_Destroy( p_this, "snapshot-datasize" );
 
-    p_vlc = vlc_object_find( p_this, VLC_OBJECT_ROOT, FIND_PARENT );
-    if( p_vlc )
-    {
-        /* UnRegister the snapshot vout module at the root level */
-        /* var_Destroy (p_vlc, "snapshot-id"); */
-        var_Destroy( p_this->p_libvlc, "snapshot-id" );
-        vlc_object_release( p_vlc );
-    }
-
     for( i_index = 0 ; i_index < p_vout->p_sys->i_size ; i_index++ )
     {
         free( p_vout->p_sys->p_list[ i_index ]->p_data );
@@ -378,9 +373,9 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 
     i_index = p_vout->p_sys->i_index;
 
-    p_vout->p_vlc->pf_memcpy( p_vout->p_sys->p_list[i_index]->p_data,
-                              p_pic->p->p_pixels,
-                              p_vout->p_sys->i_datasize );
+    p_vout->p_libvlc->pf_memcpy( p_vout->p_sys->p_list[i_index]->p_data,
+                                 p_pic->p->p_pixels,
+                                  p_vout->p_sys->i_datasize );
 
     i_date = snapshot_GetMovietime( p_vout );