From 14639c9f421ca49aa7a383d88e5d04d4e3b6ffa1 Mon Sep 17 00:00:00 2001 From: atmos4 Date: Tue, 26 Mar 2002 05:25:15 +0000 Subject: 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 --- cfg-common.h | 4 ++-- libmpdemux/mf.c | 29 +++++++++++++++++++++++++++-- libmpdemux/mf.h | 4 ++-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/cfg-common.h b/cfg-common.h index 0043940725..7174a457b4 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -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} }; diff --git a/libmpdemux/mf.c b/libmpdemux/mf.c index 0d2d0d8744..6ba383779d 100644 --- a/libmpdemux/mf.c +++ b/libmpdemux/mf.c @@ -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,'%' ) ) { diff --git a/libmpdemux/mf.h b/libmpdemux/mf.h index 69f3400766..6ebb3c0a5e 100644 --- a/libmpdemux/mf.h +++ b/libmpdemux/mf.h @@ -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 \ No newline at end of file +#endif -- cgit v1.2.3