]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/clone.c
decomp: fix leak on error and clean up a little
[vlc] / modules / video_filter / clone.c
index 1746dd9dd943128fb5d5edcfabebab07c3af8f05..284ff8adb663e20e12cb3430d144e93c3c39082c 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * clone.c : Clone video plugin for vlc
  *****************************************************************************
- * Copyright (C) 2002-2009 the VideoLAN team
+ * Copyright (C) 2002-2009 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -44,6 +44,8 @@
 #define VOUTLIST_LONGTEXT N_("You can use specific video output modules " \
         "for the clones. Use a comma-separated list of modules." )
 
+#define CLONE_HELP N_("Duplicate your video to multiple windows " \
+        "and/or video output modules")
 #define CFG_PREFIX "clone-"
 
 static int  Open ( vlc_object_t * );
@@ -53,11 +55,13 @@ vlc_module_begin ()
     set_description( N_("Clone video filter") )
     set_capability( "video splitter", 0 )
     set_shortname( N_("Clone" ))
+    set_help(CLONE_HELP)
     set_category( CAT_VIDEO )
     set_subcategory( SUBCAT_VIDEO_VFILTER )
 
-    add_integer( CFG_PREFIX "count", 2, NULL, COUNT_TEXT, COUNT_LONGTEXT, false )
-    add_string ( CFG_PREFIX "vout-list", NULL, NULL, VOUTLIST_TEXT, VOUTLIST_LONGTEXT, true )
+    add_integer( CFG_PREFIX "count", 2, COUNT_TEXT, COUNT_LONGTEXT, false )
+    add_module_list( CFG_PREFIX "vout-list", "vout display", NULL,
+                     VOUTLIST_TEXT, VOUTLIST_LONGTEXT, true )
 
     add_shortcut( "clone" )
     set_callbacks( Open, Close )
@@ -70,7 +74,7 @@ static const char *const ppsz_filter_options[] = {
     "count", "vout-list", NULL
 };
 
-#define VOUTSEPARATOR ','
+#define VOUTSEPARATOR ':'
 
 static int Filter( video_splitter_t *, picture_t *pp_dst[], picture_t * );
 
@@ -143,8 +147,8 @@ static int Open( vlc_object_t *p_this )
     {
         video_splitter_output_t *p_cfg = &p_splitter->p_output[i];
         video_format_Copy( &p_cfg->fmt, &p_splitter->fmt );
-        p_cfg->window.i_x = -1;
-        p_cfg->window.i_y = -1;
+        p_cfg->window.i_x = 0;
+        p_cfg->window.i_y = 0;
         p_cfg->window.i_align = 0;
     }
 
@@ -181,10 +185,14 @@ static int Filter( video_splitter_t *p_splitter,
                    picture_t *pp_dst[], picture_t *p_src )
 {
     if( video_splitter_NewPicture( p_splitter, pp_dst ) )
+    {
+        picture_Release( p_src );
         return VLC_EGENERIC;
+    }
 
     for( int i = 0; i < p_splitter->i_output; i++ )
         picture_Copy( pp_dst[i], p_src );
+
     picture_Release( p_src );
     return VLC_SUCCESS;
 }