From: Gildas Bazin Date: Fri, 23 Apr 2004 12:46:34 +0000 (+0000) Subject: * src/input/control.c, include/ninput.h: Added INPUT_GET_INFO. X-Git-Tag: 0.7.2~304 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1e9ecb9029e00ada8ceced3d60c54570bd7c1a84;p=vlc * src/input/control.c, include/ninput.h: Added INPUT_GET_INFO. * include/vlc_meta.h: vlc_meta_GetValue(). * modules/demux/m3u.c: increased MAX_LINE to 8192. * modules/video_output/directx/events.c: portability fix. --- diff --git a/include/ninput.h b/include/ninput.h index d64fb730ac..1f31b0e516 100644 --- a/include/ninput.h +++ b/include/ninput.h @@ -389,6 +389,7 @@ enum input_query_e INPUT_ADD_OPTION, /* arg1= char * arg2= char * res=can fail */ INPUT_ADD_INFO, /* arg1= char * arg2= char * arg3=... res=can fail */ + INPUT_GET_INFO, /* arg1= char * arg2= char * arg3= char ** res=can fail*/ INPUT_SET_NAME, /* arg1= char * res=can fail */ diff --git a/include/vlc_meta.h b/include/vlc_meta.h index f21402c037..a16167222e 100644 --- a/include/vlc_meta.h +++ b/include/vlc_meta.h @@ -132,4 +132,20 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src ) } } +static inline char *vlc_meta_GetValue( vlc_meta_t *m, char *name ) +{ + int i; + + for( i = 0; i < m->i_meta; i++ ) + { + if( !strcmp( m->name[i], name ) ) + { + char *value = NULL; + if( m->value[i] ) value = strdup( m->value[i] ); + return value; + } + } + return NULL; +} + #endif diff --git a/modules/demux/m3u.c b/modules/demux/m3u.c index ec845d2e7e..7aad3ab3a4 100644 --- a/modules/demux/m3u.c +++ b/modules/demux/m3u.c @@ -35,7 +35,7 @@ /***************************************************************************** * Constants and structures *****************************************************************************/ -#define MAX_LINE 1024 +#define MAX_LINE 8192 #define TYPE_UNKNOWN 0 #define TYPE_M3U 1 diff --git a/modules/video_output/directx/events.c b/modules/video_output/directx/events.c index d2f8c04bb0..19ea96376b 100644 --- a/modules/video_output/directx/events.c +++ b/modules/video_output/directx/events.c @@ -31,6 +31,10 @@ #include /* tolower() */ #include /* strerror() */ +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 +#endif + #include #include #include diff --git a/src/input/control.c b/src/input/control.c index e2b8039545..2926c77b3e 100644 --- a/src/input/control.c +++ b/src/input/control.c @@ -2,7 +2,7 @@ * control.c ***************************************************************************** * Copyright (C) 1999-2004 VideoLAN - * $Id: stream.c 7041 2004-03-11 16:48:27Z gbazin $ + * $Id$ * * Authors: Gildas Bazin * @@ -212,6 +212,46 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) } break; + case INPUT_GET_INFO: + { + char *psz_cat = (char *)va_arg( args, char * ); + char *psz_name = (char *)va_arg( args, char * ); + char **ppsz_value = (char **)va_arg( args, char ** ); + int i; + + i_ret = VLC_EGENERIC; + *ppsz_value = NULL; + + vlc_mutex_lock( &p_input->p_item->lock ); + for( i = 0; i < p_input->p_item->i_categories; i++ ) + { + if( !strcmp( p_input->p_item->pp_categories[i]->psz_name, + psz_cat ) ) + break; + } + + if( i != p_input->p_item->i_categories ) + { + info_category_t *p_cat; + p_cat = p_input->p_item->pp_categories[i]; + + for( i = 0; i < p_cat->i_infos; i++ ) + { + if( !strcmp( p_cat->pp_infos[i]->psz_name, psz_name ) ) + { + if( p_cat->pp_infos[i]->psz_value ) + { + *ppsz_value =strdup(p_cat->pp_infos[i]->psz_value); + i_ret = VLC_SUCCESS; + } + break; + } + } + } + vlc_mutex_unlock( &p_input->p_item->lock ); + } + break; + case INPUT_ADD_BOOKMARK: p_bkmk = (seekpoint_t *)va_arg( args, seekpoint_t * ); p_bkmk = vlc_seekpoint_Duplicate( p_bkmk );