Fileslist support for mf demuxer, delemited by ',' and change mf fps to float.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5353 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
atmos4 2002-03-26 05:25:15 +00:00
parent 3f5ad4c82b
commit 14639c9f42
3 changed files with 31 additions and 6 deletions

View File

@ -159,14 +159,14 @@ struct config vivoopts_conf[]={
extern int mf_support;
extern int mf_w;
extern int mf_h;
extern int mf_fps;
extern float mf_fps;
extern char * mf_type;
struct config mfopts_conf[]={
{"on", &mf_support, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL},
{"h", &mf_h, CONF_TYPE_INT, 0, 0, 0, NULL},
{"fps", &mf_fps, CONF_TYPE_INT, 0, 0, 0, NULL},
{"fps", &mf_fps, CONF_TYPE_FLOAT, 0, 0, 0, NULL},
{"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
};

View File

@ -21,7 +21,7 @@
int mf_support = 0;
int mf_w = 352;
int mf_h = 288;
int mf_fps = 25;
float mf_fps = 25.0;
char * mf_type = "jpg";
int stream_open_mf(char * filename,stream_t * stream)
@ -34,8 +34,33 @@ int stream_open_mf(char * filename,stream_t * stream)
int error_count = 0;
int count = 0;
fname=malloc( strlen( filename ) + 32 );
mf=calloc( 1,sizeof( mf_t ) );
if( strchr( filename,',') )
{
fname=malloc( 255 );
mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] filelist: %s\n",filename );
while ( ( fname=strsep( &filename,"," ) ) )
{
if ( stat( fname,&fs ) )
{
mp_msg( MSGT_STREAM,MSGL_V,"[mf] file not found: '%s'\n",fname );
}
else
{
mf->names=realloc( mf->names,( mf->nr_of_files + 1 ) * sizeof( char* ) );
mf->names[mf->nr_of_files]=strdup( fname );
// mp_msg( MSGT_STREAM,MSGL_V,"[mf] added file %d.: %s\n",mf->nr_of_files,mf->names[mf->nr_of_files] );
mf->nr_of_files++;
}
}
goto exit_mf;
}
fname=malloc( strlen( filename ) + 32 );
mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] number of files: %d\n",mf->nr_of_files );
if ( !strchr( filename,'%' ) )
{

View File

@ -5,7 +5,7 @@
extern int mf_support;
extern int mf_w;
extern int mf_h;
extern int mf_fps;
extern float mf_fps;
extern char * mf_type;
typedef struct
@ -14,4 +14,4 @@ typedef struct
char ** names;
} mf_t;
#endif
#endif