1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00

A whole bunch of free_demuxer in demux_open

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4661 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2002-02-11 12:11:48 +00:00
parent 2c0c39aa69
commit c1bbc6326d

View File

@ -440,7 +440,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_AVI){
if(id==formtypeAVI){ if(id==formtypeAVI){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAVIfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedAVIfile);
file_format=DEMUXER_TYPE_AVI; file_format=DEMUXER_TYPE_AVI;
} } else
free_demuxer(demuxer);
} }
} }
} }
@ -450,7 +451,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_Y4M){
if(y4m_check_file(demuxer)){ if(y4m_check_file(demuxer)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected YUV4MPEG2 file format!\n"); mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected YUV4MPEG2 file format!\n");
file_format=DEMUXER_TYPE_Y4M; file_format=DEMUXER_TYPE_Y4M;
} } else
free_demuxer(demuxer);
} }
//=============== Try to open as ASF file: ================= //=============== Try to open as ASF file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){
@ -458,7 +460,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ASF){
if(asf_check_header(demuxer)){ if(asf_check_header(demuxer)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedASFfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedASFfile);
file_format=DEMUXER_TYPE_ASF; file_format=DEMUXER_TYPE_ASF;
} } else
free_demuxer(demuxer);
} }
//=============== Try to open as NUV file: ================= //=============== Try to open as NUV file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_NUV){ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_NUV){
@ -466,7 +469,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_NUV){
if(nuv_check_file(demuxer)){ if(nuv_check_file(demuxer)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected NuppelVideo file format!\n"); mp_msg(MSGT_DEMUXER,MSGL_INFO,"Detected NuppelVideo file format!\n");
file_format=DEMUXER_TYPE_NUV; file_format=DEMUXER_TYPE_NUV;
} } else
free_demuxer(demuxer);
} }
//=============== Try to open as MOV file: ================= //=============== Try to open as MOV file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MOV){ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MOV){
@ -474,7 +478,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MOV){
if(mov_check_file(demuxer)){ if(mov_check_file(demuxer)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedQTMOVfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedQTMOVfile);
file_format=DEMUXER_TYPE_MOV; file_format=DEMUXER_TYPE_MOV;
} } else
free_demuxer(demuxer);
} }
//=============== Try to open as VIVO file: ================= //=============== Try to open as VIVO file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_VIVO){ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_VIVO){
@ -490,7 +495,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_REAL){
if(real_check_file(demuxer)){ if(real_check_file(demuxer)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedREALfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedREALfile);
file_format=DEMUXER_TYPE_REAL; file_format=DEMUXER_TYPE_REAL;
} } else
free_demuxer(demuxer);
} }
//=============== Try to open as FLI file: ================= //=============== Try to open as FLI file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FLI){ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FLI){
@ -503,7 +509,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FLI){
if((id==0xAF11) || (id==0xAF12)){ if((id==0xAF11) || (id==0xAF12)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFLIfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFLIfile);
file_format=DEMUXER_TYPE_FLI; file_format=DEMUXER_TYPE_FLI;
} } else
free_demuxer(demuxer);
} }
} }
//=============== Try to open as FILM file: ================= //=============== Try to open as FILM file: =================
@ -515,7 +522,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_FILM){
if(signature==mmioFOURCC('F', 'I', 'L', 'M')){ if(signature==mmioFOURCC('F', 'I', 'L', 'M')){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFILMfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedFILMfile);
file_format=DEMUXER_TYPE_FILM; file_format=DEMUXER_TYPE_FILM;
} } else
free_demuxer(demuxer);
} }
} }
//=============== Try to open as RoQ file: ================= //=============== Try to open as RoQ file: =================
@ -524,7 +532,8 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_ROQ){
if(roq_check_file(demuxer)){ if(roq_check_file(demuxer)){
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedROQfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedROQfile);
file_format=DEMUXER_TYPE_ROQ; file_format=DEMUXER_TYPE_ROQ;
} } else
free_demuxer(demuxer);
} }
//=============== Try to open as MPEG-PS file: ================= //=============== Try to open as MPEG-PS file: =================
if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){
@ -571,6 +580,7 @@ if(file_format==DEMUXER_TYPE_UNKNOWN || file_format==DEMUXER_TYPE_MPEG_PS){
mp_msg(MSGT_DEMUXER,MSGL_ERR,"MPEG: " MSGTR_MissingVideoStreamBug); mp_msg(MSGT_DEMUXER,MSGL_ERR,"MPEG: " MSGTR_MissingVideoStreamBug);
else else
mp_msg(MSGT_DEMUXER,MSGL_V,"Not MPEG System Stream format... (maybe Transport Stream?)\n"); mp_msg(MSGT_DEMUXER,MSGL_V,"Not MPEG System Stream format... (maybe Transport Stream?)\n");
free_demuxer(demuxer);
} }
} }
break; break;
@ -582,6 +592,7 @@ if(file_format==DEMUXER_TYPE_MPEG_ES){ // little hack, see above!
if(!ds_fill_buffer(demuxer->video)){ if(!ds_fill_buffer(demuxer->video)){
mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_InvalidMPEGES); mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_InvalidMPEGES);
file_format=DEMUXER_TYPE_UNKNOWN; file_format=DEMUXER_TYPE_UNKNOWN;
free_demuxer(demuxer);
} else { } else {
mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile); mp_msg(MSGT_DEMUXER,MSGL_INFO,MSGTR_DetectedMPEGESfile);
} }