[MPlayer-dev-eng] [PATCH] Allow mf:// to read indirect file list

devik devik at cdi.cz
Sat Jun 18 12:44:20 CEST 2005


Hello,

as in subj. The patch also deletes one line which
causes memory leak.

By the way, anyone know how to send an attachement
from mozilla while having it base64 encoded ?
It still tries to use plaintext :-(

Martin Devera
-------------- next part --------------
--- DOCS/xml/en/mencoder.xml.old	Sat Jun 18 12:12:14 2005
+++ DOCS/xml/en/mencoder.xml	Sat Jun 18 12:15:37 2005
@@ -267,6 +267,16 @@
 
 <informalexample>
 <para>
+Creating an MPEG-4 file from explicit list of JPEG files (list.txt in current directory 
+contains filenames one per line):
+<screen>
+mencoder mf://<replaceable>@list.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o <replaceable>output.avi</replaceable>
+</screen>
+</para>
+</informalexample>
+
+<informalexample>
+<para>
 Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current
 directory:
 <screen>
--- libmpdemux/mf.c.old	Sat Jun 18 10:42:07 2005
+++ libmpdemux/mf.c	Sat Jun 18 12:21:58 2005
@@ -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,"," ) ) )


More information about the MPlayer-dev-eng mailing list