Commit 1e9ecb90 authored by Gildas Bazin's avatar Gildas Bazin

* 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.
parent c55e169d
......@@ -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 */
......
......@@ -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
......@@ -35,7 +35,7 @@
/*****************************************************************************
* Constants and structures
*****************************************************************************/
#define MAX_LINE 1024
#define MAX_LINE 8192
#define TYPE_UNKNOWN 0
#define TYPE_M3U 1
......
......@@ -31,6 +31,10 @@
#include <ctype.h> /* tolower() */
#include <string.h> /* strerror() */
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0400
#endif
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/input.h>
......
......@@ -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 <gbazin@videolan.org>
*
......@@ -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 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment