changeset 9148:946b14a9e743

type autodetection (from filemask/filelist extension)
author arpi
date Tue, 28 Jan 2003 22:00:57 +0000
parents 964117ca0528
children ca6dc931f6ea
files libmpdemux/demux_mf.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mf.c	Tue Jan 28 19:15:00 2003 +0000
+++ b/libmpdemux/demux_mf.c	Tue Jan 28 22:00:57 2003 +0000
@@ -63,6 +63,17 @@
   mf_t         *mf = NULL;
   
   if(!demuxer->stream->url) return NULL;
+
+  if(!mf_type){
+    char* p=strrchr(demuxer->stream->url,'.');
+    if(!p){
+      mp_msg(MSGT_DEMUX, MSGL_INFO, "[demux_mf] file type was not set! (try -mf type=xxx)\n" );
+      free( mf ); return NULL;
+    }
+    mf_type=strdup(p+1);
+    mp_msg(MSGT_DEMUX, MSGL_INFO, "[demux_mf] file type was not set! trying 'type=%s'...\n", mf_type);
+  }
+
   mf=open_mf(demuxer->stream->url);
   if(!mf) return NULL;
   mf->curr_frame=0;
@@ -80,7 +91,7 @@
   // parent video demuxer stream (this is getting wacky), or else
   // video_read_properties() will choke
   sh_video->ds = demuxer->video;
-
+  
   if ( !strcasecmp( mf_type,"jpg" ) || 
         !(strcasecmp(mf_type, "jpeg"))) sh_video->format = mmioFOURCC('I', 'J', 'P', 'G');
   else