mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
type autodetection (from filemask/filelist extension)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9149 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4b0d46d3a4
commit
3277c61b77
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user