changeset 5933:14b46420840b

printf to mp_msg
author albeu
date Thu, 02 May 2002 10:40:35 +0000
parents 1ebeebca86f3
children 42127864a2b3
files libmpcodecs/dec_audio.c libmpdemux/aviheader.c libmpdemux/url.c
diffstat 3 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/dec_audio.c	Thu May 02 10:32:55 2002 +0000
+++ b/libmpcodecs/dec_audio.c	Thu May 02 10:40:35 2002 +0000
@@ -39,7 +39,7 @@
       return 0; // no such driver
   }
   
-  printf("Selecting Audio Decoder: [%s] %s\n",mpadec->info->short_name,mpadec->info->name);
+  mp_msg(MSGT_DECAUDIO,MSGL_INFO,"Selecting Audio Decoder: [%s] %s\n",mpadec->info->short_name,mpadec->info->name);
 
   // reset in/out buffer size/pointer:
   sh_audio->a_buffer_size=0;
@@ -64,7 +64,7 @@
   
   if(!mpadec->preinit(sh_audio))
   {
-      printf("ADecoder preinit failed :(\n");
+      mp_msg(MSGT_DECAUDIO,MSGL_ERR,"ADecoder preinit failed :(\n");
       return 0;
   }
 
--- a/libmpdemux/aviheader.c	Thu May 02 10:32:55 2002 +0000
+++ b/libmpdemux/aviheader.c	Thu May 02 10:40:35 2002 +0000
@@ -50,7 +50,7 @@
     id=stream_read_dword_le(demuxer->stream);        // list type
     mp_msg(MSGT_HEADER,MSGL_DBG2,"LIST %.4s  len=%d\n",(char *) &id,len);
     list_end=stream_tell(demuxer->stream)+((len+1)&(~1));
-    printf("list_end=0x%X\n",(int)list_end);
+    mp_msg(MSGT_HEADER,MSGL_V,"list_end=0x%X\n",(int)list_end);
     if(id==listtypeAVIMOVIE){
       // found MOVI header
       if(!demuxer->movi_start) demuxer->movi_start=stream_tell(demuxer->stream);
@@ -247,7 +247,7 @@
     }
   }
   if(hdr){
-    printf("hdr=%s  size=%d\n",hdr,size2);
+    mp_msg(MSGT_HEADER,MSGL_V,"hdr=%s  size=%d\n",hdr,size2);
     if(size2==3)
       chunksize=1; // empty
     else {
--- a/libmpdemux/url.c	Thu May 02 10:32:55 2002 +0000
+++ b/libmpdemux/url.c	Thu May 02 10:40:35 2002 +0000
@@ -12,6 +12,7 @@
 #include <stdio.h>
 
 #include "url.h"
+#include "mp_msg.h"
 
 URL_t*
 url_new(char* url) {
@@ -24,7 +25,7 @@
 	// Create the URL container
 	Curl = (URL_t*)malloc(sizeof(URL_t));
 	if( Curl==NULL ) {
-		printf("Memory allocation failed!\n");
+		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
 		return NULL;
 	}
 	// Initialisation of the URL container members
@@ -33,14 +34,14 @@
 	// Copy the url in the URL container
 	Curl->url = strdup(url);
 	if( Curl->url==NULL ) {
-		printf("Memory allocation failed!\n");
+		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
 		return NULL;
 	}
 
 	// extract the protocol
 	ptr1 = strstr(url, "://");
 	if( ptr1==NULL ) {
-		printf("Not an URL!\n");
+		mp_msg(MSGT_NETWORK,MSGL_V,"Not an URL!\n");
 		return NULL;
 	}
 	pos1 = ptr1-url;
@@ -74,7 +75,7 @@
 	// copy the hostname in the URL container
 	Curl->hostname = (char*)malloc(pos2-pos1-3+1);
 	if( Curl->hostname==NULL ) {
-		printf("Memory allocation failed!\n");
+		mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
 		return NULL;
 	}
 	strncpy(Curl->hostname, ptr1+3, pos2-pos1-3);
@@ -89,7 +90,7 @@
 			// copy the path/filename in the URL container
 			Curl->file = strdup(ptr2);
 			if( Curl->file==NULL ) {
-				printf("Memory allocation failed!\n");
+				mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
 				return NULL;
 			}
 		}
@@ -98,7 +99,7 @@
 	if( Curl->file==NULL ) {
 		Curl->file = (char*)malloc(2);
 		if( Curl->file==NULL ) {
-			printf("Memory allocation failed!\n");
+			mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
 			return NULL;
 		}
 		strcpy(Curl->file, "/");