[MPlayer-dev-eng] Re: [TEST PATCH] How to get rid of all sscanf() or new face of config :)

Andriy N. Gritsenko andrej at lucky.net
Sat Mar 29 15:38:24 CET 2003


    Hi, Ivan Szanto!

Sometime (on Saturday, March 29 at 13:38) I've received something...
[.....]
>However, there are problems with the patch. This may be the
>reason why noone else than Albeu replied.

>1. failed hunk against MPlayer-20030325:

>(Stripping trailing CRs from patch.)
>patching file libao2/ao_win32.c
>Hunk #1 FAILED at 48.
>1 out of 1 hunk FAILED -- saving rejects to file libao2/ao_win32.c.rej

    I've tried it again, no errors was against MPlayer-20030325 at all
but I've found libao2/ao_win32.c has these CRs itself.

>2. doesn't compile with --enable-gui :

[.......]

>How did you test it with the gui, if it did not compile?

    Unfortunately, I didn't test it with GUI, as I said before, I didn't
touch that stuff at all, sorry. I hope someone who writes GUI will help
with it since new concept of GUI menu may be great thing for it. :)

>3. After compiling it without the gui, it crashed immediately (SIGSEGV):

[.......]

    Argh, it's my fault, sorry. I've tried it on MPlayer-20030310, hardly
tested it and then moved on MPlayer-20030325 but didn't check it. Only
now I found some differencies in these versions that I didn't find out
before. Sorry. Let me fix it now. Patch is in attachment.
    Thank you for your help.

    Best wishes for you!
    Andriy.
-------------- next part --------------
diff -udpr MPlayer-20030325/libmpcodecs/ve.c MPlayer-20030325.new/libmpcodecs/ve.c
--- MPlayer-20030325/libmpcodecs/ve.c	Tue Mar 25 18:44:13 2003
+++ MPlayer-20030325.new/libmpcodecs/ve.c	Sat Mar 29 15:37:41 2003
@@ -41,8 +41,7 @@ static vf_info_t* encoder_list[]={
 };
 
 vf_instance_t* vf_open_encoder(vf_instance_t* next, char *name, char *args){
-    char* vf_args[] = { "_oldargs_", args, NULL };
-    return vf_open_plugin(encoder_list,next,name,vf_args);
+    return vf_open_plugin(encoder_list,next,name,args);
 }
 
 void vf_register_encoders(m_config_t *config) {
diff -udpr MPlayer-20030325/libmpcodecs/vf.c MPlayer-20030325.new/libmpcodecs/vf.c
--- MPlayer-20030325/libmpcodecs/vf.c	Tue Mar 25 19:22:51 2003
+++ MPlayer-20030325.new/libmpcodecs/vf.c	Sat Mar 29 16:12:04 2003
@@ -304,7 +304,7 @@ static int vf_default_query_format(struc
   return vf_next_query_format(vf,fmt);
 }
 
-vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, const char *name, char **args){
+vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, const char *name, char *args){
     vf_instance_t* vf;
     int i;
     for(i=0;;i++){
@@ -324,13 +324,13 @@ vf_instance_t* vf_open_plugin(vf_info_t*
     vf->put_image=vf_next_put_image;
     vf->default_caps=VFCAP_ACCEPT_STRIDE;
     vf->default_reqs=0;
-    if(vf->info->open(vf,(char*)args)>0) return vf; // Success!
+    if(vf->info->open(vf,args)>0) return vf; // Success!
     free(vf);
     mp_msg(MSGT_VFILTER,MSGL_ERR,MSGTR_CouldNotOpenVideoFilter,name);
     return NULL;
 }
 
-vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char **args){
+vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char *args){
     if(strcmp(name,"vo"))
     mp_msg(MSGT_VFILTER,MSGL_INFO,
 	args ? MSGTR_OpeningVideoFilter "[%s=%s]\n"
@@ -426,7 +426,6 @@ vf_instance_t* append_filters(vf_instanc
     vf_instance_t* vf;
     char ***vop_list = m_config_get_option_ptr(config,"vop");
     char **vop_args;
-    m_option_t *opt;
 
     if(!vop_list || !*vop_list) return last;
     vop_args = *vop_list;
diff -udpr MPlayer-20030325/libmpcodecs/vf.h MPlayer-20030325.new/libmpcodecs/vf.h
--- MPlayer-20030325/libmpcodecs/vf.h	Tue Mar 25 20:52:07 2003
+++ MPlayer-20030325.new/libmpcodecs/vf.h	Sat Mar 29 15:42:07 2003
@@ -75,8 +75,8 @@ typedef struct vf_seteq_s 
 void vf_mpi_clear(mp_image_t* mpi,int x0,int y0,int w,int h);
 mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h);
 
-vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, const char *name, char **args);
-vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char **args);
+vf_instance_t* vf_open_plugin(vf_info_t** filter_list, vf_instance_t* next, const char *name, char *args);
+vf_instance_t* vf_open_filter(vf_instance_t* next, const char *name, char *args);
 vf_instance_t* vf_open_encoder(vf_instance_t* next, char *name, char *args);
 
 unsigned int vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred);
