diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-28 22:00:57 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-28 22:00:57 +0000 |
commit | 3277c61b77ac26e9110e34bb5404a7a39c77fe16 (patch) | |
tree | b94d3221ef06ade90f351e6a82c9fa043479917c | |
parent | 4b0d46d3a49bfd3d009bc90fc1855c3031a56320 (diff) |
type autodetection (from filemask/filelist extension)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9149 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/demux_mf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libmpdemux/demux_mf.c b/libmpdemux/demux_mf.c index 61cad83388..159ec2a2f8 100644 --- a/libmpdemux/demux_mf.c +++ b/libmpdemux/demux_mf.c @@ -63,6 +63,17 @@ demuxer_t* demux_open_mf(demuxer_t* demuxer){ 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 @@ demuxer_t* demux_open_mf(demuxer_t* demuxer){ // 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 |