]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/logo.c
livehttp: don't remove segment-count to be less than number of segments requested
[vlc] / modules / video_filter / logo.c
index c7606d4b3734428db19961a2ce0ab728e0a03b98..83f7043ad6a0a0dffeffa4a5b85e92a721229c95 100644 (file)
@@ -1,25 +1,25 @@
 /*****************************************************************************
  * logo.c : logo video plugin for vlc
  *****************************************************************************
- * Copyright (C) 2003-2006 the VideoLAN team
+ * Copyright (C) 2003-2006 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *          Simon Latapie <garf@videolan.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.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -371,7 +371,7 @@ static subpicture_t *FilterSub( filter_t *p_filter, mtime_t date )
     if( p_list->i_repeat != -1 && p_list->i_counter == 0 )
     {
         p_list->i_repeat--;
-        if( p_list->i_repeat == 0 )
+        if( p_list->i_repeat < 0 )
             goto exit;
     }
     if( !p_pic || !p_logo->i_alpha ||
@@ -483,6 +483,16 @@ static picture_t *FilterVideo( filter_t *p_filter, picture_t *p_src )
             }
         }
 
+        if( p_sys->i_pos_x < 0 || p_sys->i_pos_y < 0 )
+        {
+            msg_Warn( p_filter,
+                "logo(%ix%i) doesn't fit into video(%ix%i)",
+                p_fmt->i_visible_width, p_fmt->i_visible_height,
+                i_dst_w,i_dst_h );
+            p_sys->i_pos_x = (p_sys->i_pos_x > 0) ? p_sys->i_pos_x : 0;
+            p_sys->i_pos_y = (p_sys->i_pos_y > 0) ? p_sys->i_pos_y : 0;
+        }
+
         /* */
         const int i_alpha = p_logo->i_alpha != -1 ? p_logo->i_alpha : p_list->i_alpha;
         if( filter_ConfigureBlend( p_sys->p_blend, i_dst_w, i_dst_h, p_fmt ) ||
@@ -615,7 +625,7 @@ static picture_t *LoadImage( vlc_object_t *p_this, const char *psz_filename )
     if( !p_image )
         return NULL;
 
-    char *psz_url = make_URI( psz_filename, NULL );
+    char *psz_url = vlc_path2uri( psz_filename, NULL );
     picture_t *p_pic = image_ReadUrl( p_image, psz_url, &fmt_in, &fmt_out );
     free( psz_url );
     image_HandlerDelete( p_image );