X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Frss.c;h=a9ff0c2126879678a8e3ccaa1be977beda758760;hb=9d016759c25f227281fb0af9a4ea82bf38328b6d;hp=b9a080b7af8acb30e7f5b6f19c65cf34e9ca0cc6;hpb=15643af12d9eb61eff8a8e89d8170f3d2b73d7e1;p=vlc diff --git a/modules/video_filter/rss.c b/modules/video_filter/rss.c index b9a080b7af..a9ff0c2126 100644 --- a/modules/video_filter/rss.c +++ b/modules/video_filter/rss.c @@ -35,14 +35,11 @@ # include "config.h" #endif -#include - #include #include #include #include -#include #include #include @@ -50,8 +47,6 @@ #include -#include - #include /***************************************************************************** @@ -171,6 +166,8 @@ struct filter_sys_t #define TITLE_TEXT N_("Title display mode") #define TITLE_LONGTEXT N_("Title display mode. Default is 0 (hidden) if the feed has an image and feed images are enabled, 1 otherwise.") +#define RSS_HELP N_("Display a RSS or ATOM Feed on your video") + static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; static const char *const ppsz_pos_descriptions[] = { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), @@ -193,7 +190,8 @@ static const char *const ppsz_title_modes[] = *****************************************************************************/ vlc_module_begin () set_capability( "sub filter", 1 ) - set_shortname( "RSS / Atom" ) + set_shortname( N_("RSS / Atom") ) + set_help(RSS_HELP) set_callbacks( CreateFilter, DestroyFilter ) set_category( CAT_VIDEO ) set_subcategory( SUBCAT_VIDEO_SUBPIC ) @@ -225,8 +223,7 @@ vlc_module_begin () change_integer_list( pi_title_modes, ppsz_title_modes, NULL ) set_description( N_("RSS and Atom feed display") ) - add_shortcut( "rss" ) - add_shortcut( "atom" ) + add_shortcut( "rss", "atom" ) vlc_module_end () static const char *const ppsz_filter_options[] = { @@ -485,7 +482,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) /* where to locate the string: */ if( p_sys->i_pos < 0 ) { /* set to an absolute xy */ - p_spu->p_region->i_align = OSD_ALIGN_LEFT | OSD_ALIGN_TOP; + p_spu->p_region->i_align = SUBPICTURE_ALIGN_LEFT | SUBPICTURE_ALIGN_TOP; p_spu->b_absolute = true; } else @@ -493,6 +490,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) p_spu->p_region->i_align = p_sys->i_pos; p_spu->b_absolute = false; } + p_spu->p_region->i_x = p_sys->i_xoff; + p_spu->p_region->i_y = p_sys->i_yoff; p_spu->p_region->p_style = text_style_Duplicate( p_sys->p_style ); @@ -505,7 +504,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) memset( &fmt_out, 0, sizeof(video_format_t) ); fmt_out.i_chroma = VLC_CODEC_YUVA; - fmt_out.i_aspect = VOUT_ASPECT_FACTOR; fmt_out.i_sar_num = fmt_out.i_sar_den = 1; fmt_out.i_width = fmt_out.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch; @@ -519,15 +517,15 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) } else { - p_region->i_x = p_sys->i_xoff; - p_region->i_y = p_sys->i_yoff; + p_region->i_x = p_spu->p_region->i_x; + p_region->i_y = p_spu->p_region->i_y; /* FIXME the copy is probably not needed anymore */ picture_Copy( p_region->p_picture, p_pic ); p_spu->p_region->p_next = p_region; - } - /* Offset text to display right next to the image */ - p_spu->p_region->i_x = p_pic->p[Y_PLANE].i_visible_pitch; + /* Offset text to display right next to the image */ + p_spu->p_region->i_x += fmt_out.i_visible_width; + } } vlc_mutex_unlock( &p_sys->lock ); @@ -710,9 +708,8 @@ static bool ParseFeed( filter_t *p_filter, xml_reader_t *p_xml_reader, { b_is_item = true; p_feed->i_items++; - p_feed->p_items = realloc_or_free( p_feed->p_items, + p_feed->p_items = xrealloc( p_feed->p_items, p_feed->i_items * sizeof( rss_item_t ) ); - assert( p_feed->p_items ); p_feed->p_items[p_feed->i_items-1].psz_title = NULL; p_feed->p_items[p_feed->i_items-1].psz_description = NULL; p_feed->p_items[p_feed->i_items-1].psz_link = NULL; @@ -970,7 +967,7 @@ static rss_feed_t* FetchRSS( filter_t *p_filter ) } msg_Dbg( p_filter, "done with %s RSS/Atom feed", p_feed->psz_url ); - xml_ReaderDelete( p_xml, p_xml_reader ); + xml_ReaderDelete( p_xml_reader ); stream_Delete( p_stream ); } @@ -980,7 +977,7 @@ static rss_feed_t* FetchRSS( filter_t *p_filter ) error: FreeRSS( p_feeds, i_feed + 1 ); if( p_xml_reader ) - xml_ReaderDelete( p_xml, p_xml_reader ); + xml_ReaderDelete( p_xml_reader ); if( p_stream ) stream_Delete( p_stream ); if( p_xml )