summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-20 03:25:26 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-20 03:25:26 +0000
commitc835270280ec535fcb407737504a6996174a6195 (patch)
treeeda403c31f5d327d8430212052de4f0ec9217fb4 /libmpcodecs
parent8126f220e715b122fb6824c0b6527edfe363ce0e (diff)
downloadmpv-c835270280ec535fcb407737504a6996174a6195.tar.bz2
mpv-c835270280ec535fcb407737504a6996174a6195.tar.xz
big cosmetics patch, cleanup of messages printed by mplayer and libs.
some printf->mp_msg conversion, and some debug messages moved from warn/info to v/dbg2 mplayer's output is now shorter, readable and consistent git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6139 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_mp3.c1
-rw-r--r--libmpcodecs/dec_audio.c2
-rw-r--r--libmpcodecs/dec_video.c4
-rw-r--r--libmpcodecs/vd.c20
-rw-r--r--libmpcodecs/vf.c11
-rw-r--r--libmpcodecs/vf_scale.c8
-rw-r--r--libmpcodecs/vf_vo.c8
7 files changed, 20 insertions, 34 deletions
diff --git a/libmpcodecs/ad_mp3.c b/libmpcodecs/ad_mp3.c
index 57309a34bf..e4b8f9c4bc 100644
--- a/libmpcodecs/ad_mp3.c
+++ b/libmpcodecs/ad_mp3.c
@@ -46,6 +46,7 @@ static int init(sh_audio_t *sh)
#endif
MP3_samplerate=MP3_channels=0;
sh->a_buffer_len=MP3_DecodeFrame(sh->a_buffer,-1);
+ if(!sh->a_buffer_len) return 0; // unsupported layer/format
sh->channels=2; // hack
sh->samplerate=MP3_samplerate;
sh->i_bps=MP3_bitrate*(1000/8);
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index 333c4d6c15..aa6a491f1d 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -39,7 +39,7 @@ int init_audio(sh_audio_t *sh_audio)
return 0; // no such driver
}
- mp_msg(MSGT_DECAUDIO,MSGL_INFO,"Selecting Audio Decoder: [%s] %s\n",mpadec->info->short_name,mpadec->info->name);
+ mp_msg(MSGT_DECAUDIO,MSGL_INFO,"Opening audio decoder: [%s] %s\n",mpadec->info->short_name,mpadec->info->name);
// reset in/out buffer size/pointer:
sh_audio->a_buffer_size=0;
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 5978b0b50c..103e25f0d3 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -60,7 +60,7 @@ int get_video_quality_max(sh_video_t *sh_video){
return ret;
}
}
- mp_msg(MSGT_DECVIDEO,MSGL_INFO,"[PP] Sorry, postprocessing is not available\n");
+// mp_msg(MSGT_DECVIDEO,MSGL_INFO,"[PP] Sorry, postprocessing is not available\n");
return 0;
}
@@ -157,7 +157,7 @@ int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){
continue;
}
// it's available, let's try to init!
- mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Opening Video Decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name);
+ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Opening video decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name);
if(!mpvdec->init(sh_video)){
mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDecoder init failed :(\n");
continue; // try next...
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index 6739809d4d..42f34bc227 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -135,7 +135,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf
sh->disp_h=h;
#endif
- mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDec: vo config request - %d x %d, %s \n",
+ mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDec: vo config request - %d x %d (preferred csp: %s) \n",
w,h,vo_format_name(preferred_outfmt));
// if(!vf) return 1; // temp hack
@@ -233,24 +233,6 @@ csp_again:
}
}
-#if 0
- if(video_out->get_info)
- { const vo_info_t *info = video_out->get_info();
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"VO: [%s] %dx%d => %dx%d %s %s%s%s%s\n",info->short_name,
- sh->disp_w,sh->disp_h,
- screen_size_x,screen_size_y,
- vo_format_name(out_fmt),
- fullscreen?"fs ":"",
- vidmode?"vm ":"",
- softzoom?"zoom ":"",
- (flip==1)?"flip ":"");
- mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Description: %s\n",info->name);
- mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Author: %s\n", info->author);
- if(info->comment && strlen(info->comment) > 0)
- mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Comment: %s\n", info->comment);
- }
-#endif
-
// Time to config libvo!
mp_msg(MSGT_CPLAYER,MSGL_V,"video_out->init(%dx%d->%dx%d,flags=%d,'%s',0x%X)\n",
sh->disp_w,sh->disp_h,
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index da53f93fe5..3fa0d60fea 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -81,7 +81,7 @@ void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h){
for(y=y0;y<y0+h;y++){
unsigned char* dst=mpi->planes[0]+mpi->stride[0]*y+(mpi->bpp>>3)*x0;
if(mpi->flags&MP_IMGFLAG_YUV){
- unsigned int* p=dst;
+ unsigned int* p=(unsigned int*) dst;
int size=(mpi->bpp>>3)*w/4;
int i;
if(mpi->flags&MP_IMGFLAG_SWAPPED){
@@ -176,7 +176,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
}
}
if(!(mpi->flags&MP_IMGFLAG_TYPE_DISPLAYED)){
- mp_msg(MSGT_DECVIDEO,MSGL_INFO,"*** [%s] %s mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n",
+ mp_msg(MSGT_DECVIDEO,MSGL_V,"*** [%s] %s mp_image_t, %dx%dx%dbpp %s %s, %d bytes\n",
vf->info->name,
(mpi->type==MP_IMGTYPE_EXPORT)?"Exporting":
((mpi->flags&MP_IMGFLAG_DIRECT)?"Direct Rendering":"Allocating"),
@@ -220,6 +220,10 @@ vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, char
}
vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char *args){
+ if(strcmp(name,"vo"))
+ mp_msg(MSGT_VFILTER,MSGL_INFO,
+ args ? "Opening video filter: [%s=%s]\n"
+ : "Opening video filter: [%s]\n" ,name,args);
return vf_open_plugin(filter_list,next,name,args);
}
@@ -275,7 +279,7 @@ int vf_next_config(struct vf_instance_s* vf,
return 0; // FAIL
}
}
- printf("REQ: flags=0x%X req=0x%X \n",flags,vf->default_reqs);
+ mp_msg(MSGT_VFILTER,MSGL_V,"REQ: flags=0x%X req=0x%X \n",flags,vf->default_reqs);
miss=vf->default_reqs - (flags&vf->default_reqs);
if(miss&VFCAP_ACCEPT_STRIDE){
// vf requires stride support but vf->next doesn't support it!
@@ -311,7 +315,6 @@ vf_instance_t* append_filters(vf_instance_t* last){
char* name=strdup(*plugin_args);
char* args=strchr(name,'=');
if(args){args[0]=0;++args;}
- mp_msg(MSGT_VFILTER,MSGL_INFO,"Opening video filter '%s' with args '%s'...\n",name,args);
vf=vf_open_filter(last,name,args);
if(vf) last=vf;
free(name);
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index 38fc5d61de..6813f28a80 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -56,7 +56,7 @@ static int config(struct vf_instance_s* vf,
int vo_flags;
if(!best){
- printf("SwScale: no supported outfmt found :(\n");
+ mp_msg(MSGT_VFILTER,MSGL_WARN,"SwScale: no supported outfmt found :(\n");
return 0;
}
@@ -95,7 +95,7 @@ static int config(struct vf_instance_s* vf,
if(vf->priv->h<0) vf->priv->h=height; else
if(vf->priv->h==0) vf->priv->h=d_height;
- printf("SwScale scaling %dx%d %s to %dx%d %s \n",
+ mp_msg(MSGT_VFILTER,MSGL_DBG2,"SwScale: scaling %dx%d %s to %dx%d %s \n",
width,height,vo_format_name(outfmt),
vf->priv->w,vf->priv->h,vo_format_name(best));
@@ -109,7 +109,7 @@ static int config(struct vf_instance_s* vf,
(best==IMGFMT_I420 || best==IMGFMT_IYUV)?IMGFMT_YV12:best);
if(!vf->priv->ctx){
// error...
- printf("Couldn't init SwScaler for this setup\n");
+ mp_msg(MSGT_VFILTER,MSGL_WARN,"Couldn't init SwScaler for this setup\n");
return 0;
}
vf->priv->fmt=best;
@@ -184,7 +184,7 @@ static int open(vf_instance_t *vf, char* args){
if(args) sscanf(args, "%d:%d",
&vf->priv->w,
&vf->priv->h);
- printf("SwScale: %d x %d (-1=no scaling)\n",
+ mp_msg(MSGT_VFILTER,MSGL_V,"SwScale params: %d x %d (-1=no scaling)\n",
vf->priv->w,
vf->priv->h);
return 1;
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index e255c3498d..69d4c0308d 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -24,10 +24,10 @@ static int config(struct vf_instance_s* vf,
width, height,
d_width, d_height,
vo_format_name(outfmt),
- (flags&1)?"fs ":"",
- (flags&2)?"vm ":"",
- (flags&4)?"zoom ":"",
- (flags&8)?"flip ":"");
+ (flags&1)?" [fs]":"",
+ (flags&2)?" [vm]":"",
+ (flags&4)?" [zoom]":"",
+ (flags&8)?" [flip]":"");
mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Description: %s\n",info->name);
mp_msg(MSGT_CPLAYER,MSGL_V,"VO: Author: %s\n", info->author);
if(info->comment && strlen(info->comment) > 0)