]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/rss.c
Preliminary changes to fix postprocessing. Decoder quantizer settings can now be...
[vlc] / modules / video_filter / rss.c
index 768720422dc898f858ee3479f4402cbf2ecd1c5f..c0aeb36cbc4559c9716ef5e496f9446e3becebfa 100644 (file)
@@ -34,7 +34,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 
@@ -198,7 +198,7 @@ vlc_module_begin();
     add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, true );
     add_integer( CFG_PREFIX "y", 0, NULL, POSY_TEXT, POSY_LONGTEXT, true );
     add_integer( CFG_PREFIX "position", -1, NULL, POS_TEXT, POS_LONGTEXT, false );
-        change_integer_list( pi_pos_values, ppsz_pos_descriptions, 0 );
+        change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL );
 
     set_section( N_("Font"), NULL );
     /* 5 sets the default to top [1] left [4] */
@@ -206,7 +206,7 @@ vlc_module_begin();
         OPACITY_TEXT, OPACITY_LONGTEXT, false );
     add_integer( CFG_PREFIX "color", 0xFFFFFF, NULL, COLOR_TEXT, COLOR_LONGTEXT,
                   false );
-        change_integer_list( pi_color_values, ppsz_color_descriptions, 0 );
+        change_integer_list( pi_color_values, ppsz_color_descriptions, NULL );
     add_integer( CFG_PREFIX "size", -1, NULL, SIZE_TEXT, SIZE_LONGTEXT, false );
 
     set_section( N_("Misc"), NULL );
@@ -217,7 +217,7 @@ vlc_module_begin();
     add_integer( CFG_PREFIX "ttl", 1800, NULL, TTL_TEXT, TTL_LONGTEXT, false );
     add_bool( CFG_PREFIX "images", 1, NULL, IMAGE_TEXT, IMAGE_LONGTEXT, false );
     add_integer( CFG_PREFIX "title", default_title, NULL, TITLE_TEXT, TITLE_LONGTEXT, false );
-        change_integer_list( pi_title_modes, ppsz_title_modes, 0 );
+        change_integer_list( pi_title_modes, ppsz_title_modes, NULL );
 
     set_description( N_("RSS and Atom feed display") );
     add_shortcut( "rss" );
@@ -241,10 +241,7 @@ static int CreateFilter( vlc_object_t *p_this )
     /* Allocate structure */
     p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     vlc_mutex_init( &p_sys->lock );
     vlc_mutex_lock( &p_sys->lock );
@@ -267,9 +264,9 @@ static int CreateFilter( vlc_object_t *p_this )
     p_sys->psz_marquee = (char *)malloc( p_sys->i_length + 1 );
     if( p_sys->psz_marquee == NULL )
     {
-        msg_Err( p_filter, "out of memory" );
         vlc_mutex_unlock( &p_sys->lock );
         vlc_mutex_destroy( &p_sys->lock );
+        free( p_sys->psz_urls );
         free( p_sys );
         return VLC_ENOMEM;
     }
@@ -278,10 +275,10 @@ static int CreateFilter( vlc_object_t *p_this )
     p_sys->p_style = malloc( sizeof( text_style_t ));
     if( p_sys->p_style == NULL )
     {
-        msg_Err( p_filter, "out of memory" );
         free( p_sys->psz_marquee );
         vlc_mutex_unlock( &p_sys->lock );
         vlc_mutex_destroy( &p_sys->lock );
+        free( p_sys->psz_urls );
         free( p_sys );
         return VLC_ENOMEM;
     }
@@ -296,7 +293,7 @@ static int CreateFilter( vlc_object_t *p_this )
 
     if( p_sys->b_images == true && p_sys->p_style->i_font_size == -1 )
     {
-        msg_Warn( p_filter, "rrs-size wasn't specified. Feed images will thus be displayed without being resized" );
+        msg_Warn( p_filter, "rss-size wasn't specified. Feed images will thus be displayed without being resized" );
     }
 
     if( FetchRSS( p_filter ) )
@@ -306,6 +303,7 @@ static int CreateFilter( vlc_object_t *p_this )
         free( p_sys->psz_marquee );
         vlc_mutex_unlock( &p_sys->lock );
         vlc_mutex_destroy( &p_sys->lock );
+        free( p_sys->psz_urls );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -317,6 +315,7 @@ static int CreateFilter( vlc_object_t *p_this )
         free( p_sys->psz_marquee );
         vlc_mutex_unlock( &p_sys->lock );
         vlc_mutex_destroy( &p_sys->lock );
+        free( p_sys->psz_urls );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -329,6 +328,7 @@ static int CreateFilter( vlc_object_t *p_this )
             FreeRSS( p_filter );
             vlc_mutex_unlock( &p_sys->lock );
             vlc_mutex_destroy( &p_sys->lock );
+            free( p_sys->psz_urls );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -434,7 +434,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         }
     }
 
-    p_spu = p_filter->pf_sub_buffer_new( p_filter );
+    p_spu = filter_NewSubpicture( p_filter );
     if( !p_spu )
     {
         vlc_mutex_unlock( &p_sys->lock );
@@ -613,7 +613,7 @@ static picture_t *LoadImage( filter_t *p_filter, const char *psz_url )
         fmt_out.i_height = p_sys->p_style->i_font_size;
 
         p_pic = image_Convert( p_handler, p_orig, &fmt_in, &fmt_out );
-        p_orig->pf_release( p_orig );
+        picture_Release( p_orig );
         if( !p_pic )
         {
             msg_Warn( p_filter, "Error while converting %s", psz_url );
@@ -744,7 +744,6 @@ static int FetchRSS( filter_t *p_filter)
 
                 case XML_READER_STARTELEM:
                     free( psz_eltname );
-                    psz_eltname = NULL;
                     psz_eltname = xml_ReaderName( p_xml_reader );
                     if( !psz_eltname )
                     {
@@ -779,10 +778,20 @@ static int FetchRSS( filter_t *p_filter)
                             char *psz_value = xml_ReaderValue( p_xml_reader );
                             if( !strcmp( psz_name, "rel" ) )
                             {
+                                if( psz_rel )
+                                {
+                                    msg_Dbg( p_filter, "\"rel\" attribute of link atom duplicated (last value: %s)", psz_value );
+                                    free( psz_rel );
+                                }
                                 psz_rel = psz_value;
                             }
                             else if( !strcmp( psz_name, "href" ) )
                             {
+                                if( psz_href )
+                                {
+                                    msg_Dbg( p_filter, "\"href\" attribute of link atom duplicated (last value: %s)", psz_href );
+                                    free( psz_href );
+                                }
                                 psz_href = psz_value;
                             }
                             else
@@ -981,7 +990,7 @@ static void FreeRSS( filter_t *p_filter)
         free( p_feed->psz_description );
         free( p_feed->psz_image );
         if( p_feed->p_pic != NULL )
-            p_feed->p_pic->pf_release( p_feed->p_pic );
+            picture_Release( p_feed->p_pic );
     }
     free( p_sys->p_feeds );
     p_sys->i_feeds = 0;