[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[611] mplayerxp/global_msg.h
Brought to you by:
olov
From: <nic...@us...> - 2012-12-27 18:06:06
|
Revision: 611 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=611&view=rev Author: nickols_k Date: 2012-12-27 18:05:58 +0000 (Thu, 27 Dec 2012) Log Message: ----------- It seems that my development system was damaged! At end of log -- patch which i can't apply due such behaviour of g++/gdb pair $ gdb --args ./ffmpeg -ao alsa:hw:1 -vo x11 M/l.avi -vf menu=main GNU gdb (GDB) 7.5 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/ffmpeg...done. (gdb) break cfgparser.cpp:60 Breakpoint 1 at 0x5d518a: file cfgparser.cpp, line 60. (gdb) run Starting program: /Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/ffmpeg -ao alsa:hw:1 -vo x11 M/l.avi -vf menu=main warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". *** Antiviral protection was inited ***!!! MPlayerXP svn.598 2002 Nickols_K 2000-2002 Arpad Gereoffy (?\209?\129?\208?\188. DOCS!) Can't open input config file /root/.ffmpeg/input.conf : No such file or directory Can't open input config file /usr/local/share/mplayerxp/input.conf : No such file or directory Falling back on default (hardcoded) input config Opening joystick device:/dev/input/js0 Can't open joystick device: /dev/input/js0 : No such file or directory Can't init input joystick with using: /dev/input/js0 ?\208?\163?\209?\129?\209?\130?\208?\176?\208?\189?\208?\190?\208?\178?\208?\186?\208?\176 ?\208?\191?\208?\190?\208?\180?\208?\180?\208?\181?\209?\128?\208?\182?\208?\186?\208?\184 lirc... mplayer: could not connect to socket mplayer: No such file or directory ?\208?\157?\208?\181?\209?\131?\208?\180?\208?\176?\209?\135?\208?\189?\208?\190?\208?\181 ?\208?\190?\209?\130?\208?\186?\209?\128?\209?\139?\209?\130?\208?\184?\208?\181 ?\208?\191?\208?\190?\208?\180?\208?\180?\208?\181?\209?\128?\208?\182?\208?\186?\208?\184 lirc! ?\208?\146?\209?\139 ?\208?\189?\208?\181 ?\209?\129?\208?\188?\208?\190?\208?\182?\208?\181?\209?\130?\208?\181 ?\208?\184?\209?\129?\208?\191?\208?\190?\208?\187?\209?\140?\208?\183?\208?\190?\208?\178?\208?\176?\209?\130?\209?\140 ?\208?\146?\208?\176?\209?\136?\208?\181 ?\209?\131?\208?\180?\208?\176?\208?\187?\209?\145?\208?\189?\208?\189?\208?\190?\208?\181 ?\209?\131?\208?\191?\209?\128?\208?\176?\208?\178?\208?\187?\208?\181?\208?\189?\208?\184?\208?\181 Breakpoint 1, m_config_save_option (conf= 0xcafa30 <mpxp::mplayerxp_options+80>, opt=..., param=..., config=...) at cfgparser.cpp:60 60 save = config.config_stack[config.cs_level]; (gdb) print config $1 = <optimized out> (gdb) print *config value has been optimized out (gdb) s operator[] (__n=<optimized out>, this=<optimized out>) at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.4/../../../../include/c++/4.5.4/bits/stl_vector.h:619 619 { return *(this->_M_impl._M_start + __n); } (gdb) n m_config_save_option (conf=0xcafa30 <mpxp::mplayerxp_options+80>, opt=..., param=..., config=...) at cfgparser.cpp:60 60 save = config.config_stack[config.cs_level]; (gdb) n Program received signal SIGSEGV, Segmentation fault. std::vector<config_save_t, std::allocator<config_save_t> >::operator= (this= 0x7fffffffd2c0, __x=...) at cfgparser.cpp:160 160 mpxp_dbg2<<"Config pushed level="<<config.cs_level<<std::endl; (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/ffmpeg -ao alsa:hw:1 -vo x11 M/l.avi -vf menu=main warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". *** Antiviral protection was inited ***!!! MPlayerXP svn.598 2002 Nickols_K 2000-2002 Arpad Gereoffy (?\209?\129?\208?\188. DOCS!) Can't open input config file /root/.ffmpeg/input.conf : No such file or directory Can't open input config file /usr/local/share/mplayerxp/input.conf : No such file or directory Falling back on default (hardcoded) input config Opening joystick device:/dev/input/js0 Can't open joystick device: /dev/input/js0 : No such file or directory Can't init input joystick with using: /dev/input/js0 ?\208?\163?\209?\129?\209?\130?\208?\176?\208?\189?\208?\190?\208?\178?\208?\186?\208?\176 ?\208?\191?\208?\190?\208?\180?\208?\180?\208?\181?\209?\128?\208?\182?\208?\186?\208?\184 lirc... mplayer: could not connect to socket mplayer: No such file or directory ?\208?\157?\208?\181?\209?\131?\208?\180?\208?\176?\209?\135?\208?\189?\208?\190?\208?\181 ?\208?\190?\209?\130?\208?\186?\209?\128?\209?\139?\209?\130?\208?\184?\208?\181 ?\208?\191?\208?\190?\208?\180?\208?\180?\208?\181?\209?\128?\208?\182?\208?\186?\208?\184 lirc! ?\208?\146?\209?\139 ?\208?\189?\208?\181 ?\209?\129?\208?\188?\208?\190?\208?\182?\208?\181?\209?\130?\208?\181 ?\208?\184?\209?\129?\208?\191?\208?\190?\208?\187?\209?\140?\208?\183?\208?\190?\208?\178?\208?\176?\209?\130?\209?\140 ?\208?\146?\208?\176?\209?\136?\208?\181 ?\209?\131?\208?\180?\208?\176?\208?\187?\209?\145?\208?\189?\208?\189?\208?\190?\208?\181 ?\209?\131?\208?\191?\209?\128?\208?\176?\208?\178?\208?\187?\208?\181?\208?\189?\208?\184?\208?\181 Breakpoint 1, m_config_save_option (conf= 0xcafa30 <mpxp::mplayerxp_options+80>, opt=..., param=..., config=...) at cfgparser.cpp:60 60 save = config.config_stack[config.cs_level]; (gdb) s operator[] (__n=<optimized out>, this=<optimized out>) at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.4/../../../../include/c++/4.5.4/bits/stl_vector.h:619 619 { return *(this->_M_impl._M_start + __n); } (gdb) s m_config_save_option (conf=0xcafa30 <mpxp::mplayerxp_options+80>, opt=..., param=..., config=...) at cfgparser.cpp:60 60 save = config.config_stack[config.cs_level]; (gdb) s operator[] (__n=<optimized out>, this=<optimized out>) at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.4/../../../../include/c++/4.5.4/bits/stl_vector.h:619 619 { return *(this->_M_impl._M_start + __n); } (gdb) s m_config_save_option (conf=0xcafa30 <mpxp::mplayerxp_options+80>, opt=..., param=..., config=...) at cfgparser.cpp:60 60 save = config.config_stack[config.cs_level]; (gdb) s std::vector<config_save_t, std::allocator<config_save_t> >::operator= (this= 0x7fffffffd2c0, __x=...) at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.4/../../../../include/c++/4.5.4/bits/vector.tcc:156 156 vector<_Tp, _Alloc>:: (gdb) s 159 if (&__x != this) (gdb) s 156 vector<_Tp, _Alloc>:: (gdb) n 159 if (&__x != this) (gdb) n 160 mpxp_dbg2<<"Config pushed level="<<config.cs_level<<std::endl; ----- Patch: ------ Index: libmpconf/cfgparser.h =================================================================== --- libmpconf/cfgparser.h (revision 609) +++ libmpconf/cfgparser.h (working copy) @@ -57,7 +57,7 @@ ~m_config_t() {} std::vector<const config_t*> opt_list; - config_save_t** config_stack; + std::vector<std::vector<config_save_t> > config_stack; int cs_level; int parser_mode; /* COMMAND_LINE or CONFIG_FILE */ int flags; @@ -76,7 +76,7 @@ float as_float; any_t* as_pointer; } param; - char* opt_name; + std::string opt_name; }; /* parse_config_file returns: Index: libmpconf/cfgparser.cpp =================================================================== --- libmpconf/cfgparser.cpp (revision 609) +++ libmpconf/cfgparser.cpp (working copy) @@ -44,8 +44,8 @@ static void m_config_save_option(m_config_t& config,const config_t* conf,const std::string& opt,const std::string& param) { - config_save_t* save; - int sl=0; + std::vector<config_save_t> save; + size_t sl=0; switch(conf->type) { case CONF_TYPE_PRINT : @@ -59,26 +59,23 @@ save = config.config_stack[config.cs_level]; - if(save) { + if(!save.empty()) { std::string lopt=opt; std::transform(lopt.begin(),lopt.end(),lopt.begin(), ::tolower); - for(sl = 0; save[sl].opt != NULL; sl++){ + size_t sz = save.size(); + for(sl = 0; sl<sz; sl++){ // Check to not save the same arg two times - if(save[sl].opt == conf && (save[sl].opt_name == NULL || lopt==save[sl].opt_name)) + if(save[sl].opt == conf && (save[sl].opt_name.empty() || lopt==save[sl].opt_name)) break; } if(save[sl].opt) return; } + config_save_t cs; + cs.opt=conf; + cs.opt_name=opt; + save.push_back(cs); - save = (config_save_t*)mp_realloc(save,(sl+2)*sizeof(config_save_t)); - if(save == NULL) { - mpxp_err<<"Can't allocate "<<((sl+2)*sizeof(config_save_t))<<" bytes of memory : "<<strerror(errno)<<std::endl; - return; - } - memset(&save[sl],0,2*sizeof(config_save_t)); - save[sl].opt = conf; - switch(conf->type) { case CONF_TYPE_FLAG : case CONF_TYPE_INC : @@ -93,7 +90,7 @@ break; case CONF_TYPE_INCLUDE : if(!param.empty()) - save->param.as_pointer = mp_strdup(param.c_str()); + save[sl].param.as_pointer = mp_strdup(param.c_str()); default : mpxp_err<<"Should never append in m_config_save_option : conf->type="<<conf->type<<std::endl; } @@ -102,11 +99,11 @@ } static int m_config_revert_option(m_config_t& config, config_save_t* save) { - const char* arg = NULL; + std::string arg; config_save_t* iter=NULL; int i=-1; - arg = save->opt_name ? save->opt_name : save->opt->name; + arg = !save->opt_name.empty() ? save->opt_name : save->opt->name; mpxp_dbg2<<"Reverting option: "<<arg<<std::endl; switch(save->opt->type) { @@ -124,21 +121,22 @@ case CONF_TYPE_INCLUDE : if(config.cs_level > 0) { for(i = config.cs_level - 1 ; i >= 0 ; i--){ - if(config.config_stack[i] == NULL) continue; - for(iter = config.config_stack[i]; iter != NULL && iter->opt != NULL ; iter++) { + if(config.config_stack[i].empty()) continue; + size_t si,sz=config.config_stack[i].size(); + for(si = 0; si<sz ; si++) { + iter = &config.config_stack[i].at(si); if(iter->opt == save->opt && ((save->param.as_pointer == NULL || iter->param.as_pointer == NULL) || strcasecmp((const char *)save->param.as_pointer,(const char *)iter->param.as_pointer) == 0) && - (save->opt_name == NULL || - (iter->opt_name && strcasecmp(save->opt_name,iter->opt_name)))) break; + (save->opt_name.empty() || + (!iter->opt_name.empty() && strcasecmp(save->opt_name.c_str(),iter->opt_name.c_str())))) break; } } } delete save->param.as_pointer; - if(save->opt_name) delete save->opt_name; save->param.as_pointer = NULL; save->opt_name = reinterpret_cast<char*>(save->param.as_pointer); if(i < 0) break; - arg = iter->opt_name ? iter->opt_name : iter->opt->name; + arg = !iter->opt_name.empty() ? iter->opt_name : iter->opt->name; switch(iter->opt->type) { case CONF_TYPE_INCLUDE : if (iter->param.as_pointer == NULL) { @@ -158,51 +156,36 @@ } void m_config_push(m_config_t& config) { - - config.cs_level++; - config.config_stack = (config_save_t**)mp_realloc(config.config_stack ,sizeof(config_save_t*)*(config.cs_level+1)); - if(config.config_stack == NULL) { - mpxp_err<<"Can't allocate "<<(sizeof(config_save_t*)*(config.cs_level+1))<<" bytes of memory : "<<strerror(errno)<<std::endl; - config.cs_level = -1; - return; - } - config.config_stack[config.cs_level] = NULL; - mpxp_dbg2<<"Config pushed level="<<config.cs_level<<std::endl; + config.cs_level++; + mpxp_dbg2<<"Config pushed level="<<config.cs_level<<std::endl; } int m_config_pop(m_config_t& config) { - int i,ret= 1; - config_save_t* cs; + int ret= 1; + std::vector<config_save_t> cs; - if(config.config_stack[config.cs_level] != NULL) { + if(!config.config_stack[config.cs_level].empty()) { cs = config.config_stack[config.cs_level]; - for(i=0; cs[i].opt != NULL ; i++ ) { + size_t i,sz=cs.size(); + for(i=0; i<sz; i++ ) { if (m_config_revert_option(config,&cs[i]) < 0) ret = -1; } - delete config.config_stack[config.cs_level]; + config.config_stack.erase(config.config_stack.begin()+config.cs_level); } - config.config_stack = (config_save_t**)mp_realloc(config.config_stack ,sizeof(config_save_t*)*config.cs_level); config.cs_level--; - if(config.cs_level > 0 && config.config_stack == NULL) { - mpxp_err<<"Can't allocate memory"<<std::endl; - config.cs_level = -1; - return -1; - } mpxp_dbg2<<"Config poped level="<<config.cs_level<<std::endl; return ret; } m_config_t& m_config_new(PlayTree* pt,libinput_t&libinput) { m_config_t& config = *new(zeromem) m_config_t(libinput); - config.config_stack = (config_save_t**)mp_calloc(1,sizeof(config_save_t*)); SET_GLOBAL(config); // We always start with global options config.pt = pt; return config; } void m_config_free(m_config_t* config) { - delete config->config_stack; delete config; } @@ -944,8 +927,8 @@ int m_config_is_option_set(const m_config_t& config,const std::string& arg) { const config_t* opt; - config_save_t* save; - int l,i; + std::vector<config_save_t> save; + int l; opt = m_config_get_option(config,arg); @@ -954,12 +937,9 @@ for(l = config.cs_level ; l >= 0 ; l--) { save = config.config_stack[l]; - if(!save) - continue; - for(i = 0 ; save[i].opt != NULL ; i++) { - if(save[i].opt == opt) - return 1; - } + if(save.empty()) continue; + size_t i,sz=save.size(); + for(i = 0 ; i<sz ; i++) if(save[i].opt == opt) return 1; } return 0; Revision Links: -------------- http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=609&view=rev http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=609&view=rev Modified Paths: -------------- mplayerxp/global_msg.h Modified: mplayerxp/global_msg.h =================================================================== --- mplayerxp/global_msg.h 2012-12-27 17:51:43 UTC (rev 610) +++ mplayerxp/global_msg.h 2012-12-27 18:05:58 UTC (rev 611) @@ -16,5 +16,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_GLOBAL); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_GLOBAL); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_GLOBAL); + } // namespace mpxp #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |