changeset 18176:f72bc5754209

Part3 of Otvos Attila's oattila AT chello-hu mp_msg changes, with lots of modifications as usual
author reynaldo
date Sat, 22 Apr 2006 05:12:10 +0000
parents 01ca8a5fb8a6
children 01695abe8666
files help/help_mp-en.h libmpdemux/cache2.c libmpdemux/cddb.c libmpdemux/demux_audio.c libmpdemux/demux_demuxers.c libmpdemux/demux_film.c libmpdemux/demux_mov.c libmpdemux/demux_nuv.c libmpdemux/demux_real.c libmpdemux/demux_xmms.c libmpdemux/stream.c libmpdemux/tvi_v4l2.c
diffstat 12 files changed, 40 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Fri Apr 21 18:46:17 2006 +0000
+++ b/help/help_mp-en.h	Sat Apr 22 05:12:10 2006 +0000
@@ -1434,6 +1434,23 @@
 #define MSGTR_MPDEMUX_NW_ErrServerReturned "Server return %d: %s\n"
 #define MSGTR_MPDEMUX_NW_CacheSizeSetTo "Cache size set to %d KBytes\n"
 
+// demux_audio.c
+
+#define MSGTR_MPDEMUX_AUDIO_UnknownFormat "Audio demuxer: unknown format %d.\n"
+
+// demux_demuxers.c
+
+#define MSGTR_MPDEMUX_DEMUXERS_FillBufferError "fill_buffer error: bad demuxer: not vd, ad or sd.\n"
+
+// demux_nuv.c
+
+#define MSGTR_MPDEMUX_NUV_NoVideoBlocksInFile "No video blocks in file.\n"
+
+// demux_xmms.c
+
+#define MSGTR_MPDEMUX_XMMS_FoundPlugin "Found plugin: %s (%s).\n"
+#define MSGTR_MPDEMUX_XMMS_ClosingPlugin "Closing plugin: %s.\n"
+
 // ========================== LIBMPMENU ===================================
 
 // libmenu/menu.c
--- a/libmpdemux/cache2.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/cache2.c	Sat Apr 22 05:12:10 2006 +0000
@@ -64,8 +64,8 @@
 
 void cache_stats(cache_vars_t* s){
   int newb=s->max_filepos-s->read_filepos; // new bytes in the buffer
-  printf("0x%06X  [0x%06X]  0x%06X   ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos);
-  printf("%3d %%  (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size);
+  mp_msg(MSGT_CACHE,MSGL_INFO,"0x%06X  [0x%06X]  0x%06X   ",(int)s->min_filepos,(int)s->read_filepos,(int)s->max_filepos);
+  mp_msg(MSGT_CACHE,MSGL_INFO,"%3d %%  (%3d%%)\n",100*newb/s->buffer_size,100*min_fill/s->buffer_size);
 }
 
 int cache_read(cache_vars_t* s,unsigned char* buf,int size){
--- a/libmpdemux/cddb.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/cddb.c	Sat Apr 22 05:12:10 2006 +0000
@@ -282,7 +282,7 @@
 	if( reply_parser==NULL || command==NULL || cddb_data==NULL ) return -1;
 	
 	sprintf( request, "http://%s/~cddb/cddb.cgi?cmd=%s%s&proto=%d", cddb_data->freedb_server, command, cddb_data->cddb_hello, cddb_data->freedb_proto_level );
-	printf("Request[%s]\n", request );
+	mp_msg(MSGT_OPEN, MSGL_INFO,"Request[%s]\n", request );
 
 	url = url_new(request);
 	if( url==NULL ) {
@@ -303,7 +303,7 @@
 	}
 
 	http_debug_hdr(http_hdr);
-	printf("body=[%s]\n", http_hdr->body );
+	mp_msg(MSGT_OPEN, MSGL_INFO,"body=[%s]\n", http_hdr->body );
 
 	switch(http_hdr->status_code) {
 		case 200:
--- a/libmpdemux/demux_audio.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_audio.c	Sat Apr 22 05:12:10 2006 +0000
@@ -1,6 +1,7 @@
 
 #include "config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -615,7 +616,7 @@
     break;
   }
   default:
-    printf("Audio demuxer : unknown format %d\n",priv->frmt);
+    mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_MPDEMUX_AUDIO_UnknownFormat,priv->frmt);
     return 0;
   }
 
--- a/libmpdemux/demux_demuxers.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_demuxers.c	Sat Apr 22 05:12:10 2006 +0000
@@ -1,5 +1,7 @@
 
 #include "config.h"
+#include "mp_msg.h"
+#include "help_mp.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -53,7 +55,7 @@
   else if(ds->demuxer == priv->sd)
     return demux_fill_buffer(priv->sd,ds);
  
-  printf("Demux demuxers fill_buffer error : bad demuxer : not vd, ad nor sd\n");
+  mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_MPDEMUX_DEMUXERS_FillBufferError);
   return 0;
 }
 
--- a/libmpdemux/demux_film.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_film.c	Sat Apr 22 05:12:10 2006 +0000
@@ -57,7 +57,7 @@
       new_current_chunk += rel_seek_secs * film_data->chunks_per_second; // secs
 
 
-printf ("current, total chunks = %d, %d; seek %5.3f sec, new chunk guess = %d\n",
+mp_msg(MSGT_DECVIDEO, MSGL_INFO,"current, total chunks = %d, %d; seek %5.3f sec, new chunk guess = %d\n",
   film_data->current_chunk, film_data->total_chunks,
   rel_seek_secs, new_current_chunk);
 
@@ -74,7 +74,7 @@
 
   film_data->current_chunk = new_current_chunk;
 
-printf ("  (flags = %X)  actual new chunk = %d (syncinfo1 = %08X)\n",
+mp_msg(MSGT_DECVIDEO, MSGL_INFO,"  (flags = %X)  actual new chunk = %d (syncinfo1 = %08X)\n",
   flags, film_data->current_chunk, film_data->chunks[film_data->current_chunk].syncinfo1);
   demuxer->video->pts=film_data->chunks[film_data->current_chunk].pts;
   
@@ -289,7 +289,7 @@
         stream_skip(demuxer->stream, 8);
 
       if(demuxer->audio->id<-1){
-          printf("chunk size = 0x%X \n",chunk_size);
+          mp_msg(MSGT_DECVIDEO, MSGL_INFO,"chunk size = 0x%X \n",chunk_size);
 	stream_skip(demuxer->stream, chunk_size-12-8);
 	break; // audio disabled (or no soundcard)
       }
--- a/libmpdemux/demux_mov.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_mov.c	Sat Apr 22 05:12:10 2006 +0000
@@ -1047,7 +1047,7 @@
 		  sh->aspect/=trak->tkdata[81]|(trak->tkdata[80]<<8);
 		}
 		
-		if(depth>32+8) printf("*** depth = 0x%X\n",depth);
+		if(depth>32+8) mp_msg(MSGT_DEMUX, MSGL_INFO,"*** depth = 0x%X\n",depth);
 
 		// palettized?
 		gray = 0;
--- a/libmpdemux/demux_nuv.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_nuv.c	Sat Apr 22 05:12:10 2006 +0000
@@ -331,7 +331,7 @@
 	/* no video */
 	if (rtjpeg_fileheader.videoblocks == 0)
 	{
-	    printf("No video blocks in file\n");
+	    mp_msg(MSGT_DEMUXER, MSGL_INFO, MSGTR_MPDEMUX_NUV_NoVideoBlocksInFile);
 	    return NULL;
 	}
 
--- a/libmpdemux/demux_real.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_real.c	Sat Apr 22 05:12:10 2006 +0000
@@ -1225,7 +1225,7 @@
 		    descr = malloc(len+1);
 	    	stream_read(demuxer->stream, descr, len);
 		    descr[len] = 0;
-		    printf("Stream description: %s\n", descr);
+		    mp_msg(MSGT_DEMUX, MSGL_INFO,"Stream description: %s\n", descr);
 		    free(descr);
 		}
 //		skip_str(1, demuxer);	/* mimetype */
@@ -1233,7 +1233,7 @@
 		    mimet = malloc(len+1);
 	    	stream_read(demuxer->stream, mimet, len);
 		    mimet[len] = 0;
-		    printf("Stream mimetype: %s\n", mimet);
+		    mp_msg(MSGT_DEMUX, MSGL_INFO,"Stream mimetype: %s\n", mimet);
 		}
 		
 		/* Type specific header */
--- a/libmpdemux/demux_xmms.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/demux_xmms.c	Sat Apr 22 05:12:10 2006 +0000
@@ -18,6 +18,9 @@
 #include "demuxer.h"
 #include "stheader.h"
 
+#include "mp_msg.h"
+#include "help_mp.h"
+
 #define XMMS_PACKETSIZE 65536  // some plugins won't play if this is too small
 
 #include "demux_xmms_plugin.h"
@@ -171,7 +174,7 @@
 	    gpi=dlsym(handle, "get_iplugin_info");
 	    if(gpi){
 		InputPlugin *p=gpi();
-		printf("XMMS: found plugin: %s (%s)\n",ent->d_name,p->description);
+		mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_XMMS_FoundPlugin,ent->d_name,p->description);
 		p->handle = handle;
 		p->filename = strdup(filename);
 		p->get_vis_type = input_get_vis_type;
@@ -190,7 +193,7 @@
 static void cleanup_plugins(){
     while(no_plugins>0){
 	--no_plugins;
-	printf("XMMS: Closing plugin %s\n",input_plugins[no_plugins]->filename);
+	mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_XMMS_ClosingPlugin,input_plugins[no_plugins]->filename);
 	if(input_plugins[no_plugins]->cleanup)
 	    input_plugins[no_plugins]->cleanup();
 	dlclose(input_plugins[no_plugins]->handle);
--- a/libmpdemux/stream.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/stream.c	Sat Apr 22 05:12:10 2006 +0000
@@ -271,7 +271,7 @@
   }
 
 if( mp_msg_test(MSGT_STREAM,MSGL_DBG3) ){
-  printf("s->pos=%"PRIX64"  newpos=%"PRIX64"  new_bufpos=%"PRIX64"  buflen=%X  \n",
+  mp_msg(MSGT_STREAM,MSGL_DBG3, "s->pos=%"PRIX64"  newpos=%"PRIX64"  new_bufpos=%"PRIX64"  buflen=%X  \n",
     (int64_t)s->pos,(int64_t)newpos,(int64_t)pos,s->buf_len);
 }
   pos-=newpos;
--- a/libmpdemux/tvi_v4l2.c	Fri Apr 21 18:46:17 2006 +0000
+++ b/libmpdemux/tvi_v4l2.c	Sat Apr 22 05:12:10 2006 +0000
@@ -1031,7 +1031,7 @@
 	standard.index = i;
 	if (-1 == ioctl(priv->video_fd, VIDIOC_ENUMSTD, &standard))
 	    break;
-	printf(" %d = %s;", i, standard.name);
+	mp_msg(MSGT_TV, MSGL_INFO, " %d = %s;", i, standard.name);
     }
     mp_msg(MSGT_TV, MSGL_INFO, "\n inputs:");
     for (i = 0; 1; i++) {