exit() -> return NULL

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1632 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-08-22 19:40:46 +00:00
parent 19f5d65451
commit 6326452f41
7 changed files with 12 additions and 29 deletions

View File

@ -160,7 +160,7 @@ while(!stream_eof(demuxer->stream)){
if(streamh.type_size>1024 || streamh.stream_size>1024){
mp_msg(MSGT_HEADER,MSGL_FATAL,"FATAL: header size bigger than 1024 bytes!\n"
"Please contact mplayer authors, and upload/send this file.\n");
exit(1);
return 0;
}
// type-specific data:
stream_read(demuxer->stream,(char*) buffer,streamh.type_size);

View File

@ -150,7 +150,6 @@ switch(sh_video->codec->driver){
case VFM_VFW: {
if(!init_video_codec(sh_video,0)) {
// GUI_MSG( mplUnknowError )
// exit(1);
return 0;
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n");
@ -159,7 +158,6 @@ switch(sh_video->codec->driver){
case VFM_VFWEX: {
if(!init_video_codec(sh_video,1)) {
// GUI_MSG( mplUnknowError )
// exit(1);
return 0;
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32Ex video codec init OK!\n");
@ -170,7 +168,6 @@ switch(sh_video->codec->driver){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT directshow support!\n");
return 0;
// GUI_MSG( mplCompileWithoutDSSupport )
// exit(1);
#else
int bpp;
if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){
@ -188,7 +185,6 @@ switch(sh_video->codec->driver){
// usec_sleep( 10000 );
// }
// #endif
// exit(1);
}
switch(out_fmt){
@ -247,7 +243,7 @@ switch(sh_video->codec->driver){
case VFM_DIVX4: { // DivX4Linux
#ifndef NEW_DECORE
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT DivX4Linux (libdivxdecore.so) support!\n");
return 0; //exit(1);
return 0;
#else
mp_msg(MSGT_DECVIDEO,MSGL_V,"DivX4Linux video codec\n");
{ DEC_PARAM dec_param;
@ -282,7 +278,7 @@ switch(sh_video->codec->driver){
case VFM_FFMPEG: { // FFmpeg's libavcodec
#ifndef USE_LIBAVCODEC
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT libavcodec support!\n");
return 0; //exit(1);
return 0;
#else
mp_msg(MSGT_DECVIDEO,MSGL_V,"FFmpeg's libavcodec video codec\n");
avcodec_init();
@ -290,7 +286,7 @@ switch(sh_video->codec->driver){
lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_video->codec->dll);
if(!lavc_codec){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Can't find codec '%s' in libavcodec...\n",sh_video->codec->dll);
return 0; //exit(1);
return 0;
}
memset(&lavc_context, 0, sizeof(lavc_context));
// sh_video->disp_h/=2; // !!
@ -300,7 +296,7 @@ switch(sh_video->codec->driver){
/* open it */
if (avcodec_open(&lavc_context, lavc_codec) < 0) {
mp_msg(MSGT_DECVIDEO,MSGL_ERR, "could not open codec\n");
return 0; //exit(1);
return 0;
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: libavcodec init OK!\n");
@ -580,7 +576,6 @@ switch(d_video->demuxer->file_format){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPEG: FATAL: EOF while searching for sequence header\n");
return 0;
// GUI_MSG( mplMPEGErrorSeqHeaderSearch )
// exit(1);
}
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"OK!\n");
@ -592,20 +587,17 @@ switch(d_video->demuxer->file_format){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory\n");
return 0;
// GUI_MSG( mplErrorShMemAlloc )
// exit(0);
}
videobuf_len=0;
if(!read_video_packet(d_video)){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"FATAL: Cannot read sequence header!\n");
return 0;
// GUI_MSG( mplMPEGErrorCannotReadSeqHeader )
// exit(1);
}
if(header_process_sequence_header (picture, &videobuffer[4])) {
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"bad sequence header!\n");
return 0;
// GUI_MSG( mplMPEGErrorBadSeqHeader )
// exit(1);
}
if(sync_video_packet(d_video)==0x1B5){ // next packet is seq. ext.
// videobuf_len=0;
@ -614,13 +606,11 @@ switch(d_video->demuxer->file_format){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"FATAL: Cannot read sequence header extension!\n");
return 0;
// GUI_MSG( mplMPEGErrorCannotReadSeqHeaderExt )
// exit(1);
}
if(header_process_extension (picture, &videobuffer[pos+4])) {
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"bad sequence header extension!\n");
return 0;
// GUI_MSG( mplMPEGErrorBadSeqHeaderExt )
// exit(1);
}
}
// display info:
@ -629,7 +619,7 @@ switch(d_video->demuxer->file_format){
if(!sh_video->fps){
// if(!force_fps){
// fprintf(stderr,"FPS not specified (or invalid) in the header! Use the -fps option!\n");
// return 0; //exit(1);
// return 0;
// }
sh_video->frametime=0;
} else {

View File

@ -412,7 +412,6 @@ demuxer_t* demux_open_avi(demuxer_t* demuxer){
mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI_NI: missing video stream!? contact the author, it may be a bug :(\n");
return NULL;
// GUI_MSG( mplErrorAVINI )
// exit(1);
}
if(a_pos==-1){
mp_msg(MSGT_DEMUX,MSGL_INFO,"AVI_NI: No audio stream found -> nosound\n");
@ -439,7 +438,6 @@ demuxer_t* demux_open_avi(demuxer_t* demuxer){
mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI: missing video stream!? contact the author, it may be a bug :(\n");
return NULL;
// GUI_MSG( mplAVIErrorMissingVideoStream )
// exit(1);
}
sh_video=d_video->sh;sh_video->ds=d_video;
if(d_audio->id!=-2){

View File

@ -399,7 +399,6 @@ if(file_format==DEMUXER_TYPE_UNKNOWN){
mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_FormatNotRecognized);
return NULL;
// GUI_MSG( mplUnknowFileType )
// exit(1);
}
//====== File format recognized, set up these for compatibility: =========
d_audio=demuxer->audio;
@ -429,7 +428,6 @@ switch(file_format){
sh_video=NULL;
//printf("ASF: missing video stream!? contact the author, it may be a bug :(\n");
//GUI_MSG( mplASFErrorMissingVideoStream )
//exit(1);
} else {
sh_video=d_video->sh;sh_video->ds=d_video;
sh_video->fps=1000.0f; sh_video->frametime=0.001f; // 1ms

View File

@ -34,9 +34,6 @@ int init_acm_audio_codec(sh_audio_t *sh_audio){
sh_audio->srcstream=NULL;
// if(in_fmt->nSamplesPerSec==0){ printf("Bad WAVE header!\n");exit(1); }
// MSACM_RegisterAllDrivers();
sh_audio->o_wf.nChannels=in_fmt->nChannels;
sh_audio->o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
sh_audio->o_wf.nAvgBytesPerSec=2*sh_audio->o_wf.nSamplesPerSec*sh_audio->o_wf.nChannels;

View File

@ -474,7 +474,7 @@ network_streaming(void *arg) {
ret = select( streaming_ctrl->fd_net+1, &fd_net_in, NULL, NULL, NULL );
if( ret<0 ) {
perror("select");
exit(1);
return; //exit(1); // FIXME!
}
if( FD_ISSET( streaming_ctrl->fd_net, &fd_net_in ) ) {
ret = readFromServer( streaming_ctrl->fd_net, buffer, BUFFER_SIZE );

10
url.c
View File

@ -23,7 +23,7 @@ url_new(char* url) {
Curl = (URL_t*)malloc(sizeof(URL_t));
if( Curl==NULL ) {
printf("Memory allocation failed!\n");
exit(1);
return NULL;
}
// Initialisation of the URL container members
memset( Curl, 0, sizeof(URL_t) );
@ -32,7 +32,7 @@ url_new(char* url) {
Curl->url = (char*)malloc(strlen(url)+1);
if( Curl->url==NULL ) {
printf("Memory allocation failed!\n");
exit(1);
return NULL;
}
strcpy(Curl->url, url);
@ -71,7 +71,7 @@ url_new(char* url) {
Curl->hostname = (char*)malloc(pos2-pos1-3+1);
if( Curl->hostname==NULL ) {
printf("Memory allocation failed!\n");
exit(1);
return NULL;
}
strncpy(Curl->hostname, ptr1+3, pos2-pos1-3);
Curl->hostname[pos2-pos1-3] = '\0';
@ -86,7 +86,7 @@ url_new(char* url) {
Curl->file = (char*)malloc(strlen(ptr2)+1);
if( Curl->file==NULL ) {
printf("Memory allocation failed!\n");
exit(1);
return NULL;
}
strcpy(Curl->file, ptr2);
}
@ -96,7 +96,7 @@ url_new(char* url) {
Curl->file = (char*)malloc(2);
if( Curl->file==NULL ) {
printf("Memory allocation failed!\n");
exit(1);
return NULL;
}
strcpy(Curl->file, "/");
}