diff -udpr MPlayer-20030325/mencoder.c MPlayer-20030325.new/mencoder.c
--- MPlayer-20030325/mencoder.c	Tue Mar 25 19:07:16 2003
+++ MPlayer-20030325.new/mencoder.c	Sat Mar 29 16:05:08 2003
@@ -555,12 +555,12 @@ sh_video=d_video->sh;
 
 // unset names in case of streamcopy
 if (!strcmp(*oacodec,"copy")) *oacodec = NULL;
-else if (!strcmp(*oacodec,OAC_PCM)) *oacodec = OAC_PCM;
+else if (!strcmp(*oacodec,OAC_PCM)) *oacodec = (char *)OAC_PCM;
 #ifdef HAVE_MP3LAME
-else if (!strcmp(*oacodec,OAC_MP3LAME)) *oacodec = OAC_MP3LAME;
+else if (!strcmp(*oacodec,OAC_MP3LAME)) *oacodec = (char *)OAC_MP3LAME;
 #endif
 if (!strcmp(*ovcodec,"copy")) *ovcodec = NULL;
-else if (!strcmp(*ovcodec,OVC_FRAMENO)) *ovcodec = OVC_FRAMENO;
+else if (!strcmp(*ovcodec,OVC_FRAMENO)) *ovcodec = (char *)OVC_FRAMENO;
 
 if(sh_audio && (*oacodec || seek_to_sec || !sh_audio->wf)){
   // Go through the codec.conf and find the best codec...
@@ -710,10 +710,7 @@ if (*ovcodec==NULL) {
         mencoder_exit(1,NULL);
     }
     // append 'expand' filter, it fixes stride problems and renders osd:
-    if (auto_expand) {
-      char* vf_args[] = { "osd", "1", NULL };
-      sh_video->vfilter=vf_open_filter(sh_video->vfilter,"expand",vf_args);
-    }
+    if (auto_expand) sh_video->vfilter=vf_open_filter(sh_video->vfilter,"expand","-1:-1:-1:-1:1");
     sh_video->vfilter=append_filters(sh_video->vfilter,mconfig);
 
     mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
diff -udpr MPlayer-20030325/mplayer.c MPlayer-20030325.new/mplayer.c
--- MPlayer-20030325/mplayer.c	Tue Mar 25 19:09:52 2003
+++ MPlayer-20030325.new/mplayer.c	Sat Mar 29 16:00:03 2003
@@ -1564,14 +1564,11 @@ inited_flags|=INITED_VO;
 }
 
 current_module="init_video_filters";
-{
-  char* vf_arg[] = { "_oldargs_", (char*)video_out , NULL };
-  sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",vf_arg);
-}
+
+sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",(char *)video_out);
 #ifdef HAVE_MENU
 if(use_menu) {
-  char* vf_arg[] = { "_oldargs_", menu_root, NULL };
-  vf_menu = vf_open_plugin(libmenu_vfs,sh_video->vfilter,"menu",vf_arg);
+  vf_menu = vf_open_plugin(libmenu_vfs,sh_video->vfilter,"menu",menu_root);
   if(!vf_menu) {
     mp_msg(MSGT_CPLAYER,MSGL_ERR,"Can't open libmenu video filter with root menu %s\n",menu_root);
     use_menu = 0;


More information about the MPlayer-dev-eng mailing list