diff decoders/mpglib/common.c @ 273:e1429f96aded

Replaced exit() calls with proper error reporting.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 10 Mar 2002 19:04:46 +0000
parents 9b6e82f7c853
children 9e7f9e09ea0e
line wrap: on
line diff
--- a/decoders/mpglib/common.c	Sun Mar 10 19:03:56 2002 +0000
+++ b/decoders/mpglib/common.c	Sun Mar 10 19:04:46 2002 +0000
@@ -6,6 +6,11 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#include "SDL_sound.h"
+
+#define __SDL_SOUND_INTERNAL__
+#include "SDL_sound_internal.h"
+
 #include "mpg123_sdlsound.h"
 
 struct parameter param = { 1 , 1 , 0 , 0 };
@@ -65,8 +70,8 @@
     
     fr->lay = 4-((newhead>>17)&3);
     if( ((newhead>>10)&0x3) == 0x3) {
-      fprintf(stderr,"Stream error\n");
-      exit(1);
+      Sound_SetError("MPGLIB: Corrupted header");
+      return 0;
     }
     if(fr->mpeg25) {
       fr->sampling_frequency = 6 + ((newhead>>10)&0x3);