]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/rss.c
Sout - cleanup. and mark the TODO for the icecast MRL generation...
[vlc] / modules / video_filter / rss.c
index db0d0af59d1380b12deb1a0136c0db18937ee481..02a97fdba6fdb551d7d8d838fdbafabd4e2cb0c8 100644 (file)
@@ -29,8 +29,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
 
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
@@ -256,7 +254,8 @@ static int CreateFilter( vlc_object_t *p_this )
     p_sys->i_length = var_CreateGetInteger( p_filter, CFG_PREFIX "length" );
     p_sys->i_ttl = __MAX( 0, var_CreateGetInteger( p_filter, CFG_PREFIX "ttl" ) );
     p_sys->b_images = var_CreateGetBool( p_filter, CFG_PREFIX "images" );
-    p_sys->psz_marquee = (char *)malloc( p_sys->i_length );
+    p_sys->psz_marquee = (char *)malloc( p_sys->i_length + 1 );
+    p_sys->psz_marquee[p_sys->i_length] = '\0';
 
     p_sys->p_style = malloc( sizeof( text_style_t ));
     memcpy( p_sys->p_style, &default_text_style, sizeof( text_style_t ));
@@ -343,14 +342,15 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     subpicture_t *p_spu;
-    video_format_t fmt = {0};
-
+    video_format_t fmt;
     subpicture_region_t *p_region;
 
     int i_feed, i_item;
 
     struct rss_feed_t *p_feed;
 
+    memset( &fmt, 0, sizeof(video_format_t) );
+
     vlc_mutex_lock( &p_sys->lock );
 
     if( p_sys->last_date
@@ -480,14 +480,14 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
     /*  where to locate the string: */
     if( p_sys->i_xoff < 0 || p_sys->i_yoff < 0 )
     {   /* set to one of the 9 relative locations */
-        p_spu->i_flags = p_sys->i_pos;
+        p_spu->p_region->i_align = p_sys->i_pos;
         p_spu->i_x = 0;
         p_spu->i_y = 0;
         p_spu->b_absolute = VLC_FALSE;
     }
     else
     {   /*  set to an absolute xy, referenced to upper left corner */
-        p_spu->i_flags = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
+        p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP;
         p_spu->i_x = p_sys->i_xoff;
         p_spu->i_y = p_sys->i_yoff;
         p_spu->b_absolute = VLC_TRUE;
@@ -500,7 +500,9 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
     {
         /* Display the feed's image */
         picture_t *p_pic = p_feed->p_pic;
-        video_format_t fmt_out = {0};
+        video_format_t fmt_out;
+
+        memset( &fmt_out, 0, sizeof(video_format_t) );
 
         fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
         fmt_out.i_aspect = VOUT_ASPECT_FACTOR;
@@ -544,11 +546,15 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
 static picture_t *LoadImage( filter_t *p_filter, const char *psz_url )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
-
-    video_format_t fmt_in={0}, fmt_out={0};
-    picture_t *p_orig, *p_pic=NULL;
+    video_format_t fmt_in;
+    video_format_t fmt_out;
+    picture_t *p_orig;
+    picture_t *p_pic = NULL;
     image_handler_t *p_handler = image_HandlerCreate( p_filter );
 
+    memset( &fmt_in, 0, sizeof(video_format_t) );
+    memset( &fmt_out, 0, sizeof(video_format_t) );
+
     fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
     p_orig = image_ReadUrl( p_handler, psz_url, &fmt_in, &fmt_out );