comparison libmpdemux/mf.c @ 5352:cf2882606e72

Fileslist support for mf demuxer, delemited by ',' and change mf fps to float.
author atmos4
date Tue, 26 Mar 2002 05:25:15 +0000
parents be1562b2c2d0
children 86a202c1c229
comparison
equal deleted inserted replaced
5351:eea0213d64c8 5352:cf2882606e72
19 #include "mf.h" 19 #include "mf.h"
20 20
21 int mf_support = 0; 21 int mf_support = 0;
22 int mf_w = 352; 22 int mf_w = 352;
23 int mf_h = 288; 23 int mf_h = 288;
24 int mf_fps = 25; 24 float mf_fps = 25.0;
25 char * mf_type = "jpg"; 25 char * mf_type = "jpg";
26 26
27 int stream_open_mf(char * filename,stream_t * stream) 27 int stream_open_mf(char * filename,stream_t * stream)
28 { 28 {
29 glob_t gg; 29 glob_t gg;
32 char * fname; 32 char * fname;
33 mf_t * mf; 33 mf_t * mf;
34 int error_count = 0; 34 int error_count = 0;
35 int count = 0; 35 int count = 0;
36 36
37 mf=calloc( 1,sizeof( mf_t ) );
38
39 if( strchr( filename,',') )
40 {
41 fname=malloc( 255 );
42 mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] filelist: %s\n",filename );
43
44 while ( ( fname=strsep( &filename,"," ) ) )
45 {
46 if ( stat( fname,&fs ) )
47 {
48 mp_msg( MSGT_STREAM,MSGL_V,"[mf] file not found: '%s'\n",fname );
49 }
50 else
51 {
52 mf->names=realloc( mf->names,( mf->nr_of_files + 1 ) * sizeof( char* ) );
53 mf->names[mf->nr_of_files]=strdup( fname );
54 // mp_msg( MSGT_STREAM,MSGL_V,"[mf] added file %d.: %s\n",mf->nr_of_files,mf->names[mf->nr_of_files] );
55 mf->nr_of_files++;
56 }
57 }
58 goto exit_mf;
59 }
60
37 fname=malloc( strlen( filename ) + 32 ); 61 fname=malloc( strlen( filename ) + 32 );
38 mf=calloc( 1,sizeof( mf_t ) ); 62
63 mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] number of files: %d\n",mf->nr_of_files );
39 64
40 if ( !strchr( filename,'%' ) ) 65 if ( !strchr( filename,'%' ) )
41 { 66 {
42 strcpy( fname,filename ); 67 strcpy( fname,filename );
43 if ( !strchr( filename,'*' ) ) strcat( fname,"*" ); 68 if ( !strchr( filename,'*' ) ) strcat( fname,"*" );