CVS change done by Alban Bedel CVS Update of /cvsroot/mplayer/main/libmpdemux In directory mail:/var2/tmp/cvs-serv10672/libmpdemux Modified Files: mf.c Log Message: Add support to get the list of files from a file containing one filename per line. Patch from devik (devik .at. cdi .dot. cz). Index: mf.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/mf.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mf.c 18 Nov 2005 14:39:19 -0000 1.10 +++ mf.c 26 Nov 2005 17:10:17 -0000 1.11 @@ -40,9 +40,38 @@ mf=calloc( 1,sizeof( mf_t ) ); + if( filename[0] == '@' ) + { + FILE *lst_f=fopen(filename + 1,"r"); + if ( lst_f ) + { + fname=malloc( 255 ); + while ( fgets( fname,255,lst_f ) ) + { + /* remove spaces from end of fname */ + char *t=fname + strlen( fname ) - 1; + while ( t > fname && isspace( *t ) ) *(t--)=0; + 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 ); + mf->nr_of_files++; + } + } + fclose( lst_f ); + + mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] number of files: %d\n",mf->nr_of_files ); + goto exit_mf; + } + mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] %s is not indirect filelist\n",filename+1 ); + } + if( strchr( filename,',') ) { - fname=malloc( 255 ); mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] filelist: %s\n",filename ); while ( ( fname=strsep( &filename,"," ) ) )
Hi, On Sat, Nov 26, 2005 at 06:10:19PM +0100, Alban Bedel CVS wrote:
CVS change done by Alban Bedel CVS
Update of /cvsroot/mplayer/main/libmpdemux In directory mail:/var2/tmp/cvs-serv10672/libmpdemux
Modified Files: mf.c Log Message: Add support to get the list of files from a file containing one filename per line. Patch from devik (devik .at. cdi .dot. cz).
Sorry for speaking up again after it was commited, but I just don't have much time.
+ if( filename[0] == '@' )
Note that this means it is impossible to specify a filename starting with an @...
if( strchr( filename,',') ) { - fname=malloc( 255 ); mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] filelist: %s\n",filename );
while ( ( fname=strsep( &filename,"," ) ) )
This is an unrelated fix, please try to commit such things seperately. Greetings, Reimar Döffinger
Hey, On Sunday 27 November 2005 11:23, Reimar Döffinger wrote:
+ if( filename[0] == '@' )
Note that this means it is impossible to specify a filename starting with an @...
mplayer ./@stupid_file_name.avi Same as file names that start with - (which would otherwise be interpreted as command line options). Mosu -- If Darl McBride was in charge, he'd probably make marriage unconstitutional too, since clearly it de-emphasizes the commercial nature of normal human interaction, and probably is a major impediment to the commercial growth of prostitution. - Linus Torvalds
participants (3)
-
Moritz Bunkus -
Reimar Döffinger -
syncmail@mplayerhq.hu