mplayerxp-cvslog Mailing List for MplayerXP-mplayer with extra performance
Brought to you by:
olov
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(53) |
Apr
(142) |
May
(129) |
Jun
(160) |
Jul
(102) |
Aug
(14) |
Sep
(50) |
Oct
(27) |
Nov
(52) |
Dec
(41) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(136) |
Feb
(170) |
Mar
(103) |
Apr
(102) |
May
(44) |
Jun
(25) |
Jul
(2) |
Aug
|
Sep
(6) |
Oct
(1) |
Nov
|
Dec
(4) |
2004 |
Jan
|
Feb
(21) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
(160) |
Nov
(63) |
Dec
(5) |
2005 |
Jan
(10) |
Feb
(14) |
Mar
(18) |
Apr
(74) |
May
(72) |
Jun
(22) |
Jul
(28) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(91) |
Feb
(71) |
Mar
(1) |
Apr
|
May
|
Jun
(4) |
Jul
(3) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(9) |
Dec
(26) |
2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
(17) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(134) |
Dec
(72) |
2008 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
(1) |
Oct
(21) |
Nov
(41) |
Dec
(12) |
2009 |
Jan
(57) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(25) |
Oct
(1) |
Nov
(46) |
Dec
(59) |
2010 |
Jan
(84) |
Feb
(5) |
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(122) |
Nov
(223) |
Dec
(132) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(13) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <nic...@us...> - 2013-08-26 16:15:01
|
Revision: 658 http://sourceforge.net/p/mplayerxp/code/658 Author: nickols_k Date: 2013-08-26 16:14:58 +0000 (Mon, 26 Aug 2013) Log Message: ----------- use static linkage by default Modified Paths: -------------- etc/Makefile mplayerxp/configure Modified: etc/Makefile =================================================================== --- etc/Makefile 2013-06-20 10:08:21 UTC (rev 657) +++ etc/Makefile 2013-08-26 16:14:58 UTC (rev 658) @@ -8,7 +8,6 @@ distclean: rm -f config.mak configure.log install: - $(INSTALL) -D -b -c -m 644 codecs.conf $(DESTDIR)$(CONFDIR)/codecs.conf $(INSTALL) -D -b -c -m 644 menu.conf $(DESTDIR)$(CONFDIR)/menu.conf $(INSTALL) -D -b -c -m 644 eqbands $(DESTDIR)$(CONFDIR)/eqbands uninstall: Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2013-06-20 10:08:21 UTC (rev 657) +++ mplayerxp/configure 2013-08-26 16:14:58 UTC (rev 658) @@ -36,7 +36,7 @@ # and have - unless stated otherwise - at least 2 states : yes no # If autodetection is available then the third state is: auto ENABLED_LIST=( - "shared|build shared libraries", + "static|build static libraries", "gomp|use GNU OpenMP (requires gcc-4.3+)", "gpl_only|build only GPL code", "fastcall|use regparm method on x86 systems", @@ -85,8 +85,8 @@ DISABLED_LIST=( "gcov|compile gnu coverage information into PROGRAM", "profile|compile profiling information into PROGRAM", - "static|build static libraries", "dbg23|allow additional level of debug messages", + "shared|build shared libraries", "random_name|generates pseudo random suffix of target", "sdl|build with SDL video and audio output|http://www.libsdl.org", "sdl_image|build with SDL_image for screenshots|http://www.libsdl.org/projects/SDL_image", @@ -335,6 +335,9 @@ add_cflags "-Warray-bounds -Wreturn-type -Wuninitialized -Wlogical-op -Waddress" check_cflags "-W -Wall -Wextra" +enabled static && add_ldflags="-static" +enabled shared && add_ldflags="-shared" + echocheck CFLAGS echores $CFLAGS echocheck CXXFLAGS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-06-20 10:08:23
|
Revision: 657 http://sourceforge.net/p/mplayerxp/code/657 Author: nickols_k Date: 2013-06-20 10:08:21 +0000 (Thu, 20 Jun 2013) Log Message: ----------- fix prefix printing Modified Paths: -------------- mplayerxp/libmpconf/cfgparser.cpp mplayerxp/xmpcore/binary_packet.h Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-06-20 09:16:33 UTC (rev 656) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-06-20 10:08:21 UTC (rev 657) @@ -777,14 +777,14 @@ pfxlen=strlen(opts[i].name)+1; if(!pfx.empty()) { pfxlen+=pfx.length(); newpfx=pfx; } else newpfx=""; - newpfx+=opts[i].name; - newpfx+="."; + if(newpfx.empty()) newpfx+=std::string("-"); + newpfx+=std::string(opts[i].name)+"."; __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); } else if(opts[i].type<=CONF_TYPE_PRINT) { std::ostringstream os; for(n=0;n<ntabs;n++) mpxp_info<<" "; if(!pfx.empty()) os<<std::left<<pfx; - else os<<" "; + else os<<" -"; os<<opts[i].name; mpxp_info<<std::left<<std::setw(25)<<os.str()<<" "<<opts[i].help; if((opts[i].flags&CONF_NOCFG)==0) { Modified: mplayerxp/xmpcore/binary_packet.h =================================================================== --- mplayerxp/xmpcore/binary_packet.h 2013-06-20 09:16:33 UTC (rev 656) +++ mplayerxp/xmpcore/binary_packet.h 2013-06-20 10:08:21 UTC (rev 657) @@ -1,6 +1,7 @@ #ifndef BINARY_PACKET_HPP_INCLUDED #define BINARY_PACKET_HPP_INCLUDED 1 #include "osdep/mplib.h" +#include <typeinfo> #include <iostream> #include <sstream> #include <stdexcept> @@ -70,14 +71,14 @@ T& operator[](size_t idx) { if((idx+1)*sizeof(T)<=size()) return ((T*)data())[idx]; std::ostringstream os; - os<<"."<<get_caller_address()<<" => object_container["<<idx<<"]"; + os<<"."<<get_caller_address()<<" => objects_container<"<<typeid(T).name()<<">["<<idx<<"]"; throw std::out_of_range(os.str()); } const T& operator[](size_t idx) const { if((idx+1)*sizeof(T)<=size()) return ((const T*)data())[idx]; std::ostringstream os; - os<<"."<<get_caller_address()<<" => object_container["<<idx<<"] const"; + os<<"."<<get_caller_address()<<" => objects_container"<<typeid(T).name()<<">["<<idx<<"] const"; throw std::out_of_range(os.str()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-06-20 09:16:35
|
Revision: 656 http://sourceforge.net/p/mplayerxp/code/656 Author: nickols_k Date: 2013-06-20 09:16:33 +0000 (Thu, 20 Jun 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/libmpdemux/demux_aiff.cpp mplayerxp/libmpdemux/demux_asf.cpp mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpstream2/cache2.cpp mplayerxp/xmpcore/binary_packet.cpp mplayerxp/xmpcore/binary_packet.h Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/dump.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -66,7 +66,7 @@ mpxp_info<<"Dumping stream to "<<name<<std::endl; while(!stream->eof()){ binary_packet bp=stream->read(4096); - if(bp.size()>0) f.write(bp.cdata(),bp.size()); + if(bp.size()>0) f<<bp; } f.close(); mpxp_info<<MSGTR_StreamDumped<<std::endl; Modified: mplayerxp/libmpdemux/demux_aiff.cpp =================================================================== --- mplayerxp/libmpdemux/demux_aiff.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/libmpdemux/demux_aiff.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -147,7 +147,7 @@ bp=s->read(chunk_size); bp.resize(bp.size()+1); bp[chunk_size]=0; - demuxer->info().add(INFOT_NAME, bp.cdata()); + demuxer->info().add(INFOT_NAME, (const char*)bp.data()); if(priv->verc && (chunk_size&1)) s->read(type_byte); } else @@ -156,7 +156,7 @@ bp=s->read(chunk_size); bp.resize(bp.size()+1); bp[chunk_size]=0; - demuxer->info().add(INFOT_AUTHOR, bp.cdata()); + demuxer->info().add(INFOT_AUTHOR, (const char*)bp.data()); if(priv->verc && (chunk_size&1)) s->read(type_byte); } else @@ -165,7 +165,7 @@ bp=s->read(chunk_size); bp.resize(bp.size()+1); bp[chunk_size]=0; - demuxer->info().add(INFOT_COPYRIGHT, bp.cdata()); + demuxer->info().add(INFOT_COPYRIGHT, (const char*)bp.data()); if(priv->verc && (chunk_size&1)) s->read(type_byte); } else @@ -174,7 +174,7 @@ bp=s->read(chunk_size); bp.resize(bp.size()+1); bp[chunk_size]=0; - demuxer->info().add(INFOT_DESCRIPTION, bp.cdata()); + demuxer->info().add(INFOT_DESCRIPTION,(const char*)bp.data()); if(priv->verc && (chunk_size&1)) s->read(type_byte); } else Modified: mplayerxp/libmpdemux/demux_asf.cpp =================================================================== --- mplayerxp/libmpdemux/demux_asf.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/libmpdemux/demux_asf.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -64,13 +64,14 @@ }; // the variable string is modify in this function -void pack_asf_string(char* string, int length) { - int i,j; - if( string==NULL ) return; - for( i=0, j=0; i<length && string[i]!='\0'; i+=2, j++) { - string[j]=string[i]; - } - string[j]='\0'; +std::string pack_asf_string(const char* string, size_t length) { + std::string rc; + size_t i; + if( string==NULL ) return rc; + for( i=0; i<length && string[i]!='\0'; i+=2) { + rc.append(1,string[i]); + } + return rc; } // the variable string is modify in this function @@ -253,32 +254,27 @@ // extract the title if( apriv->contenth.title_size!=0 ) { bp=demuxer->stream->read(apriv->contenth.title_size); - pack_asf_string(bp.cdata(), bp.size()); - demuxer->info().add(INFOT_NAME, bp.cdata()); + demuxer->info().add(INFOT_NAME, pack_asf_string((const char*)bp.data(), bp.size()).c_str()); } // extract the author if( apriv->contenth.author_size!=0 ) { bp=demuxer->stream->read(apriv->contenth.author_size); - pack_asf_string(bp.cdata(),bp.size()); - demuxer->info().add(INFOT_AUTHOR, bp.cdata()); + demuxer->info().add(INFOT_AUTHOR, pack_asf_string((const char*)bp.data(), bp.size()).c_str()); } // extract the copyright if( apriv->contenth.copyright_size!=0 ) { bp=demuxer->stream->read(apriv->contenth.copyright_size); - pack_asf_string(bp.cdata(), bp.size()); - demuxer->info().add(INFOT_COPYRIGHT, bp.cdata()); + demuxer->info().add(INFOT_COPYRIGHT, pack_asf_string((const char*)bp.data(), bp.size()).c_str()); } // extract the comment if( apriv->contenth.comment_size!=0 ) { bp=demuxer->stream->read(apriv->contenth.comment_size); - pack_asf_string(bp.cdata(), bp.size()); - demuxer->info().add(INFOT_COMMENTS, bp.cdata()); + demuxer->info().add(INFOT_COMMENTS, pack_asf_string((const char*)bp.data(), bp.size()).c_str()); } // extract the rating if( apriv->contenth.rating_size!=0 ) { bp=demuxer->stream->read(apriv->contenth.rating_size); - pack_asf_string(bp.cdata(), bp.size()); - demuxer->info().add(INFOT_RATING, bp.cdata()); + demuxer->info().add(INFOT_RATING, pack_asf_string((const char*)bp.data(), bp.size()).c_str()); } MSG_V("\n"); break; @@ -286,12 +282,13 @@ case ASF_GUID_PREFIX_stream_group: { uint16_t stream_id, i; uint32_t max_bitrate; - char *object=NULL, *ptr=NULL; + char *object=NULL; + const char *ptr=NULL; MSG_V("============ ASF Stream group == START ===\n"); MSG_V(" object size = %d\n", (int)apriv->objh.size); bp=demuxer->stream->read(apriv->objh.size ); // FIXME: We need some endian handling below... - ptr = bp.cdata(); + ptr = (const char*)bp.data(); stream_count = le2me_16(*(uint16_t*)ptr); ptr += sizeof(uint16_t); if(stream_count > 0) streams = new uint32_t[2*stream_count]; Modified: mplayerxp/libmpdemux/demux_avi.cpp =================================================================== --- mplayerxp/libmpdemux/demux_avi.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/libmpdemux/demux_avi.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -482,9 +482,9 @@ chunksize-=len; bp.resize(bp.size()+1); bp.cdata()[len]=0; - MSG_V("%-10s: %s\n",hdr,bp.cdata()); - if(infot!=-1) demuxer->info().add(infot, bp.cdata()); - else MSG_V(" %s: %s\n",hdr,bp.cdata()); + MSG_V("%-10s: %s\n",hdr,(const char*)bp.data()); + if(infot!=-1) demuxer->info().add(infot, (const char*)bp.data()); + else MSG_V(" %s: %s\n",hdr,(const char*)bp.data()); } } MSG_DBG2("list_end=0x%X pos=0x%X chunksize=0x%X next=0x%X\n", Modified: mplayerxp/libmpdemux/demux_mpxp64.cpp =================================================================== --- mplayerxp/libmpdemux/demux_mpxp64.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/libmpdemux/demux_mpxp64.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -411,7 +411,7 @@ { binary_packet bp=s->read(len); sub_data.cp=nls_get_screen_cp(mpxp_get_environment()); - demuxer->info().add(infot,nls_recode2screen_cp(codepage,bp.cdata(),bp.size())); + demuxer->info().add(infot,nls_recode2screen_cp(codepage,(const char*)bp.data(),bp.size())); } else s->skip(len); } Modified: mplayerxp/libmpstream2/cache2.cpp =================================================================== --- mplayerxp/libmpstream2/cache2.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/libmpstream2/cache2.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -402,7 +402,7 @@ static binary_packet __FASTCALL__ c2_stream_read(cache_vars_t* c,size_t total){ binary_packet rc(total); int len=total,eof,mlen; - char *mem=rc.cdata(); + uint8_t *mem=rc.cdata(); unsigned buf_pos; unsigned cur,i,npackets; Modified: mplayerxp/xmpcore/binary_packet.cpp =================================================================== --- mplayerxp/xmpcore/binary_packet.cpp 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/xmpcore/binary_packet.cpp 2013-06-20 09:16:33 UTC (rev 656) @@ -1,9 +1,9 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; -#include <stdexcept> +#include <stdint.h> +#include <stdlib.h> #include <string.h> - #include "binary_packet.h" namespace usr { @@ -20,7 +20,7 @@ { if(from.len) { buffer=new char[from.len]; - ::memcpy(buffer,from.buffer,len); + memcpy(buffer,from.buffer,len); } } @@ -30,7 +30,7 @@ { if(sz) { buffer=new char[sz]; - ::memcpy(buffer,src,sz); + memcpy(buffer,src,sz); } } @@ -42,7 +42,7 @@ len=sz; if(sz) { buffer = new char[sz]; - ::memcpy(buffer,_data,sz); + memcpy(buffer,_data,sz); } return *this; } @@ -50,7 +50,7 @@ binary_packet& binary_packet::append(const any_t* _data,size_t sz) { if(sz) { buffer = mp_realloc(buffer,len+sz); - ::memcpy(&((char*)buffer)[len],_data,sz); + memcpy(&((char*)buffer)[len],_data,sz); } len+=sz; return *this; @@ -58,6 +58,40 @@ binary_packet& binary_packet::append(const binary_packet& it) { return append(it.buffer,it.len); } +binary_packet& binary_packet::insert(size_t pos,const any_t* sdata,size_t slen) { + resize(len+slen); + memmove(&((uint8_t*)buffer)[pos+slen],&((uint8_t*)buffer)[pos],slen); + memcpy(&((uint8_t*)buffer)[pos],sdata,slen); + return *this; +} + +binary_packet& binary_packet::insert(size_t pos,const binary_packet& it) { return insert(pos,it.buffer,it.len); } + +binary_packet& binary_packet::replace(size_t pos,const any_t* sdata,size_t slen) { + if(pos+slen>len) { + std::ostringstream os; + os<<"."<<get_caller_address()<<" => binary_packet::replace("<<pos<<","<<slen<<")"; + throw std::out_of_range(os.str()); + } + memcpy(&((uint8_t*)buffer)[pos],sdata,slen); + return *this; +} + +binary_packet& binary_packet::replace(size_t pos,const binary_packet& it) { return replace(pos,it.buffer,it.len); } + +binary_packet& binary_packet::remove(size_t pos,size_t n) { + if(pos+n==len) resize(len-n); + else if(pos+n<len){ + memmove(&((uint8_t*)buffer)[pos],&((uint8_t*)buffer)[pos+n],n); + resize(len-n); + } else { + std::ostringstream os; + os<<"."<<get_caller_address()<<" => binary_packet::remove("<<pos<<","<<n<<")"; + throw std::out_of_range(os.str()); + } + return *this; +} + binary_packet binary_packet::operator+(const binary_packet& rhs) const { binary_packet rc(len+rhs.len); ::memcpy(rc.buffer,buffer,len); @@ -75,56 +109,74 @@ return *this; } -char& binary_packet::operator[](size_t idx) { return at(idx); } -const char& binary_packet::operator[](size_t idx) const { return at(idx); } +uint8_t& binary_packet::operator[](size_t idx) { return at(idx); } +const uint8_t& binary_packet::operator[](size_t idx) const { return at(idx); } - bool binary_packet::operator==(const binary_packet& from) const { - if(len==from.len) return ::memcmp(buffer,from.buffer,len)==0; + if(len==from.len) return memcmp(buffer,from.buffer,len)==0; return false; } bool binary_packet::operator!=(const binary_packet& from) const { - if(len==from.len) return ::memcmp(buffer,from.buffer,len)!=0; + if(len==from.len) return memcmp(buffer,from.buffer,len)!=0; return true; } bool binary_packet::operator<(const binary_packet& from) const { - if(len==from.len) return ::memcmp(buffer,from.buffer,len)<0; + if(len==from.len) return memcmp(buffer,from.buffer,len)<0; return len<from.len; } bool binary_packet::operator<=(const binary_packet& from) const { - if(len==from.len) return ::memcmp(buffer,from.buffer,len)<=0; + if(len==from.len) return memcmp(buffer,from.buffer,len)<=0; return len<from.len; } bool binary_packet::operator>(const binary_packet& from) const { - if(len==from.len) return ::memcmp(buffer,from.buffer,len)>0; + if(len==from.len) return memcmp(buffer,from.buffer,len)>0; return len>from.len; } bool binary_packet::operator>=(const binary_packet& from) const { - if(len==from.len) return ::memcmp(buffer,from.buffer,len)>=0; + if(len==from.len) return memcmp(buffer,from.buffer,len)>=0; return len>from.len; } -char& binary_packet::front() { return ((char*)buffer)[0]; } -const char& binary_packet::front() const { return ((const char*)buffer)[0]; } -char& binary_packet::back() { return ((char*)buffer)[len-1]; } -const char& binary_packet::back() const { return ((const char*)buffer)[len-1]; } +uint8_t& binary_packet::front() { return ((uint8_t*)buffer)[0]; } +const uint8_t& binary_packet::front() const { return ((const uint8_t*)buffer)[0]; } +uint8_t& binary_packet::back() { return ((uint8_t*)buffer)[len-1]; } +const uint8_t& binary_packet::back() const { return ((const uint8_t*)buffer)[len-1]; } -char& binary_packet::at(size_t idx) { - if(idx<len) return ((char*)buffer)[idx]; - throw std::out_of_range("binary_packet.at"); +uint8_t& binary_packet::at(size_t idx) { + if(idx<len) return ((uint8_t*)buffer)[idx]; + std::ostringstream os; + os<<"."<<get_caller_address()<<" => binary_packet::at("<<idx<<")"; + throw std::out_of_range(os.str()); } -const char& binary_packet::at(size_t idx) const { - if(idx<len) return ((const char*)buffer)[idx]; - throw std::out_of_range("binary_packet.at const"); +const uint8_t& binary_packet::at(size_t idx) const { + if(idx<len) return ((const uint8_t*)buffer)[idx]; + std::ostringstream os; + os<<"."<<get_caller_address()<<" => binary_packet::at("<<idx<<")"; + throw std::out_of_range(os.str()); } binary_packet binary_packet::subpacket(size_t start,size_t length) const { - if(start+length>len) throw std::out_of_range("binary_packet.subpacket"); + if(start+length>len) { + std::ostringstream os; + os<<"."<<get_caller_address()<<" => binary_packet::subpacket("<<start<<","<<length<<")"; + throw std::out_of_range(os.str()); + } binary_packet rc(length); - ::memcpy(rc.buffer,&((char*)buffer)[start],length); + memcpy(rc.buffer,&((char*)buffer)[start],length); return rc; } +std::ostream& operator<<(std::ostream& os,const binary_packet& bp) { + os.write((const char*)bp.data(),bp.size()); + return os; +} + +std::istream& operator>>(std::istream& is,binary_packet& bp) { + bp.resize(is.width()); + is.read((char*)bp.data(),bp.size()); + return is; +} + binary_packet::~binary_packet() { if(buffer) delete (char*)buffer; } } // namespace usr Modified: mplayerxp/xmpcore/binary_packet.h =================================================================== --- mplayerxp/xmpcore/binary_packet.h 2013-06-14 21:51:03 UTC (rev 655) +++ mplayerxp/xmpcore/binary_packet.h 2013-06-20 09:16:33 UTC (rev 656) @@ -1,6 +1,9 @@ #ifndef BINARY_PACKET_HPP_INCLUDED #define BINARY_PACKET_HPP_INCLUDED 1 #include "osdep/mplib.h" +#include <iostream> +#include <sstream> +#include <stdexcept> namespace usr { class binary_packet : public Opaque { @@ -13,8 +16,8 @@ binary_packet& operator=(const binary_packet& from); binary_packet& operator+=(const binary_packet& from); binary_packet operator+(const binary_packet& rhs) const; - char& operator[](size_t idx); - const char& operator[](size_t idx) const; + uint8_t& operator[](size_t idx); + const uint8_t& operator[](size_t idx) const; bool operator==(const binary_packet& from) const; bool operator!=(const binary_packet& from) const; @@ -26,12 +29,17 @@ virtual binary_packet& assign(const any_t* data,size_t len); virtual binary_packet& append(const any_t* data,size_t len); virtual binary_packet& append(const binary_packet& it); - virtual char& at(size_t idx); - virtual const char& at(size_t idx) const; - virtual char& front(); - virtual const char& front() const; - virtual char& back(); - virtual const char& back() const; + virtual binary_packet& insert(size_t pos,const any_t* data,size_t len); + virtual binary_packet& insert(size_t pos,const binary_packet& it); + virtual binary_packet& replace(size_t pos,const any_t* data,size_t len); + virtual binary_packet& replace(size_t pos,const binary_packet& it); + virtual binary_packet& remove(size_t pos,size_t n); + virtual uint8_t& at(size_t idx); + virtual const uint8_t& at(size_t idx) const; + virtual uint8_t& front(); + virtual const uint8_t& front() const; + virtual uint8_t& back(); + virtual const uint8_t& back() const; virtual binary_packet subpacket(size_t start,size_t length) const; @@ -41,11 +49,40 @@ virtual size_t size() const { return len; } virtual any_t* data() { return buffer; } virtual const any_t* data() const { return buffer; } - virtual char* cdata() { return (char*)buffer; } - virtual const char* cdata() const { return (char*)buffer; } + virtual uint8_t* cdata() { return (uint8_t*)buffer; } + virtual const uint8_t* cdata() const { return (uint8_t*)buffer; } private: any_t* buffer; size_t len; }; + + std::ostream& operator<<(std::ostream& os,const binary_packet&); + std::istream& operator>>(std::istream& is,binary_packet&); // use std::setw() or istream.width() before using this operator + + template<class T> + class objects_container : public binary_packet { + public: + objects_container(size_t sz):binary_packet(sz) {} + objects_container(const any_t* src,size_t sz):binary_packet(src,sz) {} + objects_container(const objects_container& from):binary_packet(from) {} + virtual ~objects_container() {} + + T& operator[](size_t idx) { + if((idx+1)*sizeof(T)<=size()) return ((T*)data())[idx]; + std::ostringstream os; + os<<"."<<get_caller_address()<<" => object_container["<<idx<<"]"; + throw std::out_of_range(os.str()); + } + + const T& operator[](size_t idx) const { + if((idx+1)*sizeof(T)<=size()) return ((const T*)data())[idx]; + std::ostringstream os; + os<<"."<<get_caller_address()<<" => object_container["<<idx<<"] const"; + throw std::out_of_range(os.str()); + } + + virtual T* tdata() { return (T*)data(); } + virtual const T* tdata() const { return (const T*)data(); } + }; } // namespace usr #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-06-14 21:51:07
|
Revision: 655 http://sourceforge.net/p/mplayerxp/code/655 Author: nickols_k Date: 2013-06-14 21:51:03 +0000 (Fri, 14 Jun 2013) Log Message: ----------- remove exit_player() + escape_player() and fix segfault in cfgparser.cpp Modified Paths: -------------- mplayerxp/input2/input.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libvo2/x11_system.cpp mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/postproc/postprocess.cpp mplayerxp/xmpcore/xmp_vdecoder.cpp Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/input2/input.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -1361,7 +1361,7 @@ static int mp_input_print_key_list(libinput_t& handle) { mp_input_print_keys(handle); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } void mp_input_print_binds(libinput_t& handle) { @@ -1407,7 +1407,7 @@ static int mp_input_print_cmd_list(libinput_t& handle) { mp_input_print_cmds(handle); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } MPXP_Rc mp_input_check_interrupt(libinput_t& handle,int tim) { Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -12,6 +12,7 @@ #include <limits> #include <iostream> #include <fstream> +#include <sstream> #include <stdexcept> #include <stdlib.h> @@ -268,7 +269,7 @@ break; case CONF_TYPE_PRINT: mpxp_info<<(char *)conf[i].p; - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); default: mpxp_err<<"read_option: Unknown config type specified in conf-mplayerxp.h!"<<std::endl; break; @@ -531,11 +532,11 @@ opt = argv[i]; if(opt=="--help") { show_help(); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } if(opt=="--long-help") { show_long_help(*this,envm); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } /* check for -- (no more options id.) except --help! */ if (opt[0] == '-' && opt[1] == '-') { @@ -774,19 +775,18 @@ for(n=0;n<ntabs;n++) mpxp_info<<" "; mpxp_info<<opts[i].help<<":"<<std::endl; pfxlen=strlen(opts[i].name)+1; - if(!pfx.empty()) pfxlen+=pfx.length(); - if(!pfx.empty()) newpfx=pfx; + if(!pfx.empty()) { pfxlen+=pfx.length(); newpfx=pfx; } else newpfx=""; newpfx+=opts[i].name; newpfx+="."; __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); - } - else - if(opts[i].type<=CONF_TYPE_PRINT) { + } else if(opts[i].type<=CONF_TYPE_PRINT) { + std::ostringstream os; for(n=0;n<ntabs;n++) mpxp_info<<" "; - if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; - else mpxp_info<<" "<<std::endl; - mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; + if(!pfx.empty()) os<<std::left<<pfx; + else os<<" "; + os<<opts[i].name; + mpxp_info<<std::left<<std::setw(25)<<os.str()<<" "<<opts[i].help; if((opts[i].flags&CONF_NOCFG)==0) { mpxp_info<<" {"<< (opts[i].type==CONF_TYPE_FLAG?"flg": @@ -803,7 +803,7 @@ break; case CONF_TYPE_STRING: { const char **defv = (const char**)(opts[i].p); - if(defv) mpxp_info<<"\""<<*defv<<"\""; + if(defv && *defv) mpxp_info<<"\""<<*defv<<"\""; } break; case CONF_TYPE_INT: { Modified: mplayerxp/libvo2/x11_system.cpp =================================================================== --- mplayerxp/libvo2/x11_system.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/libvo2/x11_system.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -41,7 +41,8 @@ mpxp_err<<"X11_System: "<<msg<<std::endl; mpxp_v<<"Type: "<<std::hex<<event->type<<", display: "<<std::hex<<event->display<<", resourceid: "<<std::hex<<event->resourceid<<", serial: "<<event->serial<<std::endl; mpxp_v<<"Error code: "<<std::hex<<event->error_code<<", request code: "<<std::hex<<event->request_code<<", minor code: "<<event->minor_code<<std::endl; - escape_player("X11_System error",mp_conf.max_trace); + show_backtrace("X11_System error",mp_conf.max_trace); + throw std::runtime_error("X11_System error"); return 0; } Modified: mplayerxp/main.cpp =================================================================== --- mplayerxp/main.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/main.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -362,26 +362,6 @@ MP_UNIT(NULL); } -class soft_exit_exception : public std::exception { - public: - soft_exit_exception(const std::string& why) throw(); - virtual ~soft_exit_exception() throw(); - - virtual const char* what() const throw(); - private: - std::string why; -}; - -soft_exit_exception::soft_exit_exception(const std::string& _why) throw() { why=_why; } -soft_exit_exception::~soft_exit_exception() throw() {} -const char* soft_exit_exception::what() const throw() { return why.c_str(); } - -void exit_player(const std::string& why) -{ - if(!why.empty()) throw soft_exit_exception(why); - throw std::exception(); -} - void __exit_sighandler() { static int sig_count=0; @@ -393,14 +373,14 @@ kill(getpid(),SIGKILL); return; } - exit_player(""); + throw std::exception(); } void exit_sighandler(void) { - xmp_killall_threads(pthread_self()); - __exit_sighandler(); + xmp_killall_threads(pthread_self()); + __exit_sighandler(); } // When libmpdemux perform a blocking operation (network connection or cache filling) @@ -413,7 +393,7 @@ switch(cmd->id) { case MP_CMD_QUIT: case MP_CMD_SOFT_QUIT: // should never happen - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); case MP_CMD_PLAY_TREE_STEP: { eof = (cmd->args[0].v.i > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; } break; @@ -1310,9 +1290,9 @@ osd_function=OSD_PAUSE; break; case MP_CMD_SOFT_QUIT : - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); case MP_CMD_QUIT : - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); case MP_CMD_PLAY_TREE_STEP : { int n = cmd->args[0].v.i > 0 ? 1 : -1; PlayTree_Iter* it = new PlayTree_Iter(*playtree_iter); @@ -1568,7 +1548,7 @@ if(filename.empty()){ show_help(); - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } // Many users forget to include command line in bugreports... Modified: mplayerxp/mplayerxp.h =================================================================== --- mplayerxp/mplayerxp.h 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/mplayerxp.h 2013-06-14 21:51:03 UTC (rev 655) @@ -205,21 +205,15 @@ extern pthread_mutex_t audio_timer_mutex; - void exit_player(const std::string& why); - /* 10 ms or 10'000 microsecs is optimal time for thread sleeping */ inline int yield_timeslice() { return ::usleep(10000); } - inline void escape_player(const std::string& why,unsigned num_calls) { - show_backtrace(why,num_calls); - throw std::runtime_error(why); - } - inline MPXP_Rc check_pin(const std::string& module,unsigned pin1,unsigned pin2) { if(pin1!=pin2) { std::string msg; msg=std::string("Found incorrect PIN in module: ")+module; - escape_player(msg,mp_conf.max_trace); + show_backtrace(msg,mp_conf.max_trace); + throw std::runtime_error(msg); } return MPXP_Ok; } Modified: mplayerxp/osdep/mplib.cpp =================================================================== --- mplayerxp/osdep/mplib.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/osdep/mplib.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -74,4 +74,8 @@ missing_driver_exception::missing_driver_exception() throw() {} missing_driver_exception::~missing_driver_exception() throw() {} const char* missing_driver_exception::what() const throw() { return "missing driver"; } + +soft_exit_exception::soft_exit_exception(const std::string& _why) throw() { why=_why; } +soft_exit_exception::~soft_exit_exception() throw() {} +const char* soft_exit_exception::what() const throw() { return why.c_str(); } } // namespace usr Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/osdep/mplib.h 2013-06-14 21:51:03 UTC (rev 655) @@ -65,5 +65,15 @@ virtual const char* what() const throw(); }; + + class soft_exit_exception : public std::exception { + public: + soft_exit_exception(const std::string& why) throw(); + virtual ~soft_exit_exception() throw(); + + virtual const char* what() const throw(); + private: + std::string why; + }; } // namespace usr #endif Modified: mplayerxp/postproc/postprocess.cpp =================================================================== --- mplayerxp/postproc/postprocess.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/postproc/postprocess.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -30,7 +30,7 @@ { if(strcmp(mp_conf.npp_options,"help")==0) { mpxp_info<<pp_help<<std::endl; - exit_player(MSGTR_Exit_quit); + throw soft_exit_exception(MSGTR_Exit_quit); } return 1; } Modified: mplayerxp/xmpcore/xmp_vdecoder.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vdecoder.cpp 2013-06-14 16:28:01 UTC (rev 654) +++ mplayerxp/xmpcore/xmp_vdecoder.cpp 2013-06-14 21:51:03 UTC (rev 655) @@ -192,7 +192,10 @@ if(cur_time - mpxp_context().seek_time > (mpxp_context().engine().xp_core->num_v_buffs/sh_video->fps)*100) xp_n_frame_to_drop=compute_frame_dropping(sh_video,frame->pts,drop_barrier); } /* if( mp_conf.frame_dropping ) */ if(!finite(frame->pts)) mpxp_warn<<"Bug of demuxer! Value of video pts="<<frame->pts<<std::endl; - if(frame->type!=VideoFrame) escape_player("VideoDecoder doesn't parse non video frames",mp_conf.max_trace); + if(frame->type!=VideoFrame) { + show_backtrace("VideoDecoder doesn't parse non video frames",mp_conf.max_trace); + throw std::runtime_error("VideoDecoder doesn't parse non video frames"); + } #if 0 /* We can't seriously examine question of too slow machines This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-06-14 16:28:06
|
Revision: 654 http://sourceforge.net/p/mplayerxp/code/654 Author: nickols_k Date: 2013-06-14 16:28:01 +0000 (Fri, 14 Jun 2013) Log Message: ----------- convert MGS_xxx into mpxp_xxx and add printing of caller address about illegal-patch ==================== ------------------------ 8< -------------------------- 8< --------------------------------- *** Antiviral protection was inited ***!!! MPlayerXP svn.653 2002 Nickols_K 2000-2002 Arpad Gereoffy (?\209?\129?\208?\188. DOCS!) Can't open input config file /root/.mplayerxp/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 [OSDEP.0x5a44f8]:CPU: Advanced Micro Devices (Type: 9, Stepping: 3) extended cpuid-level: 26 extended cache-info: 33587520 Detected cache-line size is 64 bytes cpudetect: MMX=1 MMX2=1 3DNow=1 3DNow2=1 SSE=1 SSE2=1 SSE3=1 SSSE3=0 SSE41=0 SSE42=0 AES=0 AVX=0 FMA=0 [PLAYER.0x467c67]:User corrected CPU flags: MMX=1 MMX2=1 3DNow=1 3DNow2=1 SSE=1 SSE2=1 SSE3=1 SSSE3=0 SSE41=0 SSE42=0 AES=0 AVX=0 FMA=0 mpxp_context().mplayer_accel=4160749568 Environment: HOME => /root LANG => ru_RU.UTF-8 LOGNAME => root MAIL => /var/mail/root PATH => /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl SHELL => /bin/bash SUDO_COMMAND => ./mplayerxp -vo fbdev -ao alsa /...path.../trassa e95.avi -v -v -v SUDO_GID => 1000 SUDO_UID => 1000 SUDO_USER => kas TERM => linux USER => root USERNAME => root CommandLine: '-vo' 'fbdev' '-ao' 'alsa' '/...path.../trassa e95.avi' '-v' '-v' '-v' [LIBVO.0x59439c]:font: can't open file: /root/.mplayerxp/font/font.desc font: can't open file: /usr/local/share/mplayerxp/font/font.desc [PLAYER.0x460f6f]:Menu init failed [LIBVO.0x59a858]:fbdev: using /dev/fb0 ?\208?\146?\208?\190?\209?\129?\208?\191?\209?\128?\208?\190?\208?\184?\208?\183?\208?\178?\208?\181?\208?\180?\208?\181?\208?\189?\208?\184?\208?\181 /...path.../trassa e95.avi [STREAM.0x47fecc]:Filename for url is now /...path.../trassa%20e95.avi Not an URL! [STREAM.0x473e98]:[Stream]: Opening *:// ... False [DEMUX.0x49de5d]:[Demuxer]: Probing RAW audio parser ...:False [Demuxer]: Probing RAW video parser ...:False [Demuxer]: Probing AVI - Audio Video Interleaved parser ...:Ok DEMUX.0x4b0bc4:LIST 'hdrl' len=8830 DEMUX.0x4b0c42:list_end=0x2292 DEMUX.0x4b0724:CHUNK 'avih' len=56 DEMUX.0x5036b5:======= AVI Header ======= us/frame: 40000 (fps=25.000) max bytes/sec: 0 padding: 0 DEMUX.0x5035ba:MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED DEMUX.0x50372b:frames total: 6198 initial: 0 streams: 2 Suggested BufferSize: 0 Size: 352 x 288 DEMUX.0x4b098a:list_end=0x2292 pos=0x58 chunksize=0x0 next=0x58 DEMUX.0x4b0bc4:LIST 'strl' len=4244 DEMUX.0x4b0c42:list_end=0x10F4 DEMUX.0x4b0724:CHUNK 'strh' len=56 [Demuxer]: ==> Found video stream: 0 [Demuxer]: ID_VIDEO_ID=0 DEMUX.0x5038f4:======= STREAM Header ======= Type: vids FCC: div3 (33766964) Flags: 0 Priority: 0 Language: 0 InitialFrames: 0 Rate: 25000/1000 = 25.000 Start: 0 Len: 6198 Suggested BufferSize: 21412 Quality 10000 Sample size: 0 DEMUX.0x4b098a:list_end=0x10F4 pos=0xA4 chunksize=0x0 next=0xA4 DEMUX.0x4b0724:CHUNK 'strf' len=40 DEMUX.0x4b270f:found 'bih', 40 bytes of 40 DEMUX.0x503e61:======= VIDEO Format (chunk size: 40 )====== biSize 40 biWidth 352 biHeight 288 biPlanes 1 biBitCount 24 biCompression 33564944='DIV3' biSizeImage 304128 biXPelPerMeter 0 biYPelPerMeter 0 biClrUsed 0 biClrIpmortant 0 DEMUX.0x503f1f:======= End of Video Format ======= DEMUX.0x4b2ca1:Regenerating keyframe table for DIVX 3 video DEMUX.0x4b098a:list_end=0x10F4 pos=0xD4 chunksize=0x0 next=0xD4 DEMUX.0x4b0724:CHUNK 'JUNK' len=4120 DEMUX.0x4b098a:list_end=0x10F4 pos=0x10F4 chunksize=0x0 next=0x10F4 DEMUX.0x4b0bc4:LIST 'strl' len=4234 DEMUX.0x4b0c42:list_end=0x2186 DEMUX.0x4b0724:CHUNK 'strh' len=56 DEMUX.0x4b28a3:avi: Found audio stream Demuxer: ==> Found audio stream: 1 Demuxer: ID_AUDIO_ID=1 DEMUX.0x5038f4:======= STREAM Header ======= Type: auds FCC: (0) Flags: 0 Priority: 0 Language: 0 InitialFrames: 1 Rate: 15963/1 = 15963.000 Start: 0 Len: 3957330 Suggested BufferSize: 7467 Quality -1 Sample size: 1 DEMUX.0x4b098a:list_end=0x2186 pos=0x1140 chunksize=0x0 next=0x1140 DEMUX.0x4b0724:CHUNK 'strf' len=30 DEMUX.0x4b1f36:found 'wf', 30 bytes of 18 DEMUX.0x503a16:======= WAVE Format (chunk size: 30 )======= Format Tag: 85 (0x55) Channels: 2 Samplerate: 44100 avg byte/sec: 15963 Block align: 1 bits/sample: 0 cbSize: 12 DEMUX.0x503af6:mp3.wID=1 mp3.fdwFlags=0x2 mp3.nBlockSize=417 mp3.nFramesPerBlock=1 mp3.nCodecDelay=1393 DEMUX.0x503a6e:======= End of WAVE Format ======= DEMUX.0x4b098a:list_end=0x2186 pos=0x1166 chunksize=0x0 next=0x1166 DEMUX.0x4b0724:CHUNK 'JUNK' len=4120 DEMUX.0x4b098a:list_end=0x2186 pos=0x2186 chunksize=0x0 next=0x2186 DEMUX.0x4b0bc4:LIST 'odml' len=260 DEMUX.0x4b0c42:list_end=0x2292 DEMUX.0x4b0724:CHUNK 'dmlh' len=248 DEMUX.0x4b2451:Found ODML header 248 frames 6198 DEMUX.0x4b098a:list_end=0x2292 pos=0x2292 chunksize=0x0 next=0x2292 DEMUX.0x4b0724:CHUNK 'JUNK' len=1382 DEMUX.0x4b098a:list_end=0x2292 pos=0x2800 chunksize=0x0 next=0x2800 DEMUX.0x4b0a0b:Broken chunk? chunksize=0 (id=JUNK) DEMUX.0x4b0724:CHUNK 'JUNK' len=1382 DEMUX.0x4b098a:list_end=0x0 pos=0x2800 chunksize=0x0 next=0x2800 DEMUX.0x4b0bc4:LIST 'movi' len=23710356 DEMUX.0x4b0c42:list_end=0x169F29C DEMUX.0x4b0ce7:Found movie at 0x280C - 0x169F29C DEMUX.0x4b0724:CHUNK 'idx1' len=198144 DEMUX.0x4b11ff:Reading INDEX block, 12384 chunks for 6198 frames DEMUX.0x504304: 0: 01wb 10 00000004 len: 7467 pos: 0-> 0.000 0-> 0.000 DEMUX.0x504304: 1: 00dc 10 00001D38 len: 556 pos: 0-> 0.000 0-> 0.000 DEMUX.0x504304: 2: 01wb 10 00001F6C len: 419 pos: 7467-> 0.398 1-> 0.042 DEMUX.0x504304: 3: 00dc 0 00002118 len: 106 pos: 556-> 0.030 1-> 0.042 DEMUX.0x504304: 4: 01wb 10 0000218A len: 825 pos: 7886-> 0.421 2-> 0.083 DEMUX.0x504304: 5: 00dc 0 000024CC len: 201 pos: 662-> 0.035 2-> 0.083 DEMUX.0x504304: 6: 01wb 10 0000259E len: 421 pos: 8711-> 0.465 3-> 0.125 DEMUX.0x504304: 7: 00dc 0 0000274C len: 256 pos: 863-> 0.046 3-> 0.125 DEMUX.0x504304: 8: 01wb 10 00002854 len: 841 pos: 9132-> 0.487 4-> 0.167 DEMUX.0x504304: 9: 00dc 0 00002BA6 len: 129 pos: 1119-> 0.060 4-> 0.167 DEMUX.0x504304: 10: 01wb 10 00002C30 len: 416 pos: 9973-> 0.532 5-> 0.209 DEMUX.0x504304: 11: 00dc 0 00002DD8 len: 211 pos: 1248-> 0.067 5-> 0.209 DEMUX.0x504304: 12: 01wb 10 00002EB4 len: 823 pos: 10389-> 0.554 6-> 0.250 DEMUX.0x504304: 13: 00dc 0 000031F4 len: 249 pos: 1459-> 0.078 6-> 0.250 DEMUX.0x504304: 14: 01wb 10 000032F6 len: 423 pos: 11212-> 0.598 7-> 0.292 DEMUX.0x504304: 15: 00dc 0 000034A6 len: 65 pos: 1708-> 0.091 7-> 0.292 DEMUX.0x504304: 16: 01wb 10 000034F0 len: 840 pos: 11635-> 0.621 8-> 0.334 DEMUX.0x504304: 17: 00dc 0 00003840 len: 53 pos: 1773-> 0.095 8-> 0.334 [snip]...[/snip] DEMUX.0x504304:12377: 00dc 0 0169C3B6 len: 320 pos:19646018->1047.955 6191->258.217 DEMUX.0x504304:12378: 00dc 0 0169C4FE len: 140 pos:19646338->1047.972 6192->258.258 DEMUX.0x504304:12379: 00dc 0 0169C592 len: 250 pos:19646478->1047.980 6193->258.300 DEMUX.0x504304:12380: 00dc 0 0169C694 len: 330 pos:19646728->1047.993 6194->258.342 DEMUX.0x504304:12381: 00dc 0 0169C7E6 len: 122 pos:19647058->1048.011 6195->258.383 DEMUX.0x504304:12382: 00dc 0 0169C868 len: 247 pos:19647180->1048.017 6196->258.425 DEMUX.0x504304:12383: 00dc 0 0169C968 len: 292 pos:19647427->1048.031 6197->258.467 DEMUX.0x4b098a:list_end=0x0 pos=0x16CF8A4 chunksize=0x0 next=0x16CF8A4 DEMUX.0x4b0724:CHUNK 'JUNK' len=1876 DEMUX.0x4b098a:list_end=0x0 pos=0x16D0000 chunksize=0x0 next=0x16D0000 DEMUX.0x4b3ff5:AVI index offset: 0x2808 (movi=0x280C idx0=0x4 idx1=0x1D38) DEMUX.0x4af6f0:Auto-selected AVI audio ID = 1 DEMUX.0x4af7ba:Auto-selected AVI video ID = 0 [DEMUX.0x4a1e6c]:ds_fill_buffer(d_video) called DEMUX.0x4afb43:demux_avi.read_packet: 62773130 DEMUX.0x4afbbd:DEMUX_AVI: Read 7467 data bytes from packet 62773130 [DEMUX.0x4a1811]:DEMUX: Append packet: len=7467 pts=0 pos=0 [_packs: A=1 V=0] ds_read_packet(7467,0,0,0) DEMUX.0x4aff5c:DEMUX_AVI: Skipping 1 bytes from packet 62773130 DEMUX.0x4afb43:demux_avi.read_packet: 63643030 DEMUX.0x4afbbd:DEMUX_AVI: Read 556 data bytes from packet 63643030 DEMUX: Append packet: len=556 pts=0 pos=1 [_packs: A=1 V=1] ds_read_packet(556,0,0,0) DEMUX.0x4b3c82:AVI: Searching for audio stream (id:1) ds_fill_buffer(d_audio) called DEMUX.0x4b403a:AVI video size=19647719 (6198) audio size=3957330 (3957330) DEMUX.0x4b3fcc:VIDEO: [DIV3] 352x288 24bpp 25.00 fps [DEMUX.0x49dcb3]:[Demuxer]: Using: AVI - Audio Video Interleaved parser [Stream]:Video=DIV3 Audio=00000055 [V] filefmt:6fourcc:0x33564944 size:160x120 fps:25 ftime:=0.04 [MPSUB.0x52f0d4]:SPU: Display only forced subs now disabled [GLOBAL.0x51a012]:[codec_ld] ?\208?\145?\208?\184?\208?\177?\208?\187?\208?\184?\208?\190?\209?\130?\208?\181?\208?\186?\208?\176 ?\208?\183?\208?\176?\208?\179?\209?\128?\209?\131?\208?\182?\208?\181?\208?\189?\208?\176 ?\209?\131?\209?\129?\208?\191?\208?\181?\209?\136?\208?\189?\208?\190:libmpg123.so [DEMUX.0x4a2a22]:initial_apts from: stream_pts=0 pts_bytes=7467 got_bytes=7467 i_bps=15963 initial_apts is: 0 [DECAUD.0x5190e1]:mpg123_init: MPEG-1.0 [Layer:III (CBR)], Hz=44100 128-kbit Joint-Stereo, BPF=417 Out=32-bit mpg123_init: Copyrght=No Orig=Yes CRC=No Priv=No Emphas=0 Optimiz=x86-64 [DECAUD.0x509a24]:Probing: mp3libok Driver: mp3lib supports these outfmt for 00000055 100000 10 0 [OSDEP.0x5a52f7]:Using SSE2 optimized memcpy [OSDEP.0x5a54a7]:fast_memcpy(0x33f5ae0, 0x7fff3a4d9718, 64) [cl_size=64] [DECAUD.0x50a3d4]:dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer [DECAUD.0x50a527]:[AC] Selecting drv:mp3lib.libmpg123.so ratio 15963->352800 [LIBAO.0x549376]:alsa-init: compiled for ALSA-1.0.27.1 alsa-init: got device=0, subdevice=0 [LIBAO.0x549516]:alsa-init: Testing & bugs are welcome. Found 1 cards, use: hw:0,0 alsa-init: pcm opend in block-mode [LIBAO.0x549996]:snd_pcm_hw_params_any() snd_pcm_hw_params_set_access(SND_PCM_ACCESS_RW_INTERLEAVED) Initializing audio codec... AUDIO: srate=ac44 chans=2 bps=4 sfmt=0x100000 ratio: 3e5b->0 [POSTPR.0x54f7de]:vo2(NULL, NULL) [DECVID.0x50908c]:Probing: raw failed Probing: nuv failed Probing: mpeg2 failed Probing: xvid failed Probing: mpegpes failed Probing: huffyuv failed Probing: theora failed Probing: libdv failed Probing: lavc [DECVID.0x50ee0f]:libavcodec.size: 352 x 288 [DECVID.0x50f083]:Using 4 threads in lavc INFO: libavcodec.so (0) video codec[DIV3] init OK! [DECVID.0x506ec6]:VDec: vo config request - 352 x 288 [LIBVO.0x590370]:dri_vo_dbg: vo_query_format(00000000) [LIBVO.0x590480]:dri_vo: request for Unknown 0x0000 fourcc: 0 [POSTPR.0x57ae17]:[vf_vo2] 0=query_format(Unknown 0x0000) vf_vo2->config(352,288,352,288,4,Unknown 0x0000) dri_vo_dbg: vo_config priv.video_out->config(352,288,352,288, 0x4,'MPlayerXP',Unknown 0x0000) fbdev: Can't set graphics mode: Inappropriate ioctl for device [LIBVO.0x59bb1c]:fbdev: var info: fbdev: xres: 1920 fbdev: yres: 1200 fbdev: xres_virtual: 1920 fbdev: yres_virtual: 1200 fbdev: xoffset: 0 fbdev: yoffset: 0 fbdev: bits_per_pixel: 32 fbdev: grayscale: 0 fbdev: red: 16 8 0 fbdev: green: 8 8 0 fbdev: blue: 0 8 0 fbdev: transp: 24 8 0 fbdev: nonstd: 0 fbdev: activate: 0 fbdev: height: 4294967295 fbdev: width: 4294967295 fbdev: accel_flags: 1 fbdev: timing: fbdev: pixclock: 0 fbdev: left_margin: 0 fbdev: right_margin: 0 fbdev: upper_margin: 0 fbdev: lower_margin: 0 fbdev: hsync_len: 0 fbdev: vsync_len: 0 fbdev: sync: 0 fbdev: vmode: 0 fbdev: fix info: fbdev: framebuffer size: 9216000 bytes fbdev: type: 0 fbdev: type_aux: 0 fbdev: visual: 2 fbdev: line_length: 7680 bytes fbdev: id: radeondrmfb fbdev: smem_start: 0xc0142000 fbdev: xpanstep: 1 fbdev: ypanstep: 1 fbdev: ywrapstep: 0 fbdev: mmio_start: 0 fbdev: mmio_len: 0 bytes fbdev: accel: 0 fbdev: priv.bpp: 32 fbdev: priv.real_bpp: 24 fbdev: priv.pixel_size: 4 bytes fbdev: other: fbdev: priv.in_width: 352 fbdev: priv.in_height: 288 fbdev: priv.out_width: 352 fbdev: priv.out_height: 288 fbdev: priv.last_row: 816 fbdev: frame_buffer @ 7f5515842000 fbdev: L123123875 @ 7f5515b99c40 fbdev: pixel per line: 1920 fbdev: vt_set_textarea(330,4b0): 34,4b [stream: vf_reinit_vo] Call vf_reinit_vo <vo2: 352x288@Unknown 0x0000> -> <vo: 352x288@BGRA> vf->first: 352x288@Unknown 0x0000 [352x288@Unknown 0x0000](NULL<-vo2->NULL) Using(first:vo2) 352x288@Unknown 0x0000 vf_reinit->config_vf 352 288 Unknown 0x0000=> 352 288 BGRA Open video filter: [fmtcvt] <352x288 Unknown 0x0000> [POSTPR.0x575564]:SwScale params: -1 x -1 (-1=no scaling) dri_vo_dbg: vo_query_format(51343434) dri_vo: request for Planar 444P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit little-endian) [POSTPR.0x5736ba]:scale: query(Planar 444P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34343451) dri_vo: request for Planar 444P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit big-endian) scale: query(Planar 444P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51323234) dri_vo: request for Planar 422P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit little-endian) scale: query(Planar 422P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323251) dri_vo: request for Planar 422P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit big-endian) scale: query(Planar 422P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51303234) dri_vo: request for Planar 420P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit little-endian) scale: query(Planar 420P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323051) dri_vo: request for Planar 420P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit big-endian) scale: query(Planar 420P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(41303234) dri_vo: request for Planar YV12 with alpha fourcc: 0 [vf_vo2] 0=query_format(Planar YV12 with alpha) scale: query(Planar YV12 with alpha) -> 0 dri_vo_dbg: vo_query_format(50343434) dri_vo: request for Planar 444P fourcc: 0 [vf_vo2] 0=query_format(Planar 444P) scale: query(Planar 444P) -> 0 dri_vo_dbg: vo_query_format(50323234) dri_vo: request for Planar 422P fourcc: 0 [vf_vo2] 0=query_format(Planar 422P) scale: query(Planar 422P) -> 0 dri_vo_dbg: vo_query_format(32315659) dri_vo: request for Planar YV12 fourcc: 0 [vf_vo2] 0=query_format(Planar YV12) scale: query(Planar YV12) -> 0 dri_vo_dbg: vo_query_format(30323449) dri_vo: request for Planar I420 fourcc: 0 [vf_vo2] 0=query_format(Planar I420) scale: query(Planar I420) -> 0 dri_vo_dbg: vo_query_format(56555949) dri_vo: request for Planar IYUV fourcc: 0 [vf_vo2] 0=query_format(Planar IYUV) scale: query(Planar IYUV) -> 0 dri_vo_dbg: vo_query_format(39555659) dri_vo: request for Planar YVU9 fourcc: 0 [vf_vo2] 0=query_format(Planar YVU9) scale: query(Planar YVU9) -> 0 dri_vo_dbg: vo_query_format(39304649) dri_vo: request for Planar IF09 fourcc: 0 [vf_vo2] 0=query_format(Planar IF09) scale: query(Planar IF09) -> 0 dri_vo_dbg: vo_query_format(50313134) dri_vo: request for Planar 411P fourcc: 0 [vf_vo2] 0=query_format(Planar 411P) scale: query(Planar 411P) -> 0 dri_vo_dbg: vo_query_format(32595559) dri_vo: request for Packed YUY2 fourcc: 0 [vf_vo2] 0=query_format(Packed YUY2) scale: query(Packed YUY2) -> 0 dri_vo_dbg: vo_query_format(59565955) dri_vo: request for Packed UYVY fourcc: 0 [vf_vo2] 0=query_format(Packed UYVY) scale: query(Packed UYVY) -> 0 dri_vo_dbg: vo_query_format(52474230) dri_vo: request for RGB 48-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 48-bit) scale: query(RGB 48-bit) -> 0 dri_vo_dbg: vo_query_format(524742b0) dri_vo: request for BGR 48-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 48-bit) scale: query(BGR 48-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) scale: query(BGRA) -> 1 dri_vo_dbg: vo_query_format(52474220) dri_vo: request for RGBA fourcc: 0 [vf_vo2] 0=query_format(RGBA) scale: query(RGBA) -> 0 dri_vo_dbg: vo_query_format(42475218) dri_vo: request for BGR 24-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 24-bit) scale: query(BGR 24-bit) -> 0 dri_vo_dbg: vo_query_format(52474218) dri_vo: request for RGB 24-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 24-bit) scale: query(RGB 24-bit) -> 0 dri_vo_dbg: vo_query_format(42475210) dri_vo: request for BGR 16-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 16-bit) scale: query(BGR 16-bit) -> 0 dri_vo_dbg: vo_query_format(52474210) dri_vo: request for RGB 16-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 16-bit) scale: query(RGB 16-bit) -> 0 dri_vo_dbg: vo_query_format(4247520f) dri_vo: request for BGR 15-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 15-bit) scale: query(BGR 15-bit) -> 0 dri_vo_dbg: vo_query_format(5247420f) dri_vo: request for RGB 15-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 15-bit) scale: query(RGB 15-bit) -> 0 dri_vo_dbg: vo_query_format(30303859) dri_vo: request for Planar Y800 fourcc: 0 [vf_vo2] 0=query_format(Planar Y800) scale: query(Planar Y800) -> 0 dri_vo_dbg: vo_query_format(20203859) dri_vo: request for Planar Y8 fourcc: 0 [vf_vo2] 0=query_format(Planar Y8) scale: query(Planar Y8) -> 0 dri_vo_dbg: vo_query_format(42475208) dri_vo: request for BGR 8-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 8-bit) scale: query(BGR 8-bit) -> 0 dri_vo_dbg: vo_query_format(52474208) dri_vo: request for RGB 8-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 8-bit) scale: query(RGB 8-bit) -> 0 dri_vo_dbg: vo_query_format(42475204) dri_vo: request for BGR 4-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit) scale: query(BGR 4-bit) -> 0 dri_vo_dbg: vo_query_format(52474204) dri_vo: request for RGB 4-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit) scale: query(RGB 4-bit) -> 0 dri_vo_dbg: vo_query_format(42475284) dri_vo: request for BGR 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit per byte) scale: query(BGR 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(52474284) dri_vo: request for RGB 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit per byte) scale: query(RGB 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(42475201) dri_vo: request for BGR 1-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 1-bit) scale: query(BGR 1-bit) -> 0 dri_vo_dbg: vo_query_format(52474201) dri_vo: request for RGB 1-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 1-bit) scale: query(RGB 1-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) vf_scale: 1025=vf_next_query_format(42475220,160,120); vf_scale: sws_getFlagsAndFilterFromCmdLine(...); vf_scale: sws_getContext(160, 120, Unknown 0x0000, 160, 120, BGRA, e0001004); [swscaler @ 0x4d267c0] (null) is not supported as input pixel format [POSTPR.0x5748bf]:Couldn't init SwScaler for this setup [POSTPR.0x55024f]:FATAL: ?\208?\157?\208?\181 ?\208?\188?\208?\190?\208?\179?\209?\131 ?\208?\191?\209?\128?\208?\190?\208?\184?\208?\189?\208?\184?\209?\134?\208?\184?\208?\176?\208?\187?\208?\184?\208?\183?\208?\184?\209?\128?\208?\190?\208?\178?\208?\176?\209?\130?\209?\140 ?\208?\178?\208?\184?\208?\180?\208?\181?\208?\190 ?\208?\180?\209?\128?\208?\176?\208?\185?\208?\178?\208?\181?\209?\128! vf->first: 352x288@Unknown 0x0000 [352x288@Unknown 0x0000](fmtcvt<-vo2->NULL) dri_vo_caps: driver does support DRI dri_vo_caps: caps=00000000 fourcc=42475220(BGRA) x,y,w,h(0 0 160 120) dri_vo_caps: width,height(160,120) strides(580000) priv.dri.bpp=20 dri_vo_src: w,h(160,120) d_w,d_h(160,120 dri_vo_src: flags=00000004 fourcc=00000000(Unknown 0x0000) dri_vo_dbg: vo_query_format(30323449) dri_vo: request for Planar I420 fourcc: 0 [vf_vo2] 0=query_format(Planar I420) [DECVID.0x5072e7]:vo_debug[step i=0]: query(Planar I420 352x288) returned 0x0 for: [POSTPR.0x54cf00]:[libvf] Using video filters chain: [POSTPR.0x57b671]:VO-CONF: [fbdev] 352x288 => 352x288 Unknown 0x0000 [zoom] [POSTPR.0x57b7e8]:VO: Description: Framebuffer Device VO: Author: Szabolcs Berecz <sz...@in...> [DECVID.0x506fd6]:Can't find colorspace for: 'Planar I420' Trying -vf fmtcvt... Open video filter: [fmtcvt] <352x288 Planar I420> SwScale params: -1 x -1 (-1=no scaling) [POSTPR.0x573fb2]:vf_scale: query_format(30323449(Planar I420), 160, 120 dri_vo_dbg: vo_query_format(51343434) dri_vo: request for Planar 444P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit little-endian) scale: query(Planar 444P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34343451) dri_vo: request for Planar 444P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit big-endian) scale: query(Planar 444P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51323234) dri_vo: request for Planar 422P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit little-endian) scale: query(Planar 422P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323251) dri_vo: request for Planar 422P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit big-endian) scale: query(Planar 422P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51303234) dri_vo: request for Planar 420P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit little-endian) scale: query(Planar 420P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323051) dri_vo: request for Planar 420P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit big-endian) scale: query(Planar 420P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(41303234) dri_vo: request for Planar YV12 with alpha fourcc: 0 [vf_vo2] 0=query_format(Planar YV12 with alpha) scale: query(Planar YV12 with alpha) -> 0 dri_vo_dbg: vo_query_format(50343434) dri_vo: request for Planar 444P fourcc: 0 [vf_vo2] 0=query_format(Planar 444P) scale: query(Planar 444P) -> 0 dri_vo_dbg: vo_query_format(50323234) dri_vo: request for Planar 422P fourcc: 0 [vf_vo2] 0=query_format(Planar 422P) scale: query(Planar 422P) -> 0 dri_vo_dbg: vo_query_format(32315659) dri_vo: request for Planar YV12 fourcc: 0 [vf_vo2] 0=query_format(Planar YV12) scale: query(Planar YV12) -> 0 dri_vo_dbg: vo_query_format(30323449) dri_vo: request for Planar I420 fourcc: 0 [vf_vo2] 0=query_format(Planar I420) scale: query(Planar I420) -> 0 dri_vo_dbg: vo_query_format(56555949) dri_vo: request for Planar IYUV fourcc: 0 [vf_vo2] 0=query_format(Planar IYUV) scale: query(Planar IYUV) -> 0 dri_vo_dbg: vo_query_format(39555659) dri_vo: request for Planar YVU9 fourcc: 0 [vf_vo2] 0=query_format(Planar YVU9) scale: query(Planar YVU9) -> 0 dri_vo_dbg: vo_query_format(39304649) dri_vo: request for Planar IF09 fourcc: 0 [vf_vo2] 0=query_format(Planar IF09) scale: query(Planar IF09) -> 0 dri_vo_dbg: vo_query_format(50313134) dri_vo: request for Planar 411P fourcc: 0 [vf_vo2] 0=query_format(Planar 411P) scale: query(Planar 411P) -> 0 dri_vo_dbg: vo_query_format(32595559) dri_vo: request for Packed YUY2 fourcc: 0 [vf_vo2] 0=query_format(Packed YUY2) scale: query(Packed YUY2) -> 0 dri_vo_dbg: vo_query_format(59565955) dri_vo: request for Packed UYVY fourcc: 0 [vf_vo2] 0=query_format(Packed UYVY) scale: query(Packed UYVY) -> 0 dri_vo_dbg: vo_query_format(52474230) dri_vo: request for RGB 48-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 48-bit) scale: query(RGB 48-bit) -> 0 dri_vo_dbg: vo_query_format(524742b0) dri_vo: request for BGR 48-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 48-bit) scale: query(BGR 48-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) scale: query(BGRA) -> 1 dri_vo_dbg: vo_query_format(52474220) dri_vo: request for RGBA fourcc: 0 [vf_vo2] 0=query_format(RGBA) scale: query(RGBA) -> 0 dri_vo_dbg: vo_query_format(42475218) dri_vo: request for BGR 24-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 24-bit) scale: query(BGR 24-bit) -> 0 dri_vo_dbg: vo_query_format(52474218) dri_vo: request for RGB 24-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 24-bit) scale: query(RGB 24-bit) -> 0 dri_vo_dbg: vo_query_format(42475210) dri_vo: request for BGR 16-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 16-bit) scale: query(BGR 16-bit) -> 0 dri_vo_dbg: vo_query_format(52474210) dri_vo: request for RGB 16-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 16-bit) scale: query(RGB 16-bit) -> 0 dri_vo_dbg: vo_query_format(4247520f) dri_vo: request for BGR 15-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 15-bit) scale: query(BGR 15-bit) -> 0 dri_vo_dbg: vo_query_format(5247420f) dri_vo: request for RGB 15-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 15-bit) scale: query(RGB 15-bit) -> 0 dri_vo_dbg: vo_query_format(30303859) dri_vo: request for Planar Y800 fourcc: 0 [vf_vo2] 0=query_format(Planar Y800) scale: query(Planar Y800) -> 0 dri_vo_dbg: vo_query_format(20203859) dri_vo: request for Planar Y8 fourcc: 0 [vf_vo2] 0=query_format(Planar Y8) scale: query(Planar Y8) -> 0 dri_vo_dbg: vo_query_format(42475208) dri_vo: request for BGR 8-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 8-bit) scale: query(BGR 8-bit) -> 0 dri_vo_dbg: vo_query_format(52474208) dri_vo: request for RGB 8-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 8-bit) scale: query(RGB 8-bit) -> 0 dri_vo_dbg: vo_query_format(42475204) dri_vo: request for BGR 4-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit) scale: query(BGR 4-bit) -> 0 dri_vo_dbg: vo_query_format(52474204) dri_vo: request for RGB 4-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit) scale: query(RGB 4-bit) -> 0 dri_vo_dbg: vo_query_format(42475284) dri_vo: request for BGR 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit per byte) scale: query(BGR 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(52474284) dri_vo: request for RGB 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit per byte) scale: query(RGB 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(42475201) dri_vo: request for BGR 1-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 1-bit) scale: query(BGR 1-bit) -> 0 dri_vo_dbg: vo_query_format(52474201) dri_vo: request for RGB 1-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 1-bit) scale: query(RGB 1-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) [sw_scale] BGRA supported on vo2 like 401 [sw_scale] returning: 441 vo_debug[step i=0]: query(Planar I420 160x120) returned 0x441 for: [libvf] Using video filters chain: [POSTPR.0x573c4e]:[vf_fmtcvt]: video[0x0] in[Unknown 0x0000] -> out[Unknown 0x0000] VO-CONF: [fbdev] 352x288 => 352x288 Unknown 0x0000 [zoom] VO: Description: Framebuffer Device VO: Author: Szabolcs Berecz <sz...@in...> ------------------------ 8< -------------------------- 8< --------------------------------- let detect some addresses! [OSDEP.0x5a44f8] $addr2line -s -e mplayerxp 0x5a44f8 cpudetect.cpp:101 [PLAYER.0x467c67] main.cpp:466 [LIBVO.0x59439c] font_load.cpp:64 [STREAM.0x47fecc] url.cpp:50 DEMUX.0x5036b5:======= AVI Header ======= basic_string.h:293 DEMUX.0x5038f4:======= STREAM Header ======= basic_string.h:293 DEMUX.0x504304: basic_string.h:293 let investigate address DEMUX.0x504304 with beye! ------------------------ 8< -------------------------- 8< --------------------------------- Current position information File offset: 104304H Virt. address: 504304H Prev. entry: _Z11print_indexP13AVIINDEXEBTRYi Next. entry: _Z23print_avistdindex_chunkP18_avistdindex_chunk Curr. object: #13 CODE USE64 A840H=7350B4H .text ; ;Disassembler dump of 'mplayerxp' ;Range : 1041D7H- 10442DH ;Written by Binary Viewer v 6.1.0-x86_64.Linux64 Build: Feb 6 2012 ;Dumped : Fri Jun 14 17:19:56 2013 ;Format : ELF (Executable and Linking Format) SEGMENT .text BYTE PUBLIC USE64 'CODE' ; size: 7514228 bytes public _Z18print_video_headerP16BITMAPINFOHEADERj: ; ... L001041D7: nop ax,[rax+rax+00000000] ; 660F1F840000000000 public _Z11print_indexP13AVIINDEXENTRYi: L001041E0: push r15 ; 4157 L001041E2: xor eax,eax ; 31C0 L001041E4: push r14 ; 4156 L001041E6: push r13 ; 4155 L001041E8: push r12 ; 4154 L001041EA: push rbp ; 55 L001041EB: push rbx ; 53 L001041EC: sub rsp,+00000858 ; 4881EC58080000 L001041F3: mov [rsp+24],esi ; 89742424 L001041F7: nop ax,[rax+rax+00000000] ; 660F1F840000000000 L00104200: mov (d) [rax+rsp+50],00000000 ; C744045000000000 L00104208: mov (d) [rax+rsp+00000450],00000000; C784045004000000000000 L00104213: add (q) rax,+04 ; 4883C004 L00104217: cmp rax,00000400 ; 483D00040000 L0010421D: jne L00104200 ; 75E1 L0010421F: mov esi,[rsp+24] ; 8B742424 L00104223: test esi,esi ; 85F6 L00104225: jle L0010433C ; 0F8E11010000 L0010422B: mov rbx,rdi ; 4889FB L0010422E: xor r12d,r12d ; 4531E4 L00104231: nop eax,[cs:rax+rax+00000000] ; 6666666666662E0F1F840000000000 L00104240: mov edi,[rbx] ; 8B3B L00104242: calln _Z13avi_stream_idj ; E859C3FAFF L00104247: mov ecx,000000FF ; B9FF000000 L0010424C: cmp eax,00000100 ; 3D00010000 L00104251: mov r9d,[rbx+08] ; 448B4B08 L00104255: mov r8d,[rbx+04] ; 448B4304 L00104259: cmovnc eax,ecx ; 0F43C1 L0010425C: lea rdx,[rsp+3E] ; 488D54243E L00104261: mov esi,00B52F20 ; ->"%5d: %.4s %4X %08X len:%6d pos:%7d->%7.3f %7d->%7.3f" ; BE202FB500 L00104266: movsxd rbp,rax ; 4863E8 L00104269: lea rdi,[rsp+40] ; 488D7C2440 L0010426E: mov r15d,[rbx+0C] ; 448B7B0C L00104272: mov [rsp+20],r9d ; 44894C2420 L00104277: mov [rsp+1C],r8d ; 448944241C L0010427C: mov r13d,[rbp*4+rsp+00000450] ; 448BACAC50040000 L00104284: mov r14d,[rbp*4+rsp+50] ; 448B74AC50 L00104289: calln *_ZNSsC1EPKcRKSaIcE ; E81259F0FF L0010428E: mov ecx,[rip+00AF8DC4] ; 8B0DC48DAF00 L00104294: mov r8d,[rsp+1C] ; 448B44241C L00104299: mov r9d,[rsp+20] ; 448B4C2420 L0010429E: test ecx,ecx ; 85C9 L001042A0: je L00104304 ; 7462 L001042A2: mov eax,r13d ; 4489E8 L001042A5: mov [rsp+10],r13d ; 44896C2410 L001042AA: mov [rsp+08],r14d ; 4489742408 L001042AF: mov [rsp+28],rax ; 4889442428 L001042B4: mov eax,r14d ; 4489F0 L001042B7: mov [rsp],r15d ; 44893C24 L001042BB: cvtsi2ss xmm1,[rsp+28] ; F3480F2A4C2428 L001042C2: mov [rsp+28],rax ; 4889442428 L001042C7: cvtsi2ss xmm0,[rsp+28] ; F3480F2A442428 L001042CE: mov rcx,rbx ; 4889D9 L001042D1: mov edx,r12d ; 4489E2 L001042D4: lea rsi,[rsp+40] ; 488D742440 L001042D9: mov edi,70000010 ; BF10000070 L001042DE: mov eax,00000002 ; B802000000 L001042E3: divss xmm1,[rip+0064F095] ; F30F5E0D95F06400 L001042EB: divss xmm0,[rip+0064F091] ; ->"A" ; F30F5E0591F06400 L001042F3: unpcklps xmm1,xmm1 ; 0F14C9 L001042F6: cvtps2pd xmm1,xmm1 ; 0F5AC9 L001042F9: unpcklps xmm0,xmm0 ; 0F14C0 L001042FC: cvtps2pd xmm0,xmm0 ; 0F5AC0 L001042FF: calln _ZN3usr11mpxp_printfEjRKSsz; E89CB8F6FF L00104304: mov rax,[rsp+40] ; 488B442440 L00104309: lea rdi,[rax-18] ; 488D78E8 L0010430D: cmp rdi,00FFC040 ; 4881FF40C0FF00 L00104314: jne L0010434E ; 7538 L00104316: add r14d,[rbx+0C] ; 4403730C L0010431A: inc r13d ; 41FFC5 L0010431D: inc r12d ; 41FFC4 L00104320: add (q) rbx,+10 ; 4883C310 L00104324: cmp r12d,[rsp+24] ; 443B642424 L00104329: mov [rbp*4+rsp+00000450],r13d ; 4489ACAC50040000 L00104331: mov [rbp*4+rsp+50],r14d ; 448974AC50 L00104336: jne L00104240 ; 0F8504FFFFFF L0010433C: add rsp,+00000858 ; 4881C458080000 L00104343: pop rbx ; 5B L00104344: pop rbp ; 5D L00104345: pop r12 ; 415C L00104347: pop r13 ; 415D L00104349: pop r14 ; 415E L0010434B: pop r15 ; 415F L0010434D: retn ; C3 L0010434E: mov ecx,0040A430 ; B930A44000 L00104353: lea rdx,[rdi+10] ; 488D5710 L00104357: test rcx,rcx ; 4885C9 L0010435A: je L00104393 ; 7437 L0010435C: mov eax,FFFFFFFF ; B8FFFFFFFF L00104361: lock; xadd [rdx],eax ; F00FC102 L00104365: test eax,eax ; 85C0 L00104367: jg L00104316 ; 7FAD L00104369: lea rsi,[rsp+3F] ; 488D74243F L0010436E: calln *_ZNSs4_Rep10_M_destroyERKSaIcE; E8AD53F0FF L00104373: jmps L00104316 ; EBA1 L00104375: mov rbx,rax ; 4889C3 L00104378: mov rax,[rsp+40] ; 488B442440 L0010437D: lea rsi,[rsp+3F] ; 488D74243F L00104382: lea rdi,[rax-18] ; 488D78E8 L00104386: calln *_ZNSs4_Rep10_M_disposeERKSaIcE; E89550F0FF L0010438B: mov rdi,rbx ; 4889DF L0010438E: calln *_Unwind_Resume ; E8BD61F0FF L00104393: mov edx,[rax-08] ; 8B50F8 L00104396: lea ecx,[rdx-01] ; 8D4AFF L00104399: mov [rax-08],ecx ; 8948F8 L0010439C: mov eax,edx ; 89D0 L0010439E: jmps L00104365 ; EBC5 public _Z23print_avistdindex_chunkP18_avistdindex_chunk: L001043A0: push r15 ; 4157 L001043A2: mov esi,00B52F60 ; ->"====== AVI Standard Index Header ========" ; BE602FB500 L001043A7: push r14 ; 4156 L001043A9: push r13 ; 4155 L001043AB: push r12 ; 4154 L001043AD: push rbp ; 55 L001043AE: mov rbp,rdi ; 4889FD L001043B1: push rbx ; 53 L001043B2: sub (q) rsp,+58 ; 'X' ; 4883EC58 L001043B6: movzx eax,[rdi+0A] ; 0FB6470A L001043BA: mov ecx,[rdi+04] ; 8B4F04 L001043BD: mov r15d,[rdi+1C] ; 448B7F1C L001043C1: mov r14,[rdi+14] ; 4C8B7714 L001043C5: lea rdx,[rsp+3E] ; 488D54243E L001043CA: mov r13d,[rdi+0C] ; 448B6F0C L001043CE: movzx r12d,[rdi+0B] ; 440FB6670B L001043D3: movzx ebx,[rdi+08] ; 0FB75F08 L001043D7: lea rdi,[rsp+40] ; 488D7C2440 L001043DC: mov [rsp+28],ecx ; 894C2428 L001043E0: mov [rsp+2F],al ; 8844242F L001043E4: calln *_ZNSsC1EPKcRKSaIcE ; E8B757F0FF L001043E9: mov edi,[rip+00AF8C69] ; 8B3D698CAF00 L001043EF: mov ecx,[rsp+28] ; 8B4C2428 L001043F3: test edi,edi ; 85FF L001043F5: je L00104431 ; 743A L001043F7: movzx r9d,[rsp+2F] ; 440FB64C242F L001043FD: lea rdx,[rbp+10] ; 488D5510 L00104401: mov [rsp+20],r15d ; 44897C2420 L00104406: mov [rsp+10],rdx ; 4889542410 L0010440B: mov [rsp+18],r14 ; 4C89742418 L00104410: movzx r8d,bx ; 440FB7C3 L00104414: mov [rsp+08],r13d ; 44896C2408 L00104419: mov [rsp],r12d ; 44892424 L0010441D: mov rdx,rbp ; 4889EA L00104420: lea rsi,[rsp+40] ; 488D742440 L00104425: mov edi,70000010 ; BF10000070 L0010442A: xor eax,eax ; 31C0 L0010442C: calln _ZN3usr11mpxp_printfEjRKSsz; E86FB7F6FF ------------------------ 8< -------------------------- 8< --------------------------------- this tells me that malefactor damaged addr2line utility on my development computer. Revision Links: -------------- http://sourceforge.net/p/mplayerxp/code/15 http://sourceforge.net/p/mplayerxp/code/14 http://sourceforge.net/p/mplayerxp/code/13 http://sourceforge.net/p/mplayerxp/code/12 http://sourceforge.net/p/mplayerxp/code/12 http://sourceforge.net/p/mplayerxp/code/13 http://sourceforge.net/p/mplayerxp/code/14 http://sourceforge.net/p/mplayerxp/code/15 http://sourceforge.net/p/mplayerxp/code/15 http://sourceforge.net/p/mplayerxp/code/14 http://sourceforge.net/p/mplayerxp/code/13 http://sourceforge.net/p/mplayerxp/code/12 http://sourceforge.net/p/mplayerxp/code/14 http://sourceforge.net/p/mplayerxp/code/14 Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/input2/input.cpp mplayerxp/libao3/ao_sdl.cpp mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/libdca/parse.cpp mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpdemux/demux_ts.cpp mplayerxp/libmpstream2/cookies.cpp mplayerxp/libmpstream2/librtsp/rtsp_rtp.cpp mplayerxp/libmpstream2/network_asf.cpp mplayerxp/libmpstream2/s_tv.cpp mplayerxp/libmpstream2/tvi/tvi_bsdbt848.cpp mplayerxp/libmpstream2/tvi/tvi_dummy.cpp mplayerxp/libmpstream2/tvi/tvi_v4l.cpp mplayerxp/libmpsub/find_sub.cpp mplayerxp/libmpsub/spudec.cpp mplayerxp/libmpsub/subreader.cpp mplayerxp/libmpsub/vobsub.cpp mplayerxp/libvo2/jpeg_enc.cpp mplayerxp/libvo2/screenshot.cpp mplayerxp/libvo2/screenshot.h mplayerxp/libvo2/sub.cpp mplayerxp/libvo2/video_out.cpp mplayerxp/libvo2/video_out.h mplayerxp/libvo2/vo_fbdev.cpp mplayerxp/libvo2/vo_sdl.cpp mplayerxp/libvo2/vo_vesa.cpp mplayerxp/main.cpp mplayerxp/mpxp_msg.cpp mplayerxp/mpxp_msg.h mplayerxp/nls/mpxp_help-en.h mplayerxp/nls/mpxp_help-ru.h mplayerxp/postproc/af.cpp mplayerxp/postproc/af_ao3.cpp mplayerxp/postproc/af_channels.cpp mplayerxp/postproc/af_crystality.cpp mplayerxp/postproc/af_delay.cpp mplayerxp/postproc/af_dyn.cpp mplayerxp/postproc/af_echo3d.cpp mplayerxp/postproc/af_equalizer.cpp mplayerxp/postproc/af_extrastereo.cpp mplayerxp/postproc/af_ffenc.cpp mplayerxp/postproc/af_format.cpp mplayerxp/postproc/af_hrtf.cpp mplayerxp/postproc/af_lp.cpp mplayerxp/postproc/af_pan.cpp mplayerxp/postproc/af_raw.cpp mplayerxp/postproc/af_resample.cpp mplayerxp/postproc/af_scaletempo.cpp mplayerxp/postproc/af_sinesuppress.cpp mplayerxp/postproc/af_sub.cpp mplayerxp/postproc/af_surround.cpp mplayerxp/postproc/af_tools.cpp mplayerxp/postproc/af_volnorm.cpp mplayerxp/postproc/af_volume.cpp mplayerxp/postproc/libmenu/menu_filesel.cpp mplayerxp/postproc/postprocess.cpp mplayerxp/postproc/vf.cpp mplayerxp/postproc/vf_1bpp.cpp mplayerxp/postproc/vf_delogo.cpp mplayerxp/postproc/vf_dint.cpp mplayerxp/postproc/vf_eq.cpp mplayerxp/postproc/vf_format.cpp mplayerxp/postproc/vf_framestep.cpp mplayerxp/postproc/vf_menu.cpp mplayerxp/postproc/vf_mirror.cpp mplayerxp/postproc/vf_palette.cpp mplayerxp/postproc/vf_panscan.cpp mplayerxp/postproc/vf_raw.cpp mplayerxp/postproc/vf_rectangle.cpp mplayerxp/postproc/vf_rotate.cpp mplayerxp/postproc/vf_scale.cpp mplayerxp/postproc/vf_softpulldown.cpp mplayerxp/postproc/vf_test.cpp mplayerxp/postproc/vf_unsharp.cpp mplayerxp/postproc/vf_yuy2.cpp mplayerxp/postproc/vf_yvu9.cpp Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/dump.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -5,6 +5,7 @@ dump.c - stream dumper */ #include <iostream> +#include <sstream> #include <fstream> #include <stdexcept> @@ -59,10 +60,10 @@ name=buf; f.open(name,std::ios_base::out|std::ios_base::binary); if(!f.is_open()){ - MSG_FATAL(MSGTR_CantOpenDumpfile); + mpxp_fatal<<MSGTR_CantOpenDumpfile<<"!!!"<<std::endl; throw std::runtime_error(MSGTR_Fatal_error); } - MSG_INFO("Dumping stream to %s\n",name); + mpxp_info<<"Dumping stream to "<<name<<std::endl; while(!stream->eof()){ binary_packet bp=stream->read(4096); if(bp.size()>0) f.write(bp.cdata(),bp.size()); @@ -139,17 +140,17 @@ else if(strcmp(media,"mpxp") == 0) strcat(stream_dump_name,"dump.mpxp"); else if(strcmp(media,"raw") == 0) strcat(stream_dump_name,"dump.raw"); else { - MSG_FATAL("Unsupported muxer format %s found\n",media); + mpxp_fatal<<"Unsupported muxer format "<<media<<" found"<<std::endl; throw std::runtime_error(MSGTR_Fatal_error); } priv->mux_file.open(stream_dump_name,std::ios_base::out|std::ios_base::binary); - MSG_DBG2("Preparing stream dumping: %s\n",stream_dump_name); + mpxp_dbg2<<"Preparing stream dumping: "<<stream_dump_name<<std::endl; if(!priv->mux_file.is_open()){ - MSG_FATAL(MSGTR_CantOpenDumpfile); + mpxp_fatal<<MSGTR_CantOpenDumpfile<<"!!!"<<std::endl; throw std::runtime_error(MSGTR_Fatal_error); } if(!(priv->muxer=muxer_new_muxer(media,port,priv->mux_file))) { - MSG_FATAL("Can't initialize muxer\n"); + mpxp_fatal<<"Can't initialize muxer"<<std::endl; throw std::runtime_error(MSGTR_Fatal_error); } if(sha && (priv->mux_type&MUX_HAVE_AUDIO)) { @@ -158,7 +159,7 @@ priv->m_audio->source=sha; priv->m_audio->codec=0; if(!sha->wf) { - sha->wf=(WAVEFORMATEX*)mp_malloc(sizeof(WAVEFORMATEX)); + sha->wf=new(zeromem) WAVEFORMATEX; sha->wf->nBlockAlign = 1; //mux_a->h.dwSampleSize; sha->wf->wFormatTag = sha->wtag; sha->wf->nChannels = sha->nch; @@ -194,7 +195,7 @@ priv->m_video->h.dwRate=priv->m_video->h.dwScale*shv->fps; priv->m_video->h.dwSuggestedBufferSize=shv->video.dwSuggestedBufferSize; if(!shv->bih) { - shv->bih=(BITMAPINFOHEADER*)mp_malloc(sizeof(BITMAPINFOHEADER)); + shv->bih=new(zeromem) BITMAPINFOHEADER; shv->bih->biSize=sizeof(BITMAPINFOHEADER); shv->bih->biWidth=shv->src_w; shv->bih->biHeight=shv->src_h; @@ -215,8 +216,8 @@ priv->m_subs->source=NULL; priv->m_subs->codec=0; } else priv->m_subs=NULL; - MSG_DBG2("Opening dump: %X\n",demuxer); - MSG_INFO("Dumping stream to %s\n",stream_dump_name); + mpxp_dbg2<<"Opening dump: "<<std::hex<<demuxer<<std::endl; + mpxp_info<<"Dumping stream to "<<stream_dump_name<<std::endl; muxer_fix_parameters(priv->muxer); muxer_write_header(priv->muxer,demuxer); } @@ -229,16 +230,13 @@ sh_audio_t* sha=reinterpret_cast<sh_audio_t*>(d_audio->sh); sh_video_t* shv=reinterpret_cast<sh_video_t*>(d_video->sh); if(priv) { - MSG_DBG2("Closing dump: %X %f secs\n" - "As video %X-%ix%i audio %X-%ix%ix%i\n" - ,demuxer,shv?priv->vtimer:sha->timer - ,priv->m_video?priv->m_video->bih->biCompression:-1 - ,priv->m_video?priv->m_video->bih->biWidth:-1 - ,priv->m_video?priv->m_video->bih->biHeight:-1 - ,priv->m_audio?priv->m_audio->wf->wFormatTag:-1 - ,priv->m_audio?priv->m_audio->wf->nSamplesPerSec:-1 - ,priv->m_audio?priv->m_audio->wf->wBitsPerSample:-1 - ,priv->m_audio?priv->m_audio->wf->nChannels:-1); + mpxp_dbg2<<"Closing dump: "<<(shv?priv->vtimer:sha->timer)<<" secs"<<std::endl; + mpxp_dbg2<<"As video "<<std::hex<<(priv->m_video?priv->m_video->bih->biCompression:-1) + <<"-"<<(priv->m_video?priv->m_video->bih->biWidth:-1)<<"x" + <<(priv->m_video?priv->m_video->bih->biHeight:-1)<<" audio " + <<(priv->m_audio?priv->m_audio->wf->wFormatTag:-1)<<"-" + <<(priv->m_audio?priv->m_audio->wf->nSamplesPerSec:-1) + <<"x"<<(priv->m_audio?priv->m_audio->wf->wBitsPerSample:-1)<<"x"<<(priv->m_audio?priv->m_audio->wf->nChannels:-1)<<std::endl; if(shv && (priv->mux_type&MUX_HAVE_VIDEO)) priv->m_video->source=shv; if(sha && (priv->mux_type&MUX_HAVE_AUDIO)) priv->m_audio->source=sha; muxer_write_index(priv->muxer); @@ -248,28 +246,20 @@ if(priv->m_video) { priv->m_video->h.dwRate=priv->m_video->h.dwScale*shv->fps; priv->m_video->h.dwSuggestedBufferSize=priv->vsize/priv->decoded_frameno; - MSG_V("Finishing vstream as: scale %u rate %u fps %f (frames=%u timer=%f)\n" - ,priv->m_video->h.dwScale - ,priv->m_video->h.dwRate - ,shv->fps - ,priv->decoded_frameno - ,priv->vtimer+priv->timer_corr); + mpxp_v<<"Finishing vstream as: scale "<<priv->m_video->h.dwScale<<" rate "<<priv->m_video->h.dwRate + <<" fps "<<shv->fps<<" (frames="<<priv->decoded_frameno<<" timer="<<priv->vtimer+priv->timer_corr<<")"<<std::endl; } } if(sha) { if(priv->m_audio) { priv->m_audio->h.dwSuggestedBufferSize=priv->asize/priv->a_frameno; - MSG_V("Finishing astream as: scale %u rate %u (frames=%u timer=%f) avg=%i size=%u\n" - ,priv->m_audio->h.dwScale - ,priv->m_audio->h.dwRate - ,priv->a_frameno - ,sha->timer+priv->timer_corr - ,priv->m_audio->wf->nAvgBytesPerSec - ,priv->asize); + mpxp_v<<"Finishing astream as: scale "<<priv->m_audio->h.dwScale<<" rate "<<priv->m_audio->h.dwRate + <<" (frames="<<priv->a_frameno<<" timer="<<sha->timer+priv->timer_corr + <<") avg="<<priv->m_audio->wf->nAvgBytesPerSec<<" size="<<priv->asize<<std::endl; } } if(demuxer->sub->sh) { - if(priv->m_subs) MSG_V("Finishing sstream as\n"); + if(priv->m_subs) mpxp_v<<"Finishing sstream as"<<std::endl; } priv->mux_file.seekp(0,std::ios_base::beg); muxer_write_header(priv->muxer,demuxer); @@ -297,47 +287,67 @@ MP_UNIT("dump"); priv->my_use_pts=use_pts; /* test stream property */ - MSG_INFO("%s using PTS method\n",use_pts?"":"not"); + mpxp_info<<(use_pts?"":"not")<<" using PTS method"<<std::endl; if(priv->m_video) { - if(!shv) { MSG_ERR("Video not found!!!Skip this stream\n"); return; } - if(!shv->bih) { MSG_ERR("Video property not found!!!Skip this stream\n"); return; } + if(!shv) { mpxp_err<<"Video not found!!!Skip this stream"<<std::endl; return; } + if(!shv->bih) { mpxp_err<<"Video property not found!!!Skip this stream"<<std::endl; return; } if(memcmp(shv->bih,priv->m_video->bih,sizeof(BITMAPINFOHEADER))!=0) { - MSG_ERR("Found different video properties(%X-%ix%i)!=(%X-%ix%i)!!!\nSkip this stream\n", - shv->bih->biCompression,shv->bih->biWidth,shv->bih->biHeight, - priv->m_video->bih->biCompression,priv->m_video->bih->biWidth, - priv->m_video->bih->biHeight); + mpxp_err<<"Found different video properties("<<std::hex<<shv->bih->biCompression + <<"-"<<shv->bih->biWidth<<"x"<<shv->bih->biHeight<<")!=("<<std::hex<<priv->m_video->bih->biCompression + <<"-"<<priv->m_video->bih->biWidth<<"x"<<priv->m_video->bih->biHeight<<")!!!"<<std::endl; + mpxp_err<<"Skip this stream"<<std::endl; return; } priv->m_video->source=shv; } if(priv->m_audio) { - if(!sha) { MSG_ERR("Audio not found!!!Skip this stream\n"); return; } - if(!sha->wf) { MSG_ERR("Audio property not found!!!Skip this stream\n"); return; } + if(!sha) { mpxp_err<<"Audio not found!!! Skip this stream"<<std::endl; return; } + if(!sha->wf) { mpxp_err<<"Audio property not found!!! Skip this stream"<<std::endl; return; } if(memcmp(sha->wf,priv->m_audio->wf,sizeof(WAVEFORMATEX))!=0) { - MSG_ERR("Found different audio properties(%X-%ix%ix%i)!=(%X-%ix%ix%i)X!!!\nSkip this stream\n", - sha->wf->wFormatTag,sha->wf->nSamplesPerSec,sha->wf->wBitsPerSample,sha->wf->nChannels, - priv->m_audio->wf->wFormatTag,priv->m_audio->wf->nSamplesPerSec, - priv->m_audio->wf->wBitsPerSample,priv->m_audio->wf->nChannels); + mpxp_err<<"Found different audio properties("<<std::hex<<sha->wf->wFormatTag + <<"-"<<sha->wf->nSamplesPerSec<<"x"<<sha->wf->wBitsPerSample<<"x"<<sha->wf->nChannels + <<")!=("<<std::hex<<priv->m_audio->wf->wFormatTag<<"-"<<priv->m_audio->wf->nSamplesPerSec + <<"x"<<priv->m_audio->wf->wBitsPerSample<<"x"<<priv->m_audio->wf->nChannels + <<")X!!!"<<std::endl; + mpxp_err<<"Skip this stream"<<std::endl; return; } priv->m_audio->source=sha; } if (seek_to_sec) { - float d; - float rel_seek_secs=0; - seek_args_t seek_p = { 0, 1}; - int a,b; - if (sscanf(seek_to_sec, "%d:%d:%f", &a,&b,&d)==3) - rel_seek_secs += 3600*a +60*b +d ; - else if (sscanf(seek_to_sec, "%d:%f", &a, &d)==2) - rel_seek_secs += 60*a +d; - else if (sscanf(seek_to_sec, "%f", &d)==1) - rel_seek_secs += d; + int a,b; + float d; + char c; + int ok=1; + float rel_seek_secs=0; + seek_args_t seek_p = { 0, 1}; + std::istringstream iss(seek_to_sec); - seek_to_sec = NULL; - MSG_INFO("seeking to %u seconds\n"); - seek_p.secs=rel_seek_secs; - demux_seek_r(*demuxer,&seek_p); + iss>>a; iss>>c; + if(!iss.good() || c!=':') ok=0; + iss>>b; iss>>c; + if(!iss.good() || c!=':') ok=0; + iss>>d; + if(!iss.good()) ok=0; + if (ok) rel_seek_secs += 3600*a +60*b +d ; + else { + ok=1; + iss.str(seek_to_sec); + iss>>a; iss>>c; + if(!iss.good() || c!=':') ok=0; + iss>>b; + if(!iss.good()) ok=0; + if (ok) rel_seek_secs += 60*a +d; + else { + iss.str(mp_conf.seek_to_sec); + iss>>d; + if (iss.good()) rel_seek_secs += d; + } + } + seek_to_sec = NULL; + mpxp_info<<"seeking to "<<rel_seek_secs<<" seconds"<<std::endl; + seek_p.secs=rel_seek_secs; + demux_seek_r(*demuxer,&seek_p); } aeof=sha?0:1; veof=shv?0:1; @@ -364,14 +374,14 @@ } if(use_pts) sha->timer=a_pts; else sha->timer=mpeg_atimer; - MSG_V("Got audio frame: %f %u\n",a_pts,(!aeof)?priv->a_frameno:-1); + mpxp_v<<"Got audio frame: "<<a_pts<<" "<<((!aeof)?priv->a_frameno:-1)<<std::endl; aeof=sha->ds->eof; priv->a_frameno++; if(aeof) break; if(priv->m_audio) { priv->m_audio->buffer=start; if(in_size>0) { - MSG_V("put audio: %f %f %u\n",a_pts,sha->timer+priv->timer_corr,in_size); + mpxp_v<<"put audio: "<<a_pts<<" "<<(sha->timer+priv->timer_corr)<<" "<<in_size<<std::endl; if(priv->m_audio) muxer_write_chunk(priv->m_audio,in_size,priv->m_video?0:AVIIF_KEYFRAME,sha->timer+priv->timer_corr); } @@ -396,15 +406,15 @@ else priv->vtimer=mpeg_vtimer; ++priv->decoded_frameno; veof=shv->ds->eof; - MSG_V("Got video frame %f %i\n",v_pts,(!veof)?priv->decoded_frameno:-1); + mpxp_v<<"Got video frame "<<v_pts<<" "<<((!veof)?priv->decoded_frameno:-1)<<std::endl; if(priv->m_video) priv->m_video->buffer=start; if(in_size>0) { - MSG_V("put video: %f %f %u flg=%u\n",v_pts,priv->vtimer+priv->timer_corr,in_size,shv->ds->flags); + mpxp_v<<"put video: "<<v_pts<<" "<<(priv->vtimer+priv->timer_corr)<<" "<<in_size<<" flg="<<shv->ds->flags<<std::endl; if(priv->m_video) muxer_write_chunk(priv->m_video,in_size,(shv->ds->flags&1)?AVIIF_KEYFRAME:0,priv->vtimer+priv->timer_corr); priv->vsize += in_size; } if(!(priv->decoded_frameno%100)) - MSG_STATUS("Done %u frames\r",priv->decoded_frameno); + mpxp_status<<"Done "<<priv->decoded_frameno<<" frames\r"; } if(demuxer->sub->sh) { float s_pts=0; @@ -415,11 +425,11 @@ cmd = check_cmd(priv); if(cmd == -1) goto done; else - MSG_V("Got sub frame: %f\n",s_pts); + mpxp_v<<"Got sub frame: "<<s_pts<<std::endl; if(priv->m_subs) { priv->m_subs->buffer=start; if(in_size>0) { - MSG_V("put subs: %f %u\n",s_pts,in_size); + mpxp_v<<"put subs: "<<s_pts<<" "<<in_size<<std::endl; if(priv->m_subs) muxer_write_chunk(priv->m_subs,in_size,priv->m_video?0:AVIIF_KEYFRAME,s_pts); } @@ -435,17 +445,11 @@ if(priv->m_audio->wf->nAvgBytesPerSec) priv->timer_corr+=((float)d_audio->tell_pts())/((float)priv->m_audio->wf->nAvgBytesPerSec); } - MSG_STATUS("Done %u frames (video(%X-%ix%i): %llu bytes audio(%X-%ix%ix%i): %llu bytes)\n" - ,priv->decoded_frameno - ,priv->m_video?priv->m_video->bih->biCompression:-1 - ,priv->m_video?priv->m_video->bih->biWidth:-1 - ,priv->m_video?priv->m_video->bih->biHeight:-1 - ,priv->vsize - ,priv->m_audio?priv->m_audio->wf->wFormatTag:-1 - ,priv->m_audio?priv->m_audio->wf->nSamplesPerSec:-1 - ,priv->m_audio?priv->m_audio->wf->wBitsPerSample:-1 - ,priv->m_audio?priv->m_audio->wf->nChannels:-1 - ,priv->asize); + mpxp_status<<"Done "<<priv->decoded_frameno<<" frames (video("<<std::hex<<(priv->m_video?priv->m_video->bih->biCompression:-1) + <<"-"<<(priv->m_video?priv->m_video->bih->biWidth:-1)<<"x"<<(priv->m_video?priv->m_video->bih->biHeight:-1) + <<"): "<<priv->vsize<<" bytes audio("<<std::hex<<(priv->m_audio?priv->m_audio->wf->wFormatTag:-1) + <<"-"<<(priv->m_audio?priv->m_audio->wf->nSamplesPerSec:-1)<<"x"<<(priv->m_audio?priv->m_audio->wf->wBitsPerSample:-1) + <<"x"<<(priv->m_audio?priv->m_audio->wf->nChannels:-1)<<"): "<<priv->asize<<" bytes)"<<std::endl; } } // namespace usr Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/input2/input.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -548,7 +548,7 @@ cmd_def = &mp_cmds[i]; - cmd = (mp_cmd_t*)mp_malloc(sizeof(mp_cmd_t)); + cmd = new mp_cmd_t; cmd->id = cmd_def->id; cmd->name = mp_strdup(cmd_def->name); @@ -605,7 +605,7 @@ break; } else if(!e) e = ptr+strlen(ptr); l = e-start; - cmd->args[i].v.s = (char*)mp_malloc((l+1)*sizeof(char)); + cmd->args[i].v.s = new char[l+1]; strncpy(cmd->args[i].v.s,start,l); cmd->args[i].v.s[l] = '\0'; ptr2 = start; @@ -662,7 +662,7 @@ // Allocate the buffer if it dont exist if(!mp_fd->buffer) { - mp_fd->buffer = (char*)mp_malloc(MP_CMD_MAX_SIZE*sizeof(char)); + mp_fd->buffer = new char[MP_CMD_MAX_SIZE]; mp_fd->pos = 0; mp_fd->size = MP_CMD_MAX_SIZE; } @@ -711,7 +711,7 @@ l = end - mp_fd->buffer; // Not dropping : put the cmd in ret if( ! (mp_fd->flags & MP_FD_DROP)) { - (*ret) = (char*)mp_malloc((l+1)*sizeof(char)); + (*ret) = new char[l+1]; strncpy((*ret),mp_fd->buffer,l); (*ret)[l] = '\0'; } else { // Remove the dropping flag Modified: mplayerxp/libao3/ao_sdl.cpp =================================================================== --- mplayerxp/libao3/ao_sdl.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/libao3/ao_sdl.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -128,15 +128,13 @@ /* setenv is missing on solaris and HPUX */ static void setenv(const char *name, const char *val, int _xx) { - int len = strlen(name) + strlen(val) + 2; - char *env = mp_malloc(len); + int len = strlen(name) + strlen(val) + 2; + char *env = new char [len]; - if (env != NULL) { strcpy(env, name); strcat(env, "="); strcat(env, val); putenv(env); - } } #endif Modified: mplayerxp/libmpcodecs/dec_audio.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -69,7 +69,7 @@ sh.o_bps=0; priv.mpadec=ai->query_interface(sh,priv.afi,sh.wtag); } catch(const bad_format_exception&) { - MSG_ERR(MSGTR_CODEC_BAD_AFAMILY,ac, afm); + mpxp_err<<MSGTR_CODEC_BAD_AFAMILY<<" "<<ac<<" ("<<afm<<")"<<std::endl; goto bye; } } @@ -119,7 +119,7 @@ sh.a_buffer=new char [sh.a_buffer_size]; if(!sh.a_buffer) { - MSG_ERR(MSGTR_CantAllocAudioBuf); + mpxp_err<<MSGTR_CantAllocAudioBuf<<std::endl; goto bye; } sh.a_buffer_len=0; @@ -127,7 +127,7 @@ if(!sh.nch || !sh.rate) { mpxp_v<<"audio format wrong: nch="<<sh.nch<<" rate="<<sh.rate<<std::endl; - MSG_WARN(MSGTR_UnknownAudio); + mpxp_warn<<MSGTR_UnknownAudio<<std::endl; goto bye; } @@ -137,7 +137,7 @@ static int warned=0; if(!warned) { warned=1; - MSG_WARN(MSGTR_CODEC_INITAL_AV_RESYNC); + mpxp_warn<<MSGTR_CODEC_INITIAL_AV_RESYNC<<std::endl; } } else if(mpxp_context().engine().xp_core->initial_apts_corr.need_correction==1) { mpxp_context().engine().xp_core->initial_apts += ((float)(mpxp_context().engine().xp_core->initial_apts_corr.pts_bytes-mpxp_context().engine().xp_core->initial_apts_corr.nbytes))/(float)sh.i_bps; @@ -291,7 +291,7 @@ if(!sh.inited) return 0; // no codec - if(minlen>maxlen) MSG_WARN(MSGTR_CODEC_XP_INT_ERR,minlen,maxlen); + if(minlen>maxlen) mpxp_warn<<MSGTR_CODEC_XP_INT_ERR<<": "<<minlen<<">"<<maxlen<<std::endl; if(sh.af_buffer_len) { cp_size=std::min(buflen,sh.af_buffer_len); memcpy(buf,sh.af_buffer,cp_size); @@ -309,7 +309,7 @@ if(sh.af_bps>sh.o_bps) maxlen=std::min(maxlen,buflen*sh.o_bps/sh.af_bps); len=priv.mpadec->run(buf, minlen, maxlen,pts); - if(len>buflen) MSG_WARN(MSGTR_CODEC_BUF_OVERFLOW,sh.codec->driver_name,len,buflen); + if(len>buflen) mpxp_warn<<"["<<sh.codec->driver_name<<"] "<<MSGTR_CODEC_BUF_OVERFLOW<<":"<<len<<">"<<buflen<<std::endl; mpxp_dbg2<<"decaudio: "<<len<<" bytes "<<pts<<" pts min "<<minlen<<" max "<<maxlen<<" buflen "<<buflen<<" o_bps="<<sh.o_bps<<" f_bps="<<sh.af_bps<<std::endl; if(len==0 || !priv.afi.afilter) return 0; // EOF? // run the filters: Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -161,7 +161,7 @@ try{ priv.mpvdec=vi->query_interface(*this,sh,priv.psi,sh.fourcc); } catch(const bad_format_exception&) { - MSG_ERR(MSGTR_CODEC_CANT_INITV); + mpxp_err<<MSGTR_CODEC_CANT_INITV<<std::endl; delete priv.mpvdec; goto bye; } @@ -376,7 +376,7 @@ sh.src_w,sh.src_h, mpxp_context().video().output->flags, out_fmt)==0){ - MSG_WARN(MSGTR_CannotInitVO); + mpxp_warn<<MSGTR_CannotInitVO<<std::endl; priv.vfilter_inited=-1; return MPXP_False; } @@ -438,7 +438,7 @@ // Remove the scale filter if we added it ourself if(strcmp(vf_get_first_name(s),"fmtcvt")==0) vf_remove_first(s); } - MSG_WARN(MSGTR_VOincompCodec); + mpxp_warn<<MSGTR_VOincompCodec<<std::endl; priv.vfilter_inited=-1; return MPXP_False; // failed } @@ -512,7 +512,7 @@ screen_size_x,screen_size_y, mpxp_context().video().output->flags, out_fmt)==0){ - MSG_WARN(MSGTR_CannotInitVO); + mpxp_warn<<MSGTR_CannotInitVO<<std::endl; priv.vfilter_inited=-1; return MPXP_False; } Modified: mplayerxp/libmpcodecs/libdca/parse.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/parse.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/libmpcodecs/libdca/parse.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -65,20 +65,11 @@ dca_state_t * state; int i; - state = (dca_state_t *) mp_malloc (sizeof (dca_state_t)); - if (state == NULL) - return NULL; + state = new(zeromem) dca_state_t; - memset (state, 0, sizeof(dca_state_t)); - state->samples = new(alignmem,16) sample_t[256 * 12]; - if (state->samples == NULL) { - delete state; - return NULL; - } - for (i = 0; i < 256 * 12; i++) - state->samples[i] = 0; + for (i = 0; i < 256 * 12; i++) state->samples[i] = 0; /* Pre-calculate cosine modulation coefficients */ pre_calc_cosmod( state ); Modified: mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -52,7 +52,7 @@ { #ifdef KEEP_BUFFER if (!previous_buffer) - previous_buffer = ( unsigned char * ) mp_malloc ( width * height + ( width * height ) / 2 ); + previous_buffer = new unsigned char[width * height + ( width * height ) / 2]; #endif if (((encodedh->comptype == '2') || @@ -77,7 +77,7 @@ break; case '2': /* RTJpeg with LZO */ if (!buffer) - buffer = ( unsigned char * ) mp_malloc ( width * height + ( width * height ) / 2 ); + buffer = new unsigned char[width * height + ( width * height ) / 2]; if (!buffer) { printf ( "Error decompressing\n" ); Modified: mplayerxp/libmpcodecs/vd_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_lavc.cpp 2013-06-12 14:05:09 UTC (rev 653) +++ mplayerxp/libmpcodecs/vd_lavc.cpp 2013-06-14 16:28:01 UTC (rev 654) @@ -234,14 +234,14 @@ } lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh.codec->dll_name); if(!lavc_codec){ - MSG_V(MSGTR_MissingLAVCcodec,sh.codec->dll_name); + mpxp_v<<MSGTR_MissingLAVCcodec<<sh.codec->dll_name<<std::endl; throw bad_format_exception(); } ctx = avcodec_alloc_context3(lavc_codec); lavc_picture = avcodec_alloc_frame(); if(!(ctx && lavc_picture)) { - MSG_ERR(MSGTR_OutOfMemory); + mpxp_err<<MSGTR_OutOfMemory<<std::endl; throw std::bad_a... [truncated message content] |
From: <nic...@us...> - 2013-06-12 14:05:13
|
Revision: 653 http://sourceforge.net/p/mplayerxp/code/653 Author: nickols_k Date: 2013-06-12 14:05:09 +0000 (Wed, 12 Jun 2013) Log Message: ----------- contantization Modified Paths: -------------- mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpdemux/demux_ac3.cpp mplayerxp/libmpdemux/demux_aiff.cpp mplayerxp/libmpdemux/demux_asf.cpp mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demux_bmp.cpp mplayerxp/libmpdemux/demux_dca.cpp mplayerxp/libmpdemux/demux_film.cpp mplayerxp/libmpdemux/demux_flac.cpp mplayerxp/libmpdemux/demux_fli.cpp mplayerxp/libmpdemux/demux_mkv.cpp mplayerxp/libmpdemux/demux_mov.cpp mplayerxp/libmpdemux/demux_mp3.cpp mplayerxp/libmpdemux/demux_mpg.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpdemux/demux_musepack.cpp mplayerxp/libmpdemux/demux_nsv.cpp mplayerxp/libmpdemux/demux_ogg.cpp mplayerxp/libmpdemux/demux_pva.cpp mplayerxp/libmpdemux/demux_real.cpp mplayerxp/libmpdemux/demux_realaud.cpp mplayerxp/libmpdemux/demux_roq.cpp mplayerxp/libmpdemux/demux_smjpeg.cpp mplayerxp/libmpdemux/demux_snd_au.cpp mplayerxp/libmpdemux/demux_ts.cpp mplayerxp/libmpdemux/demux_viv.cpp mplayerxp/libmpdemux/demux_voc.cpp mplayerxp/libmpdemux/demux_vqf.cpp mplayerxp/libmpdemux/demux_wav.cpp mplayerxp/libmpdemux/demux_y4m.cpp mplayerxp/libmpdemux/parse_mp4.cpp mplayerxp/libmpstream2/s_oss.cpp mplayerxp/libmpstream2/stream.cpp mplayerxp/libmpstream2/stream.h mplayerxp/libmpsub/vobsub.cpp mplayerxp/libvo2/osd_render.cpp mplayerxp/libvo2/osd_render_template.h mplayerxp/libvo2/video_out.cpp mplayerxp/libvo2/video_out.h mplayerxp/osdep/aclib_template.h mplayerxp/osdep/mplib.h mplayerxp/osdep/vbelib.cpp mplayerxp/postproc/af.cpp mplayerxp/postproc/af.h mplayerxp/postproc/af_ao3.cpp mplayerxp/postproc/af_channels.cpp mplayerxp/postproc/af_crystality.cpp mplayerxp/postproc/af_delay.cpp mplayerxp/postproc/af_dyn.cpp mplayerxp/postproc/af_echo3d.cpp mplayerxp/postproc/af_equalizer.cpp mplayerxp/postproc/af_export.cpp mplayerxp/postproc/af_extrastereo.cpp mplayerxp/postproc/af_ffenc.cpp mplayerxp/postproc/af_format.cpp mplayerxp/postproc/af_hrtf.cpp mplayerxp/postproc/af_internal.h mplayerxp/postproc/af_karaoke.cpp mplayerxp/postproc/af_lp.cpp mplayerxp/postproc/af_pan.cpp mplayerxp/postproc/af_raw.cpp mplayerxp/postproc/af_resample.cpp mplayerxp/postproc/af_scaletempo.cpp mplayerxp/postproc/af_sinesuppress.cpp mplayerxp/postproc/af_sub.cpp mplayerxp/postproc/af_surround.cpp mplayerxp/postproc/af_volnorm.cpp mplayerxp/postproc/af_volume.cpp mplayerxp/postproc/aflib.cpp mplayerxp/postproc/aflib.h mplayerxp/postproc/aflib_accel.h mplayerxp/postproc/libmenu/menu.cpp mplayerxp/postproc/libmenu/menu.h mplayerxp/postproc/libmenu/menu_console.cpp mplayerxp/postproc/libmenu/menu_list.cpp mplayerxp/postproc/libmenu/menu_list.h mplayerxp/postproc/libmenu/menu_txt.cpp mplayerxp/postproc/vf.cpp mplayerxp/postproc/vf.h mplayerxp/postproc/vf_1bpp.cpp mplayerxp/postproc/vf_2xsai.cpp mplayerxp/postproc/vf_delogo.cpp mplayerxp/postproc/vf_denoise3d.cpp mplayerxp/postproc/vf_dint.cpp mplayerxp/postproc/vf_down3dright.cpp mplayerxp/postproc/vf_eq.cpp mplayerxp/postproc/vf_expand.cpp mplayerxp/postproc/vf_flip.cpp mplayerxp/postproc/vf_framestep.cpp mplayerxp/postproc/vf_il.cpp mplayerxp/postproc/vf_internal.h mplayerxp/postproc/vf_menu.cpp mplayerxp/postproc/vf_mirror.cpp mplayerxp/postproc/vf_noise.cpp mplayerxp/postproc/vf_ow.cpp mplayerxp/postproc/vf_palette.cpp mplayerxp/postproc/vf_panscan.cpp mplayerxp/postproc/vf_perspective.cpp mplayerxp/postproc/vf_pp.cpp mplayerxp/postproc/vf_raw.cpp mplayerxp/postproc/vf_rectangle.cpp mplayerxp/postproc/vf_rgb2bgr.cpp mplayerxp/postproc/vf_rotate.cpp mplayerxp/postproc/vf_scale.cpp mplayerxp/postproc/vf_smartblur.cpp mplayerxp/postproc/vf_softpulldown.cpp mplayerxp/postproc/vf_swapuv.cpp mplayerxp/postproc/vf_test.cpp mplayerxp/postproc/vf_unsharp.cpp mplayerxp/postproc/vf_vo2.cpp mplayerxp/postproc/vf_yuvcsp.cpp mplayerxp/postproc/vf_yuy2.cpp mplayerxp/postproc/vf_yvu9.cpp mplayerxp/xmpcore/xmp_aframe.cpp mplayerxp/xmpcore/xmp_aframe.h mplayerxp/xmpcore/xmp_image.cpp mplayerxp/xmpcore/xmp_image.h Modified: mplayerxp/libmpcodecs/dec_audio.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -174,7 +174,6 @@ unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format) const { decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); sh_audio_t& sh = priv.parent; - char strbuf[200]; af_stream_t* afs=af_new(&sh); // input format: same as codec's output format: @@ -206,7 +205,7 @@ sh.af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); - mpxp_v<<"AF_pre: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate<<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200) + mpxp_v<<"AF_pre: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate<<" hz, "<<mpaf_fmt2str(afs->output.format) <<" af_bps="<<sh.af_bps<<std::endl; priv.afi.afilter=afs; @@ -219,7 +218,6 @@ unsigned out_minsize, unsigned out_maxsize) const { decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); sh_audio_t& sh = priv.parent; - char strbuf[200]; af_stream_t* afs=priv.afi.afilter; if(!afs) afs = af_new(&sh); @@ -254,7 +252,7 @@ sh.af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); mpxp_v<<"AF_init: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate - <<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200)<<" af_bps="<<sh.af_bps<<std::endl; + <<" hz, "<<mpaf_fmt2str(afs->output.format)<<" af_bps="<<sh.af_bps<<std::endl; sh.a_buffer_size=out_maxsize; sh.a_buffer=new char [sh.a_buffer_size]; @@ -315,36 +313,25 @@ mpxp_dbg2<<"decaudio: "<<len<<" bytes "<<pts<<" pts min "<<minlen<<" max "<<maxlen<<" buflen "<<buflen<<" o_bps="<<sh.o_bps<<" f_bps="<<sh.af_bps<<std::endl; if(len==0 || !priv.afi.afilter) return 0; // EOF? // run the filters: - mp_aframe_t* afd; // filter input - mp_aframe_t* pafd; // filter output - afd=new_mp_aframe( sh.rate, - sh.nch, - afmt2mpaf(sh.afmt) - ,0); // xp_idx + mp_aframe_t* afd=new(zeromem) mp_aframe_t(sh.rate,sh.nch,afmt2mpaf(sh.afmt),0); // xp_idx afd->audio=buf; afd->len=len; - pafd=af_play(priv.afi.afilter,afd); + mp_aframe_t pafd=af_play(priv.afi.afilter,*afd); afd->audio=NULL; // fake no buffer - if(!pafd) { - mpxp_v<<"decaudio: filter error"<<std::endl; - return 0; // error - } + mpxp_dbg2<<"decaudio: "<<std::hex<<pafd.format<<" in="<<len<<" out="<<pafd.len<<" (min "<<minlen<<" max "<<maxlen<<" buf "<<buflen<<")"<<std::endl; - mpxp_dbg2<<"decaudio: "<<std::hex<<pafd->format<<" in="<<len<<" out="<<pafd->len<<" (min "<<minlen<<" max "<<maxlen<<" buf "<<buflen<<")"<<std::endl; - - cp_size=pafd->len; - cp_size=std::min(buflen,pafd->len); - memcpy(buf,pafd->audio,cp_size); - cp_tile=pafd->len-cp_size; + cp_size=pafd.len; + cp_size=std::min(buflen,pafd.len); + memcpy(buf,pafd.audio,cp_size); + cp_tile=pafd.len-cp_size; if(cp_tile) { - sh.af_buffer=&((char *)pafd->audio)[cp_size]; + sh.af_buffer=&((char *)pafd.audio)[cp_size]; sh.af_buffer_len=cp_tile; sh.af_pts = pts+(float)cp_size/(float)sh.af_bps; mpxp_dbg2<<"decaudio: afilter->cache "<<cp_tile<<" bytes "<<pts<<" pts"<<std::endl; } else sh.af_buffer_len=0; - if(pafd!=afd) free_mp_aframe(pafd); - free_mp_aframe(afd); + delete afd; return cp_size; } Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -186,16 +186,16 @@ print_codec_info(); } -void VD_Interface::draw_image(const mp_image_t* mpi) const +void VD_Interface::draw_image(const mp_image_t& smpi) const { decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); vf_stream_t* s; const unsigned h_step=16; - unsigned num_slices = mpi->h/h_step; + unsigned num_slices = smpi.h/h_step; s=priv.vfilter; - if(!(mpi->flags&(MP_IMGFLAG_DRAW_CALLBACK))){ - if(mpi->h%h_step) num_slices++; + if(!(smpi.flags&(MP_IMGFLAG_DRAW_CALLBACK))){ + if(smpi.h%h_step) num_slices++; if(priv.psi.vf_flags&VF_FLAGS_SLICES) { unsigned j,i,y; @@ -207,8 +207,8 @@ } y=0; for(i=0;i<num_slices;i++) { - ampi[i]=new_mp_image(mpi->w,y,h_step); - mpi_fake_slice(ampi[i],mpi,y,h_step); + ampi[i]=new(zeromem) mp_image_t(smpi.w,y,h_step); + ampi[i]->fake_slice(smpi,y,h_step); y+=h_step; } #ifdef _OPENMP @@ -218,13 +218,13 @@ for(i=j;i<priv.smp_num_cpus;i++) { mpxp_dbg2<<"parallel: dec_video.put_slice["<<ampi[i]->width<<"x"<<ampi[i]->height <<"] "<<ampi[i]->x<<" "<<ampi[i]->y<<" "<<ampi[i]->w<<" "<<ampi[i]->h<<std::endl; - vf_put_slice(s,ampi[i]); + vf_put_slice(s,*ampi[i]); } } for(;j<num_slices;j++) { mpxp_dbg2<<"par_tail: dec_video.put_slice["<<ampi[i]->width<<"x"<<ampi[i]->height <<"] "<<ampi[i]->x<<" "<<ampi[i]->y<<" "<<ampi[i]->w<<" "<<ampi[i]->h<<std::endl; - vf_put_slice(s,ampi[j]); + vf_put_slice(s,*ampi[j]); } } else @@ -234,16 +234,15 @@ for(i=0;i<num_slices;i++) { mpxp_dbg2<<"dec_video.put_slice["<<ampi[i]->width<<"x"<<ampi[i]->height <<"] "<<ampi[i]->x<<" "<<ampi[i]->y<<" "<<ampi[i]->w<<" "<<ampi[i]->h<<std::endl; - vf_put_slice(s,ampi[i]); + vf_put_slice(s,*ampi[i]); } } - for(i=0;i<num_slices;i++) free_mp_image(ampi[i]); + for(i=0;i<num_slices;i++) delete ampi[i]; } else { - mpxp_dbg2<<"Put whole frame["<<mpi->width<<"x"<<mpi->height<<"]"<<std::endl; - mp_image_t dmpi=*mpi; - vf_put_slice(s,&dmpi); + mpxp_dbg2<<"Put whole frame["<<smpi.width<<"x"<<smpi.height<<"]"<<std::endl; + vf_put_slice(s,smpi); } - free_mp_image(mpi); + delete &smpi; } } @@ -267,7 +266,7 @@ /* ------------------------ frame decoded. -------------------- */ if(!mpi) return 0; // error / skipped frame - draw_image(mpi); + draw_image(*mpi); t2=GetTimer();t=t2-t; tt = t*0.000001f; @@ -537,10 +536,9 @@ return mpi; } -void VD_Interface::draw_slice(const mp_image_t* mpi) const { +void VD_Interface::draw_slice(const mp_image_t& mpi) const { decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); vf_stream_t* vf = priv.vfilter; - mp_image_t dmpi = *mpi; - vf_put_slice(vf,&dmpi); + vf_put_slice(vf,mpi); } } // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/dec_video.h =================================================================== --- mplayerxp/libmpcodecs/dec_video.h 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/dec_video.h 2013-06-12 14:05:09 UTC (rev 653) @@ -23,8 +23,8 @@ virtual MPXP_Rc config_vf(int w, int h) const; virtual mp_image_t* get_image(int mp_imgtype, int mp_imgflag,int w, int h) const; - virtual void draw_slice(const mp_image_t*) const; - virtual void draw_image(const mp_image_t*) const; + virtual void draw_slice(const mp_image_t&) const; + virtual void draw_image(const mp_image_t&) const; static void print_help(); private: void print_codec_info() const; Modified: mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -131,10 +131,10 @@ int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) { - register int ci, co=1; - register __s16 ZZvalue; - register unsigned char bitten; - register unsigned char bitoff; + int ci, co=1; + __s16 ZZvalue; + unsigned char bitten; + unsigned char bitoff; #ifdef SHOWBLOCK @@ -302,10 +302,10 @@ int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) { int ci; - register int co; - register int i; - register unsigned char bitten; - register unsigned char bitoff; + int co; + int i; + unsigned char bitten; + unsigned char bitoff; /* first byte always read */ i=RTjpeg_ZZ[0]; @@ -445,8 +445,8 @@ int RTjpeg_b2s(__s16 *data, __s8 *strm, __u8 bt8) { - register int ci, co=1, tmp; - register __s16 ZZvalue; + int ci, co=1, tmp; + __s16 ZZvalue; #ifdef SHOWBLOCK @@ -505,7 +505,7 @@ int RTjpeg_s2b(__s16 *data, __s8 *strm, __u8 bt8, __u32 *qtbl) { int ci=1, co=1, tmp; - register int i; + int i; i=RTjpeg_ZZ[0]; data[i]=((__u8)strm[0])*qtbl[i]; @@ -735,7 +735,7 @@ } #else volatile mmx_t tmp6, tmp7; - register mmx_t *dataptr = (mmx_t *)odata; + mmx_t *dataptr = (mmx_t *)odata; mmx_t *idata2 = (mmx_t *)idata; // first copy the input 8 bit to the destination 16 bits @@ -1573,7 +1573,7 @@ mmx_t workspace[64]; mmx_t *wsptr = workspace; - register mmx_t *dataptr = (mmx_t *)odata; + mmx_t *dataptr = (mmx_t *)odata; mmx_t *idata = (mmx_t *)data; rskip = rskip>>3; @@ -2852,11 +2852,11 @@ int RTjpeg_compressYUV420(__s8 *sp, unsigned char *bp) { __s8 * sb; - register __u8 * bp1 = bp + (RTjpeg_width<<3); - register __u8 * bp2 = bp + RTjpeg_Ysize; - register __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); - register int i; - register unsigned j, k; + __u8 * bp1 = bp + (RTjpeg_width<<3); + __u8 * bp2 = bp + RTjpeg_Ysize; + __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); + int i; + unsigned j, k; #ifdef MMX emms(); @@ -2907,10 +2907,10 @@ int RTjpeg_compressYUV422(__s8 *sp, unsigned char *bp) { __s8 * sb; - register __u8 * bp2 = bp + RTjpeg_Ysize; - register __u8 * bp3 = bp2 + RTjpeg_Csize; - register int i; - register unsigned j, k; + __u8 * bp2 = bp + RTjpeg_Ysize; + __u8 * bp3 = bp2 + RTjpeg_Csize; + int i; + unsigned j, k; #ifdef MMX emms(); @@ -2979,8 +2979,8 @@ void RTjpeg_decompressYUV422(__s8 *sp, __u8 *bp) { - register __u8 * bp2 = bp + RTjpeg_Ysize; - register __u8 * bp3 = bp2 + (RTjpeg_Csize); + __u8 * bp2 = bp + RTjpeg_Ysize; + __u8 * bp3 = bp2 + (RTjpeg_Csize); int i; unsigned j,k; @@ -3028,9 +3028,9 @@ void RTjpeg_decompressYUV420(__s8 *sp, __u8 *bp) { - register __u8 * bp1 = bp + (RTjpeg_width<<3); - register __u8 * bp2 = bp + RTjpeg_Ysize; - register __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); + __u8 * bp1 = bp + (RTjpeg_width<<3); + __u8 * bp2 = bp + RTjpeg_Ysize; + __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); int i; unsigned j,k; @@ -3204,10 +3204,10 @@ { __s8 * sb; //rh __s16 *block; - register __u8 * bp1 = bp + (RTjpeg_width<<3); - register __u8 * bp2 = bp + RTjpeg_Ysize; - register __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); - register int i; + __u8 * bp1 = bp + (RTjpeg_width<<3); + __u8 * bp2 = bp + RTjpeg_Ysize; + __u8 * bp3 = bp2 + (RTjpeg_Csize>>1); + int i; unsigned j, k; #ifdef MMX @@ -3297,9 +3297,9 @@ { __s8 * sb; __s16 *_block; - register __u8 * bp2; - register __u8 * bp3; - register int i; + __u8 * bp2; + __u8 * bp3; + int i; unsigned j, k; #ifdef MMX Modified: mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -530,7 +530,7 @@ #if !defined(MEMCPY8_DS) #define MEMCPY8_DS(dest,src,len) \ - { register lzo_uint __l = (len) / 8; \ + { lzo_uint __l = (len) / 8; \ do { \ *dest++ = *src++; \ *dest++ = *src++; \ @@ -1202,7 +1202,7 @@ { static int x[3]; static unsigned xn = 3; - register unsigned j; + unsigned j; for (j = 0; j < xn; j++) x[j] = (int)j - 3; @@ -1560,9 +1560,9 @@ lzo_voidp wrkmem ) { #if 0 && defined(__GNUC__) && defined(__i386__) - register const lzo_byte *ip __asm__(REG_S); + const lzo_byte *ip __asm__(REG_S); #else - register const lzo_byte *ip; + const lzo_byte *ip; #endif lzo_byte *op; const lzo_byte * const in_end = in + in_len; @@ -1578,9 +1578,9 @@ for (;;) { #if 0 && defined(__GNUC__) && defined(__i386__) - register const lzo_byte *m_pos __asm__(REG_D); + const lzo_byte *m_pos __asm__(REG_D); #else - register const lzo_byte *m_pos; + const lzo_byte *m_pos; #endif lzo_moff_t m_off; lzo_uint m_len; @@ -1638,7 +1638,7 @@ if (m_off <= M1_MAX_OFFSET && lit == 3) #endif { - register lzo_uint t; + lzo_uint t; t = lit; assert(op - 2 > out); op[-2] |= LZO_BYTE(t); @@ -1665,7 +1665,7 @@ UPDATE_I(dict,0,dindex,ip,in); if (ip - ii > 0) { - register lzo_uint t = ip - ii; + lzo_uint t = ip - ii; if (t <= 3) { @@ -1676,7 +1676,7 @@ *op++ = LZO_BYTE(t - 3); else { - register lzo_uint tt = t - 18; + lzo_uint tt = t - 18; *op++ = 0; while (tt > 255) @@ -1956,14 +1956,14 @@ lzo_voidp wrkmem ) #endif { - register lzo_byte *op; - register const lzo_byte *ip; - register lzo_uint t; + lzo_byte *op; + const lzo_byte *ip; + lzo_uint t; #if defined(COPY_DICT) lzo_uint m_off; const lzo_byte *dict_end; #else - register const lzo_byte *m_pos; + const lzo_byte *m_pos; #endif const lzo_byte * const ip_end = in + in_len; @@ -2438,14 +2438,14 @@ lzo_voidp wrkmem ) #endif { - register lzo_byte *op; - register const lzo_byte *ip; - register lzo_uint t; + lzo_byte *op; + const lzo_byte *ip; + lzo_uint t; #if defined(COPY_DICT) lzo_uint m_off; const lzo_byte *dict_end; #else - register const lzo_byte *m_pos; + const lzo_byte *m_pos; #endif const lzo_byte * const ip_end = in + in_len; Modified: mplayerxp/libmpcodecs/vd_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_lavc.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/vd_lavc.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -518,7 +518,7 @@ if(mpi) { if(mpi->bpp == 8 && mpi->planes[1]) delete mpi->planes[1]; - if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK) free_mp_image(mpi); + if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK) delete mpi; } if(pic->type!=FF_BUFFER_TYPE_USER){ @@ -603,7 +603,7 @@ <<">["<<mpi->width<<"x"<<mpi->height<<"] "<<mpi->x<<" " <<mpi->y<<" "<<mpi->w<<" "<<mpi->h<<std::endl; __MP_ATOMIC(priv.psi.active_slices++); - priv.parent.draw_slice (mpi); + priv.parent.draw_slice (*mpi); mpi->xp_idx = orig_idx; __MP_ATOMIC(priv.psi.active_slices--); } @@ -680,9 +680,9 @@ } if(!(frame.flags&3) && use_slices) { - if(_mpi) free_mp_image(_mpi); + if(_mpi) delete _mpi; _mpi=parent.get_image(MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_DRAW_CALLBACK|MP_IMGFLAG_DIRECT,sh.src_w, sh.src_h); - _mpi = _mpi; + mpi = _mpi; frame_number++; ctx->draw_horiz_band=draw_slice; } @@ -705,7 +705,7 @@ if(!got_picture) return NULL; // skipped image if(!ctx->draw_horiz_band) { - if(_mpi) free_mp_image(_mpi); + if(_mpi) delete _mpi; _mpi=parent.get_image(MP_IMGTYPE_EXPORT, MP_IMGFLAG_ACCEPT_STRIDE,sh.src_w,sh.src_h); if(!_mpi){ // temporary! mpxp_err<<"couldn't allocate image for lavc codec"<<std::endl; Modified: mplayerxp/libmpcodecs/vd_libmpeg2.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -283,7 +283,7 @@ mpi->stride[1]= mpi->stride[2]=w>>1; mpi->flags&=~MP_IMGFLAG_DRAW_CALLBACK; - parent.draw_image(mpi); + parent.draw_image(*mpi); } // decode a frame Modified: mplayerxp/libmpdemux/demux_ac3.cpp =================================================================== --- mplayerxp/libmpdemux/demux_ac3.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_ac3.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -164,7 +164,7 @@ *brate=*samplerate=*channels=0; s = demuxer->stream; s->seek(fptr); - fcc=fcc1=s->read_dword(); + fcc=fcc1=s->read(type_dword); fcc1=me2be_32(fcc1); p = (uint8_t *)&fcc1; s->seek(fptr); @@ -181,7 +181,7 @@ Stream *s; uint8_t *p; s = demuxer->stream; - fcc1=s->read_dword(); + fcc1=s->read(type_dword); fcc1=me2be_32(fcc1); p = (uint8_t *)&fcc1; if(ac3_get_raw_id(demuxer,0,&fcc1,&fcc2,&fcc2)) return MPXP_Ok; Modified: mplayerxp/libmpdemux/demux_aiff.cpp =================================================================== --- mplayerxp/libmpdemux/demux_aiff.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_aiff.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -148,7 +148,7 @@ bp.resize(bp.size()+1); bp[chunk_size]=0; demuxer->info().add(INFOT_NAME, bp.cdata()); - if(priv->verc && (chunk_size&1)) s->read_char(); + if(priv->verc && (chunk_size&1)) s->read(type_byte); } else if(*((uint32_t *)&preamble[0])==mmioFOURCC('A','U','T','H')) @@ -157,7 +157,7 @@ bp.resize(bp.size()+1); bp[chunk_size]=0; demuxer->info().add(INFOT_AUTHOR, bp.cdata()); - if(priv->verc && (chunk_size&1)) s->read_char(); + if(priv->verc && (chunk_size&1)) s->read(type_byte); } else if(*((uint32_t *)&preamble[0])==mmioFOURCC('(','c',')',' ')) @@ -166,7 +166,7 @@ bp.resize(bp.size()+1); bp[chunk_size]=0; demuxer->info().add(INFOT_COPYRIGHT, bp.cdata()); - if(priv->verc && (chunk_size&1)) s->read_char(); + if(priv->verc && (chunk_size&1)) s->read(type_byte); } else if(*((uint32_t *)&preamble[0])==mmioFOURCC('A','N','N','O')) @@ -175,7 +175,7 @@ bp.resize(bp.size()+1); bp[chunk_size]=0; demuxer->info().add(INFOT_DESCRIPTION, bp.cdata()); - if(priv->verc && (chunk_size&1)) s->read_char(); + if(priv->verc && (chunk_size&1)) s->read(type_byte); } else { Modified: mplayerxp/libmpdemux/demux_asf.cpp =================================================================== --- mplayerxp/libmpdemux/demux_asf.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_asf.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -512,34 +512,34 @@ p_start=stream->tell(); p_end = p_start+apriv->asf_packetsize; /* FIXME: parser is not ready for variable packet length */ - ecc_flags=stream->read_char(); /* read v82 header */ + ecc_flags=stream->read(type_byte); /* read v82 header */ MSG_DBG2("ecc=%02X ecc_flags=%u\n",ecc_flags,ecc_flags&0x0F); stream->skip(ecc_flags&15); - flags=stream->read_char(); - segtype=stream->read_char(); + flags=stream->read(type_byte); + segtype=stream->read(type_byte); /* Read packet size (plen): */ switch((flags>>5)&3){ - case 3: plen=stream->read_dword_le();break; // dword - case 2: plen=stream->read_word_le();break; // word - case 1: plen=stream->read_char();break; // byte + case 3: plen=stream->read_le(type_dword);break; // dword + case 2: plen=stream->read_le(type_word);break; // word + case 1: plen=stream->read(type_byte);break; // byte default: plen=0; /* not present */ // MSG_V("Invalid plen type! assuming plen=0 (flags=%02X)\n",flags); } /* Read sequence: */ switch((flags>>1)&3){ - case 3: sequence=stream->read_dword_le();break;// dword - case 2: sequence=stream->read_word_le();break; // word - case 1: sequence=stream->read_char();break; // byte + case 3: sequence=stream->read_le(type_dword);break;// dword + case 2: sequence=stream->read_le(type_word);break; // word + case 1: sequence=stream->read(type_byte);break; // byte default: sequence=0; } /* Read padding size (padding): */ switch((flags>>3)&3){ - case 3: padding=stream->read_dword_le();break; // dword - case 2: padding=stream->read_word_le();break; // word - case 1: padding=stream->read_char();break; // byte + case 3: padding=stream->read_le(type_dword);break; // dword + case 2: padding=stream->read_le(type_word);break; // word + case 1: padding=stream->read(type_byte);break; // byte default: padding=0; } @@ -553,12 +553,12 @@ } // Read time & duration: - time = stream->read_dword_le(); - duration = stream->read_word_le(); + time = stream->read_le(type_dword); + duration = stream->read_le(type_word); // Read payload flags: if(flags&1){ - unsigned char sf=stream->read_char(); + unsigned char sf=stream->read(type_byte); // multiple sub-packets segsizetype=sf>>6; segs=sf & 0x3F; @@ -580,31 +580,31 @@ if(stream->tell()>=p_end) MSG_V("Warning! invalid packet 1, sig11 coming soon...\n"); - st=stream->read_char(); + st=stream->read(type_byte); streamno=st&0x7F; if(st&0x80) keyframe=1; // Read media object number (seq): switch((segtype>>4)&3){ - case 3: seq=stream->read_dword_le();break;// dword - case 2: seq=stream->read_word_le();break; // word - case 1: seq=stream->read_char();break; // byte + case 3: seq=stream->read_le(type_dword);break;// dword + case 2: seq=stream->read_le(type_word);break; // word + case 1: seq=stream->read(type_byte);break; // byte default: seq=0; } // Read offset or timestamp: switch((segtype>>2)&3){ - case 3: x=stream->read_dword_le();break; // dword - case 2: x=stream->read_word_le();break; // word - case 1: x=stream->read_char();break; // byte + case 3: x=stream->read_le(type_dword);break; // dword + case 2: x=stream->read_le(type_word);break; // word + case 1: x=stream->read(type_byte);break; // byte default: x=0; } // Read replic.data len: switch((segtype)&3){ - case 3: rlen=stream->read_dword_le();break; // dword - case 2: rlen=stream->read_word_le();break; // word - case 1: rlen=stream->read_char();break; // byte + case 3: rlen=stream->read_le(type_dword);break; // dword + case 2: rlen=stream->read_le(type_word);break; // word + case 1: rlen=stream->read(type_byte);break; // byte default: rlen=0; } @@ -615,7 +615,7 @@ default: if(rlen>=8){ stream->skip(4);// skip object size - time2=stream->read_dword_le(); // read PTS + time2=stream->read_le(type_dword); // read PTS stream->skip(rlen-8); } else { MSG_V("unknown segment type (rlen): 0x%02X \n",rlen); @@ -627,9 +627,9 @@ if(flags&1){ // multiple segments switch(segsizetype){ - case 3: len=stream->read_dword_le();break; // dword - case 2: len=stream->read_word_le();break; // word - case 1: len=stream->read_char();break; // byte + case 3: len=stream->read_le(type_dword);break; // dword + case 2: len=stream->read_le(type_word);break; // word + case 1: len=stream->read(type_byte);break; // byte default: len=plen-(stream->tell()-p_start); // ??? } } else { @@ -645,7 +645,7 @@ case 0x01: // GROUPING: while(len>0){ - int len2=stream->read_char(); + int len2=stream->read(type_byte); if(len2<0) len2=0; done=demux_asf_read_packet(demux,stream->tell(),len2,streamno,seq,x,duration,-1,keyframe); len-=len2+1; Modified: mplayerxp/libmpdemux/demux_avi.cpp =================================================================== --- mplayerxp/libmpdemux/demux_avi.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_avi.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -78,8 +78,8 @@ } static int avi_idx_cmp(const any_t*elem1,const any_t*elem2) { - register off_t a = avi_idx_offset((AVIINDEXENTRY *)elem1); - register off_t b = avi_idx_offset((AVIINDEXENTRY *)elem2); + off_t a = avi_idx_offset((AVIINDEXENTRY *)elem1); + off_t b = avi_idx_offset((AVIINDEXENTRY *)elem2); return (a > b) - (b > a); } @@ -132,7 +132,7 @@ priv->idx_size=0; priv->audio_streams=0; while(1){ - int id=demuxer->stream->read_dword_le(); + int id=demuxer->stream->read_le(type_dword); unsigned chunksize,size2; static int last_fccType=0; const char* hdr=NULL; @@ -141,8 +141,8 @@ if(demuxer->stream->eof()) break; // if(id==mmioFOURCC('L','I','S','T')){ - unsigned len=demuxer->stream->read_dword_le(); // list size - id=demuxer->stream->read_dword_le(); // list type + unsigned len=demuxer->stream->read_le(type_dword); // list size + id=demuxer->stream->read_le(type_dword); // list type MSG_DBG2("LIST '%.4s' len=%u\n",(char *) &id,len); if(len >= 4) { len -= 4; @@ -165,7 +165,7 @@ } continue; } - size2=demuxer->stream->read_dword_le(); + size2=demuxer->stream->read_le(type_dword); MSG_V("CHUNK '%.4s' len=%u\n",(char *) &id,size2); chunksize=(size2+1)&(~1); infot=-1; @@ -291,11 +291,11 @@ chunksize-=24; memcpy(s->fcc, "indx", 4); s->dwSize = size2; - s->wLongsPerEntry = demuxer->stream->read_word_le(); - s->bIndexSubType = demuxer->stream->read_char(); - s->bIndexType = demuxer->stream->read_char(); - s->nEntriesInUse = demuxer->stream->read_dword_le(); - *(uint32_t *)s->dwChunkId = demuxer->stream->read_dword_le(); + s->wLongsPerEntry = demuxer->stream->read_le(type_word); + s->bIndexSubType = demuxer->stream->read(type_byte); + s->bIndexType = demuxer->stream->read(type_byte); + s->nEntriesInUse = demuxer->stream->read_le(type_dword); + *(uint32_t *)s->dwChunkId = demuxer->stream->read_le(type_dword); bp=demuxer->stream->read(3*4); memcpy(s->dwReserved,bp.data(),bp.size()); memset(s->dwReserved,0,3*4); @@ -309,10 +309,10 @@ // now the real index of indices for (i=0; i<s->nEntriesInUse; i++) { chunksize-=16; - s->aIndex[i].qwOffset = demuxer->stream->read_dword_le() & 0xffffffff; - s->aIndex[i].qwOffset |= ((uint64_t)demuxer->stream->read_dword_le() & 0xffffffff)<<32; - s->aIndex[i].dwSize = demuxer->stream->read_dword_le(); - s->aIndex[i].dwDuration = demuxer->stream->read_dword_le(); + s->aIndex[i].qwOffset = demuxer->stream->read_le(type_dword) & 0xffffffff; + s->aIndex[i].qwOffset |= ((uint64_t)demuxer->stream->read_le(type_dword) & 0xffffffff)<<32; + s->aIndex[i].dwSize = demuxer->stream->read_le(type_dword); + s->aIndex[i].dwDuration = demuxer->stream->read_le(type_dword); MSG_DBG2("ODML (%.4s): [%d] 0x%016llx 0x%04lx %ld\n", (s->dwChunkId), i, (uint64_t)s->aIndex[i].qwOffset, s->aIndex[i].dwSize, s->aIndex[i].dwDuration); @@ -415,7 +415,7 @@ } case mmioFOURCC('d', 'm', 'l', 'h'): { // dmlh 00 00 00 04 frms - unsigned int total_frames = demuxer->stream->read_dword_le(); + unsigned int total_frames = demuxer->stream->read_le(type_dword); MSG_V("Found ODML header %lu frames %lu\n", chunksize, total_frames); demuxer->stream->skip( chunksize-4); chunksize = 0; @@ -451,7 +451,7 @@ unsigned riff_type; MSG_V( "additional RIFF header...\n"); - riff_type = demuxer->stream->read_dword_le(); + riff_type = demuxer->stream->read_le(type_dword); if(riff_type != mmioFOURCC('A','V','I','X')) MSG_WARN("** warning: this is no AVIX header..\n"); else { @@ -606,7 +606,7 @@ } if (i<priv->idx_size && db) { demuxer->stream->seek( avi_idx_offset(idx)); - id = demuxer->stream->read_dword_le(); + id = demuxer->stream->read_le(type_dword); if (id && id != db) // index fcc and real fcc differ? fix it. for (idx = &((AVIINDEXENTRY *)priv->idx)[0], i=0; i<priv->idx_size; i++, idx++){ if (!(idx->dwFlags & AVIIF_KEYFRAME) && idx->ckid == db) @@ -650,10 +650,10 @@ unsigned int c; demuxer->filepos=demuxer->stream->tell(); if(demuxer->filepos>=demuxer->movi_end && demuxer->movi_start<demuxer->movi_end) break; - id=demuxer->stream->read_dword_le(); - len=demuxer->stream->read_dword_le(); + id=demuxer->stream->read_le(type_dword); + len=demuxer->stream->read_le(type_dword); if(id==mmioFOURCC('L','I','S','T') || id==mmioFOURCC('R', 'I', 'F', 'F')){ - id=demuxer->stream->read_dword_le(); // list or RIFF type + id=demuxer->stream->read_le(type_dword); // list or RIFF type continue; } if(demuxer->stream->eof()) break; @@ -672,13 +672,13 @@ idx->dwChunkOffset=(unsigned long)demuxer->filepos; idx->dwChunkLength=len; - c=demuxer->stream->read_dword(); + c=demuxer->stream->read(type_dword); // Fix keyframes for DivX files: if(idxfix_divx) if(avi_stream_id(id)==idxfix_videostream){ switch(idxfix_divx){ - case 3: c=demuxer->stream->read_dword()<<5; //skip 32+5 bits for m$mpeg4v1 + case 3: c=demuxer->stream->read(type_dword)<<5; //skip 32+5 bits for m$mpeg4v1 case 1: if(c&0x40000000) idx->dwFlags&=~AVIIF_KEYFRAME;break; // divx 3 case 2: if(c==0x1B6) idx->dwFlags&=~AVIIF_KEYFRAME;break; // divx 4 } @@ -835,7 +835,7 @@ } -// len=demux->stream->read_dword_le(); +// len=demux->stream->read_le(type_dword); skip=(len+1)&(~1); // total bytes in this chunk if(ds){ @@ -891,7 +891,7 @@ #endif demux->stream->seek(pos); demux->filepos=demux->stream->tell(); - id=demux->stream->read_dword_le(); + id=demux->stream->read_le(type_dword); if(demux->stream->eof()) return 0; // EOF! if(id!=idx->ckid){ @@ -901,7 +901,7 @@ else if(!valid_fourcc(id)) continue; // drop chunk if both id and idx bad } - len=demux->stream->read_dword_le(); + len=demux->stream->read_le(type_dword); // if((len&(~1))!=(idx->dwChunkLength&(~1))){ // if((len)!=(idx->dwChunkLength)){ if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){ @@ -916,12 +916,12 @@ demux->stream->eof(1); return 0; } - id=demux->stream->read_dword_le(); - len=demux->stream->read_dword_le(); + id=demux->stream->read_le(type_dword); + len=demux->stream->read_le(type_dword); if(demux->stream->eof()) return 0; // EOF! if(id==mmioFOURCC('L','I','S','T') || id==mmioFOURCC('R', 'I', 'F', 'F')){ - id=demux->stream->read_dword_le(); // list or RIFF type + id=demux->stream->read_le(type_dword); // list or RIFF type continue; } } @@ -1293,9 +1293,9 @@ { uint32_t riff,id; - riff = demuxer->stream->read_dword_le(); - demuxer->stream->read_dword_le(); /*filesize */ - id=demuxer->stream->read_dword_le(); /* "AVI " */ + riff = demuxer->stream->read_le(type_dword); + demuxer->stream->read_le(type_dword); /*filesize */ + id=demuxer->stream->read_le(type_dword); /* "AVI " */ demuxer->file_format=Demuxer::Type_AVI; if(riff == mmioFOURCC('R','I','F','F') && id == formtypeAVI) return MPXP_Ok; if(riff == mmioFOURCC('O','N','2',' ') && id == formtypeON2) return MPXP_Ok; Modified: mplayerxp/libmpdemux/demux_bmp.cpp =================================================================== --- mplayerxp/libmpdemux/demux_bmp.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_bmp.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -212,7 +212,7 @@ // Check if a file is a BMP file depending on whether starts with 'BM' static MPXP_Rc bmp_probe(Demuxer *demuxer) { - if (demuxer->stream->read_word() == (('B' << 8) | 'M')) + if (demuxer->stream->read(type_word) == (('B' << 8) | 'M')) return MPXP_Ok; else return MPXP_False; @@ -242,9 +242,9 @@ // go back to the beginning demuxer->stream->reset(); demuxer->stream->seek( demuxer->stream->start_pos()+2); - filesize = demuxer->stream->read_dword_le(); + filesize = demuxer->stream->read_le(type_dword); demuxer->stream->skip( 4); - data_offset = demuxer->stream->read_word_le(); + data_offset = demuxer->stream->read_le(type_word); demuxer->stream->skip( 2); // create a new video stream header @@ -260,17 +260,17 @@ // load the BITMAPINFOHEADER // allocate size and take the palette table into account sh_video->bih = (BITMAPINFOHEADER *)mp_malloc(data_offset - 12); - sh_video->bih->biSize = demuxer->stream->read_dword_le(); - sh_video->bih->biWidth = demuxer->stream->read_dword_le(); - sh_video->bih->biHeight = demuxer->stream->read_dword_le(); - sh_video->bih->biPlanes = demuxer->stream->read_word_le(); - sh_video->bih->biBitCount = demuxer->stream->read_word_le(); - sh_video->bih->biCompression = demuxer->stream->read_dword_le(); - sh_video->bih->biSizeImage = demuxer->stream->read_dword_le(); - sh_video->bih->biXPelsPerMeter = demuxer->stream->read_dword_le(); - sh_video->bih->biYPelsPerMeter = demuxer->stream->read_dword_le(); - sh_video->bih->biClrUsed = demuxer->stream->read_dword_le(); - sh_video->bih->biClrImportant = demuxer->stream->read_dword_le(); + sh_video->bih->biSize = demuxer->stream->read_le(type_dword); + sh_video->bih->biWidth = demuxer->stream->read_le(type_dword); + sh_video->bih->biHeight = demuxer->stream->read_le(type_dword); + sh_video->bih->biPlanes = demuxer->stream->read_le(type_word); + sh_video->bih->biBitCount = demuxer->stream->read_le(type_word); + sh_video->bih->biCompression = demuxer->stream->read_le(type_dword); + sh_video->bih->biSizeImage = demuxer->stream->read_le(type_dword); + sh_video->bih->biXPelsPerMeter = demuxer->stream->read_le(type_dword); + sh_video->bih->biYPelsPerMeter = demuxer->stream->read_le(type_dword); + sh_video->bih->biClrUsed = demuxer->stream->read_le(type_dword); + sh_video->bih->biClrImportant = demuxer->stream->read_le(type_dword); // fetch the palette binary_packet bp=demuxer->stream->read(sh_video->bih->biClrUsed * 4); memcpy((unsigned char *)(sh_video->bih) + 40,bp.data(),bp.size()); Modified: mplayerxp/libmpdemux/demux_dca.cpp =================================================================== --- mplayerxp/libmpdemux/demux_dca.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_dca.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -343,7 +343,7 @@ *brate=*samplerate=*channels=0; s = demuxer->stream; s->seek(fptr); - fcc=s->read_dword(); + fcc=s->read(type_dword); fcc=me2be_32(fcc); s->seek(fptr); binary_packet bp=s->read(32); @@ -357,7 +357,7 @@ uint32_t fcc1,fcc2; Stream *s; s = demuxer->stream; - fcc1=s->read_dword(); + fcc1=s->read(type_dword); fcc1=me2be_32(fcc1); if(dca_get_raw_id(demuxer,0,&fcc1,&fcc2,&fcc2)) return MPXP_Ok; return MPXP_False; Modified: mplayerxp/libmpdemux/demux_film.cpp =================================================================== --- mplayerxp/libmpdemux/demux_film.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_film.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -244,7 +244,7 @@ // get the header size, which implicitly points past the header and // to the start of the data - header_size = demuxer->stream->read_dword(); + header_size = demuxer->stream->read(type_dword); film_data->film_version = demuxer->stream->read_fourcc(); demuxer->movi_start = header_size; demuxer->movi_end = demuxer->stream->end_pos(); @@ -261,7 +261,7 @@ { // fetch the chunk type and size chunk_type = demuxer->stream->read_fourcc(); - chunk_size = demuxer->stream->read_dword(); + chunk_size = demuxer->stream->read(type_dword); header_size -= chunk_size; switch (chunk_type) @@ -279,8 +279,8 @@ sh_video->ds = demuxer->video; sh_video->fourcc= video_format; - sh_video->src_h = demuxer->stream->read_dword(); - sh_video->src_w = demuxer->stream->read_dword(); + sh_video->src_h = demuxer->stream->read(type_dword); + sh_video->src_w = demuxer->stream->read(type_dword); MSG_V( " FILM video: %d x %d\n", sh_video->src_w, sh_video->src_h); @@ -303,7 +303,7 @@ // don't do this if the file is a quirky file with NULL version if (film_data->film_version) { - audio_channels = demuxer->stream->read_char(); + audio_channels = demuxer->stream->read(type_byte); if (audio_channels > 0) { // create and initialize the audio stream header @@ -317,9 +317,9 @@ sh_audio->wf->wFormatTag = 1; sh_audio->wtag = 1; sh_audio->wf->nChannels = audio_channels; - sh_audio->wf->wBitsPerSample = demuxer->stream->read_char(); + sh_audio->wf->wBitsPerSample = demuxer->stream->read(type_byte); demuxer->stream->skip( 1); // skip unknown byte - sh_audio->wf->nSamplesPerSec = demuxer->stream->read_word(); + sh_audio->wf->nSamplesPerSec = demuxer->stream->read(type_word); sh_audio->wf->nAvgBytesPerSec = sh_audio->wf->nSamplesPerSec * sh_audio->wf->wBitsPerSample * sh_audio->wf->nChannels / 8; @@ -366,11 +366,11 @@ if (sh_video) { - sh_video->fps = demuxer->stream->read_dword(); + sh_video->fps = demuxer->stream->read(type_dword); } // fetch the number of chunks - film_data->total_chunks = demuxer->stream->read_dword(); + film_data->total_chunks = demuxer->stream->read(type_dword); film_data->current_chunk = 0; MSG_V( " STAB chunk contains %d chunks\n", film_data->total_chunks); @@ -384,10 +384,10 @@ { film_chunk = film_data->chunks[i]; film_chunk.chunk_offset = - demuxer->movi_start + demuxer->stream->read_dword(); - film_chunk.chunk_size = demuxer->stream->read_dword(); - film_chunk.syncinfo1 = demuxer->stream->read_dword(); - film_chunk.syncinfo2 = demuxer->stream->read_dword(); + demuxer->movi_start + demuxer->stream->read(type_dword); + film_chunk.chunk_size = demuxer->stream->read(type_dword); + film_chunk.syncinfo1 = demuxer->stream->read(type_dword); + film_chunk.syncinfo2 = demuxer->stream->read(type_dword); // count chunks for the purposes of seeking if (counting_chunks) Modified: mplayerxp/libmpdemux/demux_flac.cpp =================================================================== --- mplayerxp/libmpdemux/demux_flac.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_flac.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -50,7 +50,7 @@ *brate=*samplerate=*channels=0; s = demuxer->stream; s->seek(fptr); - fcc1=s->read_dword(); + fcc1=s->read(type_dword); fcc1=me2be_32(fcc1); s->seek(fptr); binary_packet bp=s->read(32); @@ -70,7 +70,7 @@ Stream *s; uint8_t *p; s = demuxer->stream; - fcc1=s->read_dword(); + fcc1=s->read(type_dword); fcc1=me2be_32(fcc1); p = (uint8_t *)&fcc1; if(flac_get_raw_id(demuxer,0,&fcc1,&fcc2,&fcc2)) return MPXP_Ok; Modified: mplayerxp/libmpdemux/demux_fli.cpp =================================================================== --- mplayerxp/libmpdemux/demux_fli.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_fli.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -78,7 +78,7 @@ static MPXP_Rc fli_probe(Demuxer* demuxer){ unsigned magic_number; demuxer->movi_end = demuxer->stream->skip(4); - magic_number = demuxer->stream->read_word_le(); + magic_number = demuxer->stream->read_le(type_word); if ((magic_number != 0xAF11) && (magic_number != 0xAF12)) return MPXP_False; demuxer->file_format=Demuxer::Type_FLI; return MPXP_Ok; @@ -103,9 +103,9 @@ demuxer->stream->seek( 0); demuxer->movi_start = 128; - demuxer->movi_end = demuxer->stream->read_dword_le(); + demuxer->movi_end = demuxer->stream->read_le(type_dword); - magic_number = demuxer->stream->read_word_le(); + magic_number = demuxer->stream->read_le(type_word); if ((magic_number != 0xAF11) && (magic_number != 0xAF12)) { @@ -117,7 +117,7 @@ } // fetch the number of frames - frames->num_frames = demuxer->stream->read_word_le(); + frames->num_frames = demuxer->stream->read_le(type_word); frames->current_frame = 0; // allocate enough entries for the indices @@ -139,8 +139,8 @@ // custom fourcc for internal MPlayer use sh_video->fourcc = mmioFOURCC('F', 'L', 'I', 'C'); - sh_video->src_w = demuxer->stream->read_word_le(); - sh_video->src_h = demuxer->stream->read_word_le(); + sh_video->src_w = demuxer->stream->read_le(type_word); + sh_video->src_h = demuxer->stream->read_le(type_word); // pass extradata to codec sh_video->bih = (BITMAPINFOHEADER*)header; @@ -155,7 +155,7 @@ demuxer->stream->skip( 4); // get the speed - speed = demuxer->stream->read_word_le(); + speed = demuxer->stream->read_le(type_word); if (speed == 0) speed = 1; if (magic_number == 0xAF11) @@ -168,8 +168,8 @@ while ((!demuxer->stream->eof()) && (frame_number < frames->num_frames)) { frames->filepos[frame_number] = demuxer->stream->tell(); - frame_size = demuxer->stream->read_dword_le(); - magic_number = demuxer->stream->read_word_le(); + frame_size = demuxer->stream->read_le(type_dword); + magic_number = demuxer->stream->read_le(type_word); demuxer->stream->skip( frame_size - 6); // if this chunk has the right magic number, index it Modified: mplayerxp/libmpdemux/demux_mkv.cpp =================================================================== --- mplayerxp/libmpdemux/demux_mkv.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_mkv.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -118,14 +118,14 @@ int i, len_mask = 0x80; uint32_t id; - for (i=0, id=s->read_char(); i<4 && !(id & len_mask); i++) + for (i=0, id=s->read(type_byte); i<4 && !(id & len_mask); i++) len_mask >>= 1; if (i >= 4) return EBML_ID_INVALID; if (length) *length = i + 1; while (i--) - id = (id << 8) | s->read_char(); + id = (id << 8) | s->read(type_byte); return id; } @@ -186,7 +186,7 @@ int i, j, num_ffs = 0, len_mask = 0x80; uint64_t len; - for (i=0, len=s->read_char(); i<8 && !(len & len_mask); i++) + for (i=0, len=s->read(type_byte); i<8 && !(len & len_mask); i++) len_mask >>= 1; if (i >= 8) return EBML_UINT_INVALID; @@ -197,7 +197,7 @@ num_ffs++; while (i--) { - len = (len << 8) | s->read_char(); + len = (len << 8) | s->read(type_byte); if ((len & 0xFF) == 0xFF) num_ffs++; } @@ -222,7 +222,7 @@ *length = len + l; while (len--) - value = (value << 8) | s->read_char(); + value = (value << 8) | s->read(type_byte); return value; } @@ -244,12 +244,12 @@ *length = len + l; len--; - l = s->read_char(); + l = s->read(type_byte); if (l & 0x80) value = -1; value = (value << 8) | l; while (len--) - value = (value << 8) | s->read_char(); + value = (value << 8) | s->read(type_byte); return value; } @@ -270,7 +270,7 @@ case 4: { union {uint32_t i; float f;} u; - u.i = s->read_dword(); + u.i = s->read(type_dword); value = u.f; break; } @@ -278,7 +278,7 @@ case 8: { union {uint64_t i; double d;} u; - u.i = s->read_qword(); + u.i = s->read(type_qword); value = u.d; break; } Modified: mplayerxp/libmpdemux/demux_mov.cpp =================================================================== --- mplayerxp/libmpdemux/demux_mov.cpp 2013-06-11 17:36:43 UTC (rev 652) +++ mplayerxp/libmpdemux/demux_mov.cpp 2013-06-12 14:05:09 UTC (rev 653) @@ -338,17 +338,17 @@ while(1){ int i; int skipped=8; - off_t len=demuxer->stream->read_dword(); - unsigned int id=demuxer->stream->read_dword(); + off_t len=demuxer->stream->read(type_dword); + unsigned int id=demuxer->stream->read(type_dword); if(demuxer->stream->eof()) break; // EOF if (len == 1) /* real size is 64bits - cjb */ { #ifndef _LARGEFILE_SOURCE - if (demuxer->stream->read_dword() != 0) + if (demuxer->stream->read(type_dword) != 0) MSG_WARN( "64bit file, but you've compiled MPlayer without LARGEFILE support!\n"); - len = demuxer->stream->read_dword(); + len = demuxer->stream->read(type_dword); #else - len = demuxer->stream->read_qword(); + len = demuxer->stream->read(type_qword); #endif skipped += 8; } @@ -370,7 +370,7 @@ // char[4] compatible_brands[] (eg. 'mp41') // compatible_brands list spans to the end of box #if 1 - tmp = demuxer->stream->read_dword(); + tmp = demuxer->stream->read(type_dword); switch(tmp) { case MOV_FOURCC('i','s','o','m'): MSG_V("MOV: File-Type Major-Brand: ISO Media File\n"); @@ -413,12 +413,12 @@ tmp = BE_32(tmp); MSG_WARN("MOV: File-Type unknown Major-Brand: %.4s\n",&tmp); } - ver=demuxer->stream->read_dword(); + ver=demuxer->stream->read(type_dword); MSG_V("MOV: File-Type Minor-Version: %d\n",ver); skipped += 8; // List all compatible brands for(i = 0; i < ((len-16)/4); i++) { - tmp = BE_32(demuxer->stream->read_dword()); + tmp = BE_32(demuxer->stream->read(type_dword)); MSG_V("MOV: File-Type Compatible-Brands #%d: %.4s\n",i,&tmp); skipped += 4; } @@ -432,24 +432,24 @@ MSG_DBG2("MOV: Movie header: start: %x end: %x\n", priv->moov_start, priv->moov_end); skipped+=8; - i = demuxer->stream->read_dword()-8; - if(demuxer->stream->read_dword()==MOV_FOURCC('r','m','r','a')){ + i = demuxer->stream->read(type_dword)-8; + if(demuxer->stream->read(type_dword)==MOV_FOURCC('r','m','r','a')){ skipped+=i; MSG_V("MOV: Reference Media file!!!\n"); //set demuxer type to playlist ... //demuxer->type=DEMUXER_TYPE_PLAYLIST; while(i>0){ - int len=demuxer->stream->read_dword()-8; - int fcc=demuxer->stream->read_dword(); + int len=demuxer->stream->read(type_dword)-8; + int fcc=demuxer->stream->read(type_dword); if(len<0) break; // EOF!? i-=8; switch(fcc){ case MOV_FOURCC('r','m','d','a'): continue; case MOV_FOURCC('r','d','r','f'): { - demuxer->stream->read_dword(); - /*int type=*/demuxer->stream->read_dword_le(); - int slen=demuxer->stream->read_dword(); + demuxer->stream->read(type_dword); + /*int type=*/demuxer->stream->read_le(type_dword); + int slen=demuxer->stream->read(type_dword); //char* s=mp_malloc(slen+1); //demuxer->stream->read(s,slen); @@ -467,13 +467,13 @@ len-=12+slen;i-=12+slen; break; } case MOV_FOURCC('r','m','d','r'): { - demuxer->stream->read_dword(); - int rate=demuxer->stream->read_dword(); + demuxer->stream->read(type_dword); + int rate=demuxer->stream->read(type_dword); MSG_V(" min. data rate: %d bits/sec\n",rate); len-=8; i-=8; break; } case MOV_FOURCC('r','m','q','u'): { - int q=demuxer->stream->read_dword(); + int q=demuxer->stream->read(type_dword); MSG_V(" quality index: %d\n",q); len-=4; i-=4; break; } @@ -608,10 +608,10 @@ // pos=demuxer->stream->tell(); if(pos>=endpos) return; // END - len=demuxer->stream->read_dword(); + len=demuxer->stream->read(type_dword); if(len<8) return; // error len-=8; - id=demuxer->stream->read_dword(); + id=demuxer->stream->read(type_dword); // MSG_DBG2("lschunks %.4s %d\n",&id,(int)len); // @@ -621,13 +621,13 @@ } else { /* not in track */ switch(id) { case MOV_FOURCC('m','v','h','d'): { - int version = demuxer->stream->read_char(); + int version = demuxer->stream->read(type_byte); demuxer->stream->skip( (version == 1) ? 19 : 11); - priv->timescale=demuxer->stream->read_dword(); + priv->timescale=demuxer->stream->read(type_dword); if (version == 1) - priv->duration=demuxer->stream->read_qword(); + priv->duration=demuxer->stream->read(type_qword); else - priv->duration=demuxer->stream->read_dword(); + priv->duration=demuxer->stream->read(type_dword); MSG_V("MOV: %*sMovie header (%d bytes): tscale=%d dur=%d\n",level,"",(int)len, (int)priv->timescale,(int)priv->duration); break; @@ -1316,14 +1316,14 @@ break; } case MOV_FOURCC('d','c','o','m'): { -// int temp=demuxer->stream->read_dword(); - unsigned int algo=be2me_32(demuxer->stream->read_dword()); +// int temp=demuxer->stream->read(type_dword); + unsigned int algo=be2me_32(demuxer->stream->read(type_dword)); MSG_V( "Compressed header uses %.4s algo!\n",&algo); break; } case MOV_FOURCC('c','m','v','d'): { -// int temp=demuxer->stream->read_dword(); - unsigned int moov_sz=demuxer->stream->read_dword(); +// int temp=demuxer->stream->read(type_dword); + unsigned int moov_sz=demuxer->stream->read(type_dword); unsigned int cmov_sz=len-4; unsigned char* cmov_buf=new unsigned char[cmov_sz]; unsigned char* moov_buf=new unsigned char[moov_sz+16]; @@ -1383,8 +1383,8 @@ while((len > 8) && (udta_size > 8)) { - udta_len = demuxer->stream->read_dword(); - udta_id = demuxer->stream->read_dword(); + udta_len = demuxer->stream->read(type_dword); + udta_id = demuxer->stream->read(type_dword); udta_size -= 8; MSG_DBG2( "udta_id: %.4s (len: %d)\n", &udta_id, udta_len); switch (udta_id) @@ -1406,7 +1406,7 @@ case MOV_FOURCC(0xa9,'a','u','t'): case MOV_FOURCC(0xa9,'s','w','r'): { - off_t text_len = demuxer->stream->read_word(); + off_t text_len = demuxer->stream->read(type_word); char text[text_len+2+1]; bp=demuxer->stream->read(text_len+2); memcpy(&text,bp.data(),bp.size()); @@ -1542,26 +1542,26 @@ break; } case MOV_FOURCC('m','d','h','d'): { - int version = demuxer->stream->read_char(); + int version = demuxer->stream->read(type_byte); MSG_V("MOV: %*sMedia header!\n", level, ""); demuxer->stream->skip( (version == 1) ? 19 : 11); // read timescale - trak->timescale = demuxer->stream->read_dword(); + trak->timescale = demuxer->stream->read(type_dword); // read length if (version == 1) - trak->length = demuxer->stream->read_qword(); + trak->length = demuxer->stream->read(type_qword); else - trak->length = demuxer->stream->read_dword(); + trak->length = demuxer->stream->read(type_dword); break; } case MOV_FOURCC('h','d','l','r'): { - demuxer->stream->read_dword(); - unsigned int type = demuxer->stream->read_dword_le(); - unsigned int subtype = demuxer->stream->read_dword_le(); - unsigned int manufact = demuxer->stream->read_dword_le(); - /*unsigned int comp_flags =*/ demuxer->stream->read_dword(); - /*unsigned int comp_mask =*/ demuxer->stream->read_dword(); - unsigned _len = demuxer->stream->read_char(); + demuxer->stream->read(type_dword); + unsigned int type = demuxer->stream->read_le(type_dword); + unsigned int subtype = demuxer->stream->read_le(type_dword); + unsigned int manufact = demuxer->stream->read_le(type_dword); + /*unsigned int comp_flags =*/ demuxer->stream->read(type_dword); + /*unsigned int comp_mask =*/ demuxer->stream->read(type_dword); + unsigned _len = demuxer->stream->read(type_byte); char* str = new char [_len + 1]; bp=demuxer->stream->read(_len); memcpy(str,bp.data(),bp.size()); @@ -1605,14 +1605,14 @@ break; } case MOV_FOURCC('s','t','s','d'): { - int i = demuxer->stream->read_dword(); // temp! - int count = demuxer->stream->read_dword(); + int i = demuxer->stream->read(type_dword); // temp! + int count = demuxer->stream->read(type_dword); MSG_V( "MOV: %*sDescription list! (cnt:%d)\n", level, "", count); for (i = 0; i < count; i++) { off_t _pos = demuxer->stream->tell(); - unsigned _len = demuxer->stream->read_dword(); - unsigned int fourcc = demuxer->stream->read_dword_le(); + unsigned _len = demuxer->stream->read(type_dword); + unsigned int fourcc = demuxer->stream->read_le(type_dword); /* some files created with Broadcast 2000 (e.g. ilacetest.mov) contain raw I420 video but have a yv12 fourcc */ if (fourcc == mmioFOURCC('y','v','1','2')) @@ -1639,15 +1639,15 @@ break; } case MOV_FOURCC('s','t','t','s'): { - demuxer->stream->read_dword(); - unsigned i,_len = demuxer->stream->read_dword(); + demuxer->stream->read(type_dword); + unsigned i,_len = demuxer->stream->read(type_dword); unsigned int pts = 0; MSG_V("MOV: %*sSample duration table! (%d blocks)\n", level, "", _len); trak->durmap = new mov_durmap_t[_len]; trak->durmap_size = _len; for (i = 0; i < _len; i++) { - trak->durmap[i].num = demuxer->stream->read_dword(); - trak->durmap[i].dur = demuxer->stream->read_dword(); + trak->durmap[i].num = demuxer->stream->read(type_dword); + trak->durmap[i].dur = demuxer->stream->read(type_dword); pts += trak->durmap[i].num * trak->durmap[i].dur; } if (trak->length != pts) @@ -1655,8 +1655,8 @@ break; } case MOV_FOURCC('s','t','s','c'): { - unsigned temp = demuxer->stream->read_dword(); - unsigned i,_len = demuxer->stream->read_dword(); + unsigned temp = demuxer->stream->read(type_dword); + unsigned i,_len = demuxer->stream->read(type_dword); unsigned ver = (temp << 24); unsigned flags = (temp << 16) | (temp << 8) | temp; MSG_V( "MOV: %*sSample->Chunk mapping table! (%d blocks) (ver:%d,flags:%ld)\n", level, "", @@ -1665,18 +1665,18 @@ trak->chunkmap_size = _len; trak->chunkmap = new mov_chunkmap_t[_len]; for (i = 0; i < _len; i++) { - trak->chunkmap[i].first = demuxer->stream->read_dword() - 1; - trak->chunkmap[i].spc = demuxer->stream->read_dword(); - trak->chunkmap[i].sdid = demuxer->stream->read_dword(); + trak->chunkmap[i].first = demuxer->stream->read(type_dword) - 1; + trak->chunkmap[i].spc = demuxer->stream->read(type_dword); + trak->chunkmap[i].sdid = demuxer->stream->read(type_dword); } break; } case MOV_FOURCC('s','t','s','z'): { - int temp = demuxer->stream->read_dword(); - int ss=demuxer->stream->read_dword(); + int temp = demuxer->stream->read(type_dword); + int ss=demuxer->stream->read(type_dword); int ver = (temp << 24); int flags = (temp << 16) | (temp << 8) | temp; - int entries = demuxer->stream->read_dword(); + int entries = demuxer->stream->read(type_dword); int i; MSG_V("MOV: %*sSample size table! (entries=%d ss=%d) (ver:%d,flags:%ld)\n", level, "", entries, ss, ver, flags); @@ -1688,13 +1688,13 @@ (mov_sample_t*)mp_calloc(entries, sizeof(mov_sample_t)); trak->samples_size = entries; for (i = 0; i < entries; i++) - trak->samples[i].size = demuxer->stream->read_dword(); + trak->samples[i].size = demuxer->stream->read(type_dword); } break; } case MOV_FOURCC('s','t','c','o'): { - demuxer->stream->read_dword(); - unsigned i,_len = demuxer->stream->read_dword(); + demuxer->stream->read(type_dword); + unsigned i,_len = demuxer->stream->read(type_dword); MSG_V( "MOV: %*sChunk offset table! (%d chunks)\n", level, "", _len); // extend array if needed: @@ -1706,12 +1706,12 @@ } // read elements: for(i = 0; i < _len; i++) - trak->chunks[i].pos = demuxer->stream->read_dword(); + trak->chunks[i].pos = demuxer->stream->read(type_dword); break; } case MOV_FOURCC('c','o','6','4'): { - demuxer->stream->read_dword(); - unsigned i,_len = demuxer->stream->read_dword(); + demuxer->stream->read(type_dword); + unsigned i,_len = demuxer->stream->read(type_dword); MSG_V( "MOV: %*s64bit chunk offset table! (%d chunks)\n", level, "", _len); // extend array if needed: @@ -1724,18 +1724,18 @@ // read elements: for (i = 0; i < _len; i++) { #ifndef _LARGEFILE_SOURCE - if (demuxer->stream->read_dword() != 0) + if (demuxer->stream->read(type_dword) != 0) MSG_WARN( "Chunk %d has got 64bit address, but you'... [truncated message content] |
From: <nic...@us...> - 2013-06-11 17:36:47
|
Revision: 652 http://sourceforge.net/p/mplayerxp/code/652 Author: nickols_k Date: 2013-06-11 17:36:43 +0000 (Tue, 11 Jun 2013) Log Message: ----------- convert decaudio(video)_priv_t -> class A(V)D_Interface Modified Paths: -------------- mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_a52.cpp mplayerxp/libmpcodecs/ad_dca.cpp mplayerxp/libmpcodecs/ad_dvdpcm.cpp mplayerxp/libmpcodecs/ad_faad.cpp mplayerxp/libmpcodecs/ad_lavc.cpp mplayerxp/libmpcodecs/ad_libdv.cpp mplayerxp/libmpcodecs/ad_mp3.cpp mplayerxp/libmpcodecs/ad_null.cpp mplayerxp/libmpcodecs/ad_pcm.cpp mplayerxp/libmpcodecs/ad_real.cpp mplayerxp/libmpcodecs/ad_vorbis.cpp mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_divx4.cpp mplayerxp/libmpcodecs/vd_huffyuv.cpp mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libdv.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpcodecs/vd_mpegpes.cpp mplayerxp/libmpcodecs/vd_null.cpp mplayerxp/libmpcodecs/vd_nuv.cpp mplayerxp/libmpcodecs/vd_raw.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpcodecs/vd_theora.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpcodecs/vd_xvid.cpp mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/xmpcore/xmp_adecoder.cpp mplayerxp/xmpcore/xmp_aplayer.cpp mplayerxp/xmpcore/xmp_image.cpp mplayerxp/xmpcore/xmp_image.h mplayerxp/xmpcore/xmp_vdecoder.cpp Removed Paths: ------------- mplayerxp/libmpcodecs/ad_internal.h mplayerxp/libmpcodecs/vd_internal.h Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -12,6 +12,7 @@ #include "libmpstream2/stream.h" #include "libmpdemux/demuxer.h" #include "libmpdemux/stheader.h" +#include "dec_audio.h" #include "ad.h" #include "ad_msg.h" @@ -64,7 +65,7 @@ } } -const ad_info_t* afm_find_driver(const std::string& name) { +const ad_info_t* AD_Interface::find_driver(const std::string& name) const { unsigned i; for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { if(name==mpcodecs_ad_drivers[i]->driver_name) @@ -73,7 +74,7 @@ return NULL; } -Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) { +Audio_Decoder* AD_Interface::probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) const { unsigned i; Audio_Decoder* drv=NULL; for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { @@ -108,7 +109,7 @@ return drv; } -void afm_help() { +void AD_Interface::print_help() { unsigned i; mpxp_info<<"Available audio codec families/drivers:"<<std::endl; for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad.h 2013-06-11 17:36:43 UTC (rev 652) @@ -58,8 +58,6 @@ const mpxp_option_t* options; }; - const ad_info_t* afm_find_driver(const std::string& name); - Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi); inline float FIX_APTS(sh_audio_t& sh_audio,float& pts,unsigned in_size) { return sh_audio.i_bps?(pts+float(in_size))/float(sh_audio.i_bps):pts; } } //namespace usr Modified: mplayerxp/libmpcodecs/ad_a52.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -3,11 +3,11 @@ using namespace usr; #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #define __USE_XOPEN 1 #include <unistd.h> #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" #include "liba52/a52.h" #include "codecs_ld.h" @@ -16,6 +16,10 @@ #include "osdep/cpudetect.h" #include "osdep/bswap.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + #include "osdep/mm_accel.h" #include "mplayerxp.h" #include "libao3/afmt.h" Modified: mplayerxp/libmpcodecs/ad_dca.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -7,7 +7,6 @@ #include <unistd.h> #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" #include "codecs_ld.h" #include "mplayerxp.h" @@ -22,6 +21,10 @@ #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class dca_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_dvdpcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -4,10 +4,13 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include "ad_internal.h" #include "osdep/bswap.h" #include "libao3/afmt.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class dvdpcm_decoder : public Audio_Decoder { Modified: mplayerxp/libmpcodecs/ad_faad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_faad.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_faad.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -14,7 +14,6 @@ #include "mpxp_help.h" #include "osdep/bswap.h" #include "codecs_ld.h" -#include "ad_internal.h" #include "mplayerxp.h" #include "osdep/cpudetect.h" #include "osdep/mm_accel.h" @@ -22,6 +21,10 @@ #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { typedef any_t* NeAACDecHandle; typedef struct NeAACDecConfiguration { Deleted: mplayerxp/libmpcodecs/ad_internal.h =================================================================== --- mplayerxp/libmpcodecs/ad_internal.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_internal.h 2013-06-11 17:36:43 UTC (rev 652) @@ -1,12 +0,0 @@ -#ifdef __AD_ACM /* simply ugly hack */ -#include "win32loader/wine/msacm.h" -#endif -#include "libmpconf/codec-cfg.h" -#include "libmpdemux/demuxer_r.h" - -#include "ad.h" - -#include "ad_msg.h" - -namespace usr { -} // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/ad_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_lavc.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_lavc.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -9,7 +9,6 @@ #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "libao3/afmt.h" -#include "ad_internal.h" #include "mpxp_help.h" #include "osdep/bswap.h" @@ -18,6 +17,10 @@ #include "mpxp_conf_lavc.h" #include "codecs_ld.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class alavc_decoder: public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_libdv.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -18,8 +18,11 @@ #include "libmpdemux/stheader.h" #include "libao3/afmt.h" #include "osdep/bswap.h" -#include "ad_internal.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class libadv_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_mp3.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_mp3.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -5,7 +5,6 @@ #include <stdlib.h> #include <unistd.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" #include "mplayerxp.h" #include "osdep/cpudetect.h" #include "osdep/mm_accel.h" @@ -16,6 +15,10 @@ #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { /** Opaque structure for the libmpg123 decoder handle. */ struct mpg123_handle_struct; Modified: mplayerxp/libmpcodecs/ad_null.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_null.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_null.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -4,8 +4,11 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include "ad_internal.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class anull_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_pcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_pcm.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -4,10 +4,13 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> -#include "ad_internal.h" #include "libao3/afmt.h" #include "osdep/bswap.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { class pcm_decoder : public Audio_Decoder { public: Modified: mplayerxp/libmpcodecs/ad_real.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_real.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_real.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -9,12 +9,16 @@ #include <stddef.h> #include <dlfcn.h> -#include "ad_internal.h" #include "codecs_ld.h" #include "ad_msg.h" #include "osdep/bswap.h" #include "libao3/afmt.h" +#include "libmpconf/codec-cfg.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { struct ra_init_t { int samplerate; Modified: mplayerxp/libmpcodecs/ad_vorbis.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -11,11 +11,14 @@ #include "osdep/bswap.h" #include "codecs_ld.h" -#include "ad_internal.h" #include "libao3/afmt.h" #include "libao3/audio_out.h" #include "postproc/af.h" +#include "libmpdemux/demuxer_r.h" +#include "ad.h" +#include "ad_msg.h" + namespace usr { // This struct is also defined in demux_ogg.c => common header ? class vorbis_decoder : public Audio_Decoder { Modified: mplayerxp/libmpcodecs/dec_audio.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_audio.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -32,159 +32,150 @@ struct decaudio_priv_t : public Opaque { public: - decaudio_priv_t(); + decaudio_priv_t(sh_audio_t& sh); virtual ~decaudio_priv_t(); - sh_audio_t* parent; + sh_audio_t& parent; Audio_Decoder* mpadec; - audio_filter_info_t* afi; + audio_filter_info_t& afi; }; -decaudio_priv_t::decaudio_priv_t() - :afi(new(zeromem) audio_filter_info_t) +decaudio_priv_t::decaudio_priv_t(sh_audio_t& sh) + :parent(sh) + ,afi(*new(zeromem) audio_filter_info_t) { } -decaudio_priv_t::~decaudio_priv_t() { delete afi; } +decaudio_priv_t::~decaudio_priv_t() { delete &afi; } -audio_decoder_t* mpca_init(sh_audio_t *sh_audio) +AD_Interface::AD_Interface(sh_audio_t& sh) + :ad_private(*new(zeromem) decaudio_priv_t(sh)) { + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); const char *afm=NULL,*ac=NULL; - audio_decoder_t* handle=new(zeromem) audio_decoder_t; - decaudio_priv_t* priv = new(zeromem) decaudio_priv_t; - priv->parent=sh_audio; - handle->ad_private=priv; if(mp_conf.audio_family) afm=mp_conf.audio_family; if(afm) { - const ad_info_t* ai=afm_find_driver(afm); + const ad_info_t* ai=find_driver(afm); try{ /* Set up some common usefull defaults. ad->preinit() can override these: */ #ifdef WORDS_BIGENDIAN - sh_audio->afmt=AFMT_S16_BE; + sh.afmt=AFMT_S16_BE; #else - sh_audio->afmt=AFMT_S16_LE; + sh.afmt=AFMT_S16_LE; #endif - sh_audio->rate=0; - sh_audio->o_bps=0; - priv->mpadec=ai->query_interface(*sh_audio,*priv->afi,sh_audio->wtag); + sh.rate=0; + sh.o_bps=0; + priv.mpadec=ai->query_interface(sh,priv.afi,sh.wtag); } catch(const bad_format_exception&) { MSG_ERR(MSGTR_CODEC_BAD_AFAMILY,ac, afm); goto bye; } } - else priv->mpadec = afm_probe_driver(*sh_audio,*priv->afi); - if(!priv->mpadec) { + else priv.mpadec = probe_driver(sh,priv.afi); + if(!priv.mpadec) { bye: - delete handle; - delete priv->mpadec; - delete priv; - return NULL; + delete priv.mpadec; + delete &priv; + throw missing_driver_exception(); } - audio_probe_t aprobe=priv->mpadec->get_probe_information(); + audio_probe_t aprobe=priv.mpadec->get_probe_information(); afm=aprobe.driver; ac=aprobe.codec_dll; /* fake struct codecs_st*/ - sh_audio->codec=new(zeromem) struct codecs_st; - strcpy(sh_audio->codec->dll_name,aprobe.codec_dll); - strcpy(sh_audio->codec->driver_name,aprobe.driver); - strcpy(sh_audio->codec->codec_name,sh_audio->codec->dll_name); - memcpy(sh_audio->codec->outfmt,aprobe.sample_fmt,sizeof(aprobe.sample_fmt)); + sh.codec=new(zeromem) struct codecs_st; + strcpy(sh.codec->dll_name,aprobe.codec_dll); + strcpy(sh.codec->driver_name,aprobe.driver); + strcpy(sh.codec->codec_name,sh.codec->dll_name); + memcpy(sh.codec->outfmt,aprobe.sample_fmt,sizeof(aprobe.sample_fmt)); /* reset in/out buffer size/pointer: */ - sh_audio->a_buffer_size=0; - sh_audio->a_buffer=NULL; - sh_audio->a_in_buffer_size=0; - sh_audio->a_in_buffer=NULL; + sh.a_buffer_size=0; + sh.a_buffer=NULL; + sh.a_in_buffer_size=0; + sh.a_in_buffer=NULL; - if(sh_audio->wf) /* NK: We need to know i_bps before its detection by codecs param */ - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; + if(sh.wf) /* NK: We need to know i_bps before its detection by codecs param */ + sh.i_bps=sh.wf->nAvgBytesPerSec; - sh_audio->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/ - sh_audio->audio_in_minsize=0; + sh.audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/ + sh.audio_in_minsize=0; /* allocate audio in buffer: */ - if(sh_audio->audio_in_minsize>0){ - sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize; - mpxp_v<<"dec_audio: Allocating "<<sh_audio->a_in_buffer_size<<" bytes for input buffer"<<std::endl; - sh_audio->a_in_buffer=new char [sh_audio->a_in_buffer_size]; - sh_audio->a_in_buffer_len=0; + if(sh.audio_in_minsize>0){ + sh.a_in_buffer_size=sh.audio_in_minsize; + mpxp_v<<"dec_audio: Allocating "<<sh.a_in_buffer_size<<" bytes for input buffer"<<std::endl; + sh.a_in_buffer=new char [sh.a_in_buffer_size]; + sh.a_in_buffer_len=0; } /* allocate audio out buffer: */ - sh_audio->a_buffer_size=sh_audio->audio_out_minsize+MAX_OUTBURST; /* worst case calc.*/ + sh.a_buffer_size=sh.audio_out_minsize+MAX_OUTBURST; /* worst case calc.*/ - mpxp_v<<"dec_audio: Allocating "<<sh_audio->audio_out_minsize<<" + "<<MAX_OUTBURST - <<" = "<<sh_audio->a_buffer_size<<" bytes for output buffer"<<std::endl; + mpxp_v<<"dec_audio: Allocating "<<sh.audio_out_minsize<<" + "<<MAX_OUTBURST + <<" = "<<sh.a_buffer_size<<" bytes for output buffer"<<std::endl; - sh_audio->a_buffer=new char [sh_audio->a_buffer_size]; - if(!sh_audio->a_buffer) { + sh.a_buffer=new char [sh.a_buffer_size]; + if(!sh.a_buffer) { MSG_ERR(MSGTR_CantAllocAudioBuf); - delete priv; - delete handle; - return NULL; + goto bye; } - sh_audio->a_buffer_len=0; - sh_audio->inited=1; + sh.a_buffer_len=0; + sh.inited=1; - if(!sh_audio->nch || !sh_audio->rate) { - mpxp_v<<"audio format wrong: nch="<<sh_audio->nch<<" rate="<<sh_audio->rate<<std::endl; + if(!sh.nch || !sh.rate) { + mpxp_v<<"audio format wrong: nch="<<sh.nch<<" rate="<<sh.rate<<std::endl; MSG_WARN(MSGTR_UnknownAudio); - mpca_uninit(*handle); /* mp_free buffers */ - return NULL; + goto bye; } - if(!sh_audio->o_bps) - sh_audio->o_bps=sh_audio->nch*sh_audio->rate*afmt2bps(sh_audio->afmt); - if(!sh_audio->i_bps) { + if(!sh.o_bps) + sh.o_bps=sh.nch*sh.rate*afmt2bps(sh.afmt); + if(!sh.i_bps) { static int warned=0; if(!warned) { warned=1; MSG_WARN(MSGTR_CODEC_INITAL_AV_RESYNC); } } else if(mpxp_context().engine().xp_core->initial_apts_corr.need_correction==1) { - mpxp_context().engine().xp_core->initial_apts += ((float)(mpxp_context().engine().xp_core->initial_apts_corr.pts_bytes-mpxp_context().engine().xp_core->initial_apts_corr.nbytes))/(float)sh_audio->i_bps; + mpxp_context().engine().xp_core->initial_apts += ((float)(mpxp_context().engine().xp_core->initial_apts_corr.pts_bytes-mpxp_context().engine().xp_core->initial_apts_corr.nbytes))/(float)sh.i_bps; mpxp_context().engine().xp_core->initial_apts_corr.need_correction=0; } - mpxp_ok<<"[AC] "<<(mp_conf.audio_codec?"Forcing":"Selecting")<<" drv:"<<aprobe.driver<<"."<<ac<<" ratio "<<sh_audio->i_bps<<"->"<<sh_audio->o_bps<<std::endl; - if(sh_audio->codec) { delete sh_audio->codec; sh_audio->codec=NULL; } - return handle; + mpxp_ok<<"[AC] "<<(mp_conf.audio_codec?"Forcing":"Selecting")<<" drv:"<<aprobe.driver<<"."<<ac<<" ratio "<<sh.i_bps<<"->"<<sh.o_bps<<std::endl; + if(sh.codec) { delete sh.codec; sh.codec=NULL; } } -void mpca_uninit(audio_decoder_t& opaque) +AD_Interface::~AD_Interface() { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* parent = priv->parent; - if(!parent) { delete &opaque; delete priv; return; } - if(priv->afi->afilter){ + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; + if(priv.afi.afilter){ mpxp_v<<"Uninit audio filters..."<<std::endl; - af_uninit(priv->afi->afilter); - delete priv->afi->afilter; - priv->afi->afilter=NULL; + af_uninit(priv.afi.afilter); + delete priv.afi.afilter; + priv.afi.afilter=NULL; } - if(parent->a_buffer) delete parent->a_buffer; - parent->a_buffer=NULL; - if(parent->a_in_buffer) delete parent->a_in_buffer; - parent->a_in_buffer=NULL; - if(!parent->inited) { delete &opaque; delete priv; return; } + if(sh.a_buffer) delete sh.a_buffer; + sh.a_buffer=NULL; + if(sh.a_in_buffer) delete sh.a_in_buffer; + sh.a_in_buffer=NULL; + if(!sh.inited) { delete &priv; return; } mpxp_v<<"uninit audio: ..."<<std::endl; - if(parent->a_buffer) delete parent->a_buffer; - parent->a_buffer=NULL; - parent->inited=0; - delete priv; - delete &opaque; + if(sh.a_buffer) delete sh.a_buffer; + sh.a_buffer=NULL; + sh.inited=0; + delete &priv; } /* Init audio filters */ -MPXP_Rc mpca_preinit_filters(audio_decoder_t& opaque, - unsigned in_samplerate, unsigned in_channels, unsigned in_format, - unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format){ - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; +MPXP_Rc AD_Interface::preinit_filters(unsigned in_samplerate, unsigned in_channels, unsigned in_format, + unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format) const { + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; char strbuf[200]; - af_stream_t* afs=af_new(sh_audio); + af_stream_t* afs=af_new(&sh); // input format: same as codec's output format: afs->input.rate = in_samplerate; @@ -213,25 +204,24 @@ out_channels=afs->output.nch; out_format=mpaf2afmt(afs->output.format); - sh_audio->af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); + sh.af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); mpxp_v<<"AF_pre: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate<<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200) - <<" af_bps="<<sh_audio->af_bps<<std::endl; + <<" af_bps="<<sh.af_bps<<std::endl; - priv->afi->afilter=afs; + priv.afi.afilter=afs; return MPXP_Ok; } /* Init audio filters */ -MPXP_Rc mpca_init_filters(audio_decoder_t& opaque, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, +MPXP_Rc AD_Interface::init_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize){ - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; + unsigned out_minsize, unsigned out_maxsize) const { + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; char strbuf[200]; - af_stream_t* afs=priv->afi->afilter; - if(!afs) afs = af_new(sh_audio); + af_stream_t* afs=priv.afi.afilter; + if(!afs) afs = af_new(&sh); // input format: same as codec's output format: afs->input.rate = in_samplerate; @@ -252,7 +242,7 @@ // let's autoprobe it! if(MPXP_Ok != af_init(afs,1)){ - priv->afi->afilter=NULL; + priv.afi.afilter=NULL; delete afs; return MPXP_False; // failed :( } @@ -261,80 +251,79 @@ if(out_maxsize<out_minsize) out_maxsize=out_minsize; if(out_maxsize<8192) out_maxsize=MAX_OUTBURST; // not sure this is ok - sh_audio->af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); + sh.af_bps = afs->output.rate*afs->output.nch*(afs->output.format&MPAF_BPS_MASK); mpxp_v<<"AF_init: af format: "<<afs->output.nch<<" ch, "<<afs->output.rate - <<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200)<<" af_bps="<<sh_audio->af_bps<<std::endl; + <<" hz, "<<mpaf_fmt2str(afs->output.format,strbuf,200)<<" af_bps="<<sh.af_bps<<std::endl; - sh_audio->a_buffer_size=out_maxsize; - sh_audio->a_buffer=new char [sh_audio->a_buffer_size]; - sh_audio->a_buffer_len=0; + sh.a_buffer_size=out_maxsize; + sh.a_buffer=new char [sh.a_buffer_size]; + sh.a_buffer_len=0; af_showconf(afs->first); - priv->afi->afilter=afs; - priv->afi->afilter_inited=1; + priv.afi.afilter=afs; + priv.afi.afilter_inited=1; return MPXP_Ok; } /* Init audio filters */ -MPXP_Rc mpca_reinit_filters(audio_decoder_t& opaque, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, +MPXP_Rc AD_Interface::reinit_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize) + unsigned out_minsize, unsigned out_maxsize) const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - if(priv->afi->afilter){ + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + if(priv.afi.afilter){ mpxp_v<<"Uninit audio filters..."<<std::endl; - af_uninit(priv->afi->afilter); - delete priv->afi->afilter; - priv->afi->afilter=NULL; + af_uninit(priv.afi.afilter); + delete priv.afi.afilter; + priv.afi.afilter=NULL; } - return mpca_init_filters(opaque,in_samplerate,in_channels, - in_format,out_samplerate, - out_channels,out_format, - out_minsize,out_maxsize); + return init_filters(in_samplerate,in_channels, + in_format,out_samplerate, + out_channels,out_format, + out_minsize,out_maxsize); } -unsigned mpca_decode(audio_decoder_t& opaque,unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts) +unsigned AD_Interface::run(unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts) const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; unsigned len; unsigned cp_size,cp_tile; - if(!sh_audio->inited) return 0; // no codec + if(!sh.inited) return 0; // no codec if(minlen>maxlen) MSG_WARN(MSGTR_CODEC_XP_INT_ERR,minlen,maxlen); - if(sh_audio->af_buffer_len) { - cp_size=std::min(buflen,sh_audio->af_buffer_len); - memcpy(buf,sh_audio->af_buffer,cp_size); - pts = sh_audio->af_pts; - cp_tile=sh_audio->af_buffer_len-cp_size; - mpxp_dbg2<<"cache->buf "<<cp_size<<" bytes "<<pts<<" pts <PREDICTED PTS "<<(pts+(float)cp_tile/(float)sh_audio->af_bps)<<">"<<std::endl; + if(sh.af_buffer_len) { + cp_size=std::min(buflen,sh.af_buffer_len); + memcpy(buf,sh.af_buffer,cp_size); + pts = sh.af_pts; + cp_tile=sh.af_buffer_len-cp_size; + mpxp_dbg2<<"cache->buf "<<cp_size<<" bytes "<<pts<<" pts <PREDICTED PTS "<<(pts+(float)cp_tile/(float)sh.af_bps)<<">"<<std::endl; if(cp_tile) { - sh_audio->af_buffer=&sh_audio->af_buffer[cp_size]; - sh_audio->af_buffer_len=cp_tile; - sh_audio->af_pts += (float)cp_size/(float)sh_audio->af_bps; + sh.af_buffer=&sh.af_buffer[cp_size]; + sh.af_buffer_len=cp_tile; + sh.af_pts += (float)cp_size/(float)sh.af_bps; } - else sh_audio->af_buffer_len=0; + else sh.af_buffer_len=0; return cp_size; } - if(sh_audio->af_bps>sh_audio->o_bps) - maxlen=std::min(maxlen,buflen*sh_audio->o_bps/sh_audio->af_bps); - len=priv->mpadec->run(buf, minlen, maxlen,pts); - if(len>buflen) MSG_WARN(MSGTR_CODEC_BUF_OVERFLOW,sh_audio->codec->driver_name,len,buflen); - mpxp_dbg2<<"decaudio: "<<len<<" bytes "<<pts<<" pts min "<<minlen<<" max "<<maxlen<<" buflen "<<buflen<<" o_bps="<<sh_audio->o_bps<<" f_bps="<<sh_audio->af_bps<<std::endl; - if(len==0 || !priv->afi->afilter) return 0; // EOF? + if(sh.af_bps>sh.o_bps) + maxlen=std::min(maxlen,buflen*sh.o_bps/sh.af_bps); + len=priv.mpadec->run(buf, minlen, maxlen,pts); + if(len>buflen) MSG_WARN(MSGTR_CODEC_BUF_OVERFLOW,sh.codec->driver_name,len,buflen); + mpxp_dbg2<<"decaudio: "<<len<<" bytes "<<pts<<" pts min "<<minlen<<" max "<<maxlen<<" buflen "<<buflen<<" o_bps="<<sh.o_bps<<" f_bps="<<sh.af_bps<<std::endl; + if(len==0 || !priv.afi.afilter) return 0; // EOF? // run the filters: mp_aframe_t* afd; // filter input mp_aframe_t* pafd; // filter output - afd=new_mp_aframe( sh_audio->rate, - sh_audio->nch, - afmt2mpaf(sh_audio->afmt) + afd=new_mp_aframe( sh.rate, + sh.nch, + afmt2mpaf(sh.afmt) ,0); // xp_idx afd->audio=buf; afd->len=len; - pafd=af_play(priv->afi->afilter,afd); + pafd=af_play(priv.afi.afilter,afd); afd->audio=NULL; // fake no buffer if(!pafd) { @@ -349,36 +338,33 @@ memcpy(buf,pafd->audio,cp_size); cp_tile=pafd->len-cp_size; if(cp_tile) { - sh_audio->af_buffer=&((char *)pafd->audio)[cp_size]; - sh_audio->af_buffer_len=cp_tile; - sh_audio->af_pts = pts+(float)cp_size/(float)sh_audio->af_bps; + sh.af_buffer=&((char *)pafd->audio)[cp_size]; + sh.af_buffer_len=cp_tile; + sh.af_pts = pts+(float)cp_size/(float)sh.af_bps; mpxp_dbg2<<"decaudio: afilter->cache "<<cp_tile<<" bytes "<<pts<<" pts"<<std::endl; - } else sh_audio->af_buffer_len=0; + } else sh.af_buffer_len=0; if(pafd!=afd) free_mp_aframe(pafd); free_mp_aframe(afd); return cp_size; } /* Note: it is called once after seeking, to resync. */ -void mpca_resync_stream(audio_decoder_t& opaque) +void AD_Interface::resync_stream() const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; - if(sh_audio) { - sh_audio->a_in_buffer_len=0; /* workaround */ - if(sh_audio->inited && priv->mpadec) priv->mpadec->ctrl(ADCTRL_RESYNC_STREAM,NULL); - } + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; + sh.a_in_buffer_len=0; /* workaround */ + if(sh.inited && priv.mpadec) priv.mpadec->ctrl(ADCTRL_RESYNC_STREAM,NULL); } /* Note: it is called to skip (jump over) small amount (1/10 sec or 1 frame) of audio data - used to sync audio to video after seeking */ -void mpca_skip_frame(audio_decoder_t& opaque) +void AD_Interface::skip_frame() const { - decaudio_priv_t* priv = reinterpret_cast<decaudio_priv_t*>(opaque.ad_private); - sh_audio_t* sh_audio = priv->parent; + decaudio_priv_t& priv = reinterpret_cast<decaudio_priv_t&>(ad_private); + sh_audio_t& sh = priv.parent; MPXP_Rc rc=MPXP_True; - if(sh_audio) - if(sh_audio->inited && priv->mpadec) rc=priv->mpadec->ctrl(ADCTRL_SKIP_FRAME,NULL); - if(rc!=MPXP_True) sh_audio->ds->fill_buffer(); + if(sh.inited && priv.mpadec) rc=priv.mpadec->ctrl(ADCTRL_SKIP_FRAME,NULL); + if(rc!=MPXP_True) sh.ds->fill_buffer(); } } // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/dec_audio.h =================================================================== --- mplayerxp/libmpcodecs/dec_audio.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_audio.h 2013-06-11 17:36:43 UTC (rev 652) @@ -6,28 +6,29 @@ struct codecs_st; namespace usr { - struct audio_decoder_t { - Opaque* ad_private; - }; + class AD_Interface : public Opaque { + public: + AD_Interface(sh_audio_t& sh_audio); + virtual ~AD_Interface(); - // dec_audio.c: - audio_decoder_t* __FASTCALL__ mpca_init(sh_audio_t *sh_audio); - void __FASTCALL__ mpca_uninit(audio_decoder_t& handle); - unsigned __FASTCALL__ mpca_decode(audio_decoder_t& handle,unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts); - void __FASTCALL__ mpca_resync_stream(audio_decoder_t& handle); - void __FASTCALL__ mpca_skip_frame(audio_decoder_t& handle); + virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,unsigned buflen,float& pts) const; + virtual void resync_stream() const; + virtual void skip_frame() const; - MPXP_Rc mpca_init_filters(audio_decoder_t& sh_audio, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, - unsigned out_samplerate, unsigned out_channels,mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize); - MPXP_Rc mpca_preinit_filters(audio_decoder_t& sh_audio, - unsigned in_samplerate, unsigned in_channels, unsigned in_format, - unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format); - MPXP_Rc mpca_reinit_filters(audio_decoder_t& sh_audio, - unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, - unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, - unsigned out_minsize, unsigned out_maxsize); - void afm_help(void); + virtual MPXP_Rc init_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, + unsigned out_samplerate, unsigned out_channels,mpaf_format_e out_format, + unsigned out_minsize, unsigned out_maxsize) const; + virtual MPXP_Rc preinit_filters(unsigned in_samplerate, unsigned in_channels, unsigned in_format, + unsigned& out_samplerate, unsigned& out_channels, unsigned& out_format) const; + virtual MPXP_Rc reinit_filters(unsigned in_samplerate, unsigned in_channels, mpaf_format_e in_format, + unsigned out_samplerate, unsigned out_channels, mpaf_format_e out_format, + unsigned out_minsize, unsigned out_maxsize) const; + static void print_help(); + private: + const ad_info_t* find_driver(const std::string& name) const; + Audio_Decoder* probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) const; + + Opaque& ad_private; + }; } //namespace usr #endif Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -37,6 +37,7 @@ #include "osdep/cpudetect.h" #include "vd_msg.h" +#include "libvo2/video_out.h" // =================================================================== namespace usr { vf_cfg_t vf_cfg; // Configuration for audio filters @@ -48,162 +49,160 @@ struct decvideo_priv_t : public Opaque { public: - decvideo_priv_t(libinput_t&); + decvideo_priv_t(libinput_t&,sh_video_t&); virtual ~decvideo_priv_t(); - sh_video_t* parent; + sh_video_t& parent; + libinput_t& libinput; + put_slice_info_t& psi; Video_Decoder* mpvdec; - libinput_t& libinput; vf_stream_t* vfilter; int vfilter_inited; - put_slice_info_t* psi; + unsigned smp_num_cpus; + unsigned use_vf_threads; + float sub_last_pts; }; -decvideo_priv_t::decvideo_priv_t(libinput_t& _libinput) - :libinput(_libinput), - psi(new(zeromem) put_slice_info_t) +decvideo_priv_t::decvideo_priv_t(libinput_t& _libinput,sh_video_t& p) + :parent(p) + ,libinput(_libinput) + ,psi(*new(zeromem) put_slice_info_t) + ,smp_num_cpus(1) + ,sub_last_pts(-303) { } -decvideo_priv_t::~decvideo_priv_t() { delete psi; } +decvideo_priv_t::~decvideo_priv_t() { delete ψ } -MPXP_Rc mpcv_get_quality_max(video_decoder_t& opaque,unsigned& quality){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - if(priv->mpvdec){ - MPXP_Rc ret=priv->mpvdec->ctrl(VDCTRL_QUERY_MAX_PP_LEVEL,&quality); +MPXP_Rc VD_Interface::get_quality_max(unsigned& quality) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + if(priv.mpvdec){ + MPXP_Rc ret=priv.mpvdec->ctrl(VDCTRL_QUERY_MAX_PP_LEVEL,&quality); if(ret>=MPXP_Ok) return ret; } return MPXP_False; } -MPXP_Rc mpcv_set_quality(video_decoder_t& opaque,int quality){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - if(priv->mpvdec) - return priv->mpvdec->ctrl(VDCTRL_SET_PP_LEVEL, (any_t*)(&quality)); +MPXP_Rc VD_Interface::set_quality(int quality) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + if(priv.mpvdec) return priv.mpvdec->ctrl(VDCTRL_SET_PP_LEVEL, (any_t*)(&quality)); return MPXP_False; } -MPXP_Rc mpcv_set_colors(video_decoder_t& opaque,const std::string& item,int value) +MPXP_Rc VD_Interface::set_colors(const std::string& item,int value) const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - vf_stream_t* vs=priv->vfilter; + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + vf_stream_t* vs=priv.vfilter; vf_equalizer_t eq; eq.item=item.c_str(); eq.value=value*10; if(vf_control(vs,VFCTRL_SET_EQUALIZER,&eq)!=MPXP_True) { - if(priv->mpvdec) return priv->mpvdec->ctrl(VDCTRL_SET_EQUALIZER,(any_t*)item.c_str(),value); + if(priv.mpvdec) return priv.mpvdec->ctrl(VDCTRL_SET_EQUALIZER,(any_t*)item.c_str(),value); } return MPXP_False; } -void mpcv_uninit(video_decoder_t& opaque){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh_video = priv->parent; - if(!sh_video->inited) { delete priv; delete &opaque; return; } +VD_Interface::~VD_Interface(){ + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh_video = priv.parent; + if(!sh_video.inited) { delete &priv; return; } mpxp_v<<"uninit video ..."<<std::endl; - if(priv->vfilter && priv->vfilter_inited==1) vf_uninit(priv->vfilter); - delete priv->mpvdec; - sh_video->inited=0; - delete priv; - delete &opaque; + if(priv.vfilter && priv.vfilter_inited==1) vf_uninit(priv.vfilter); + delete priv.mpvdec; + sh_video.inited=0; + delete &priv; } -#include "libvo2/video_out.h" #define MPDEC_THREAD_COND (VF_FLAGS_THREADS|VF_FLAGS_SLICES) -static unsigned smp_num_cpus=1; -static unsigned use_vf_threads=0; -static void mpcv_print_codec_info(decvideo_priv_t& priv) { - sh_video_t* sh_video = priv.parent; - mpxp_ok<<"[VC] "<<(mp_conf.video_codec?"Forcing":"Selected")<<" decoder: ["<<sh_video->codec->codec_name - <<"] drv:"<<priv.mpvdec->get_probe_information().driver<<"."<<sh_video->codec->dll_name - <<" ("<<sh_video->src_w<<"x"<<sh_video->src_h<<" (aspect "<<sh_video->aspect<<") "<<sh_video->fps<<"fps"<<std::endl; +void VD_Interface::print_codec_info() const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + mpxp_ok<<"[VC] "<<(mp_conf.video_codec?"Forcing":"Selected")<<" decoder: ["<<sh.codec->codec_name + <<"] drv:"<<priv.mpvdec->get_probe_information().driver<<"."<<sh.codec->dll_name + <<" ("<<sh.src_w<<"x"<<sh.src_h<<" (aspect "<<sh.aspect<<") "<<sh.fps<<"fps"<<std::endl; // Yeah! We got it! - sh_video->inited=1; - priv.psi->vf_flags=vf_query_flags(priv.vfilter); + sh.inited=1; + priv.psi.vf_flags=vf_query_flags(priv.vfilter); #ifdef _OPENMP if(mp_conf.gomp) { - smp_num_cpus=omp_get_num_procs(); - use_vf_threads=0; - if(((priv.psi->vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (smp_num_cpus>1)) use_vf_threads=1; - if(use_vf_threads) - mpxp_status<<"[mpdec] will perform parallel video-filter on "<<smp_num_cpus<<" CPUs"<<std::endl; + priv.smp_num_cpus=omp_get_num_procs(); + priv.use_vf_threads=0; + if(((priv.psi.vf_flags&MPDEC_THREAD_COND)==MPDEC_THREAD_COND) && (priv.smp_num_cpus>1)) priv.use_vf_threads=1; + if(priv.use_vf_threads) + mpxp_status<<"[mpdec] will perform parallel video-filter on "<<priv.smp_num_cpus<<" CPUs"<<std::endl; } #else mpxp_v<<"[mpdec] GOMP was not compiled-in! Using single threaded video filtering!"<<std::endl; #endif } -video_decoder_t* mpcv_init(sh_video_t *sh_video,const std::string& codecname,const std::string& family,int status,libinput_t&libinput){ +VD_Interface::VD_Interface(sh_video_t& sh,const std::string& codecname,const std::string& family,int status,libinput_t&libinput) + :vd_private(*new(zeromem) decvideo_priv_t(libinput,sh)) +{ + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); UNUSED(codecname); UNUSED(status); - sh_video->codec=NULL; - video_decoder_t* handle=new(zeromem) video_decoder_t; - decvideo_priv_t* priv = new(zeromem) decvideo_priv_t(libinput); - priv->parent=sh_video; - handle->vd_private=priv; + sh.codec=NULL; std::string vfm=family; MP_UNIT("init_video_filters"); - if(priv->vfilter_inited<=0) { + if(priv.vfilter_inited<=0) { vf_conf_t conf; - conf.w=sh_video->src_w; - conf.h=sh_video->src_h; - conf.fourcc=sh_video->fourcc; // may be NULL ??? - priv->vfilter=vf_init(libinput,&conf); - priv->vfilter_inited=1; + conf.w=sh.src_w; + conf.h=sh.src_h; + conf.fourcc=sh.fourcc; // may be NULL ??? + priv.vfilter=vf_init(libinput,&conf); + priv.vfilter_inited=1; } if(!vfm.empty()) { - const vd_info_t* vi=vfm_find_driver(vfm); + const vd_info_t* vi=find_driver(vfm); try{ - priv->mpvdec=vi->query_interface(*handle,*sh_video,*priv->psi,sh_video->fourcc); + priv.mpvdec=vi->query_interface(*this,sh,priv.psi,sh.fourcc); } catch(const bad_format_exception&) { MSG_ERR(MSGTR_CODEC_CANT_INITV); - delete priv->mpvdec; + delete priv.mpvdec; goto bye; } } - else priv->mpvdec = vfm_probe_driver(*handle,*sh_video,*priv->psi); - if(!priv->mpvdec) { + else priv.mpvdec = probe_driver(sh,priv.psi); + if(!priv.mpvdec) { bye: - delete handle; - delete priv; - return NULL; + throw missing_driver_exception(); } - video_probe_t probe = priv->mpvdec->get_probe_information(); + video_probe_t probe = priv.mpvdec->get_probe_information(); vfm=probe.driver; /* fake struct codecs_st*/ - sh_video->codec=new(zeromem) struct codecs_st; - strcpy(sh_video->codec->dll_name,probe.codec_dll); - strcpy(sh_video->codec->driver_name,probe.driver); - strcpy(sh_video->codec->codec_name,sh_video->codec->dll_name); - memcpy(sh_video->codec->outfmt,probe.pix_fmt,sizeof(probe.pix_fmt)); + sh.codec=new(zeromem) struct codecs_st; + strcpy(sh.codec->dll_name,probe.codec_dll); + strcpy(sh.codec->driver_name,probe.driver); + strcpy(sh.codec->codec_name,sh.codec->dll_name); + memcpy(sh.codec->outfmt,probe.pix_fmt,sizeof(probe.pix_fmt)); - vf_showlist(priv->vfilter); + vf_showlist(priv.vfilter); - mpcv_print_codec_info(*priv); - return handle; + print_codec_info(); } -void mpcodecs_draw_image(video_decoder_t& opaque,mp_image_t *mpi) +void VD_Interface::draw_image(const mp_image_t* mpi) const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); vf_stream_t* s; const unsigned h_step=16; unsigned num_slices = mpi->h/h_step; - s=priv->vfilter; + s=priv.vfilter; if(!(mpi->flags&(MP_IMGFLAG_DRAW_CALLBACK))){ if(mpi->h%h_step) num_slices++; - if(priv->psi->vf_flags&VF_FLAGS_SLICES) + if(priv.psi.vf_flags&VF_FLAGS_SLICES) { unsigned j,i,y; mp_image_t *ampi[num_slices]; static int hello_printed=0; if(!hello_printed) { - mpxp_ok<<"[VC] using "<<smp_num_cpus<<" threads for video filters"<<std::endl; + mpxp_ok<<"[VC] using "<<priv.smp_num_cpus<<" threads for video filters"<<std::endl; hello_printed=1; } y=0; @@ -213,10 +212,10 @@ y+=h_step; } #ifdef _OPENMP - if(use_vf_threads && (num_slices>smp_num_cpus)) { - for(j=0;j<num_slices;j+=smp_num_cpus) { + if(priv.use_vf_threads && (num_slices>priv.smp_num_cpus)) { + for(j=0;j<num_slices;j+=priv.smp_num_cpus) { #pragma omp parallel for shared(s) private(i) - for(i=j;i<smp_num_cpus;i++) { + for(i=j;i<priv.smp_num_cpus;i++) { mpxp_dbg2<<"parallel: dec_video.put_slice["<<ampi[i]->width<<"x"<<ampi[i]->height <<"] "<<ampi[i]->x<<" "<<ampi[i]->y<<" "<<ampi[i]->w<<" "<<ampi[i]->h<<std::endl; vf_put_slice(s,ampi[i]); @@ -241,34 +240,34 @@ for(i=0;i<num_slices;i++) free_mp_image(ampi[i]); } else { mpxp_dbg2<<"Put whole frame["<<mpi->width<<"x"<<mpi->height<<"]"<<std::endl; - vf_put_slice(s,mpi); + mp_image_t dmpi=*mpi; + vf_put_slice(s,&dmpi); } free_mp_image(mpi); } } -static void update_subtitle(video_decoder_t& opaque,float v_pts,unsigned idx); -int mpcv_decode(video_decoder_t& opaque,const enc_frame_t& frame){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); +int VD_Interface::run(const enc_frame_t& frame) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); vf_stream_t* s; mp_image_t *mpi=NULL; unsigned int t; unsigned int t2; double tt; - s=priv->vfilter; + s=priv.vfilter; t=GetTimer(); vf_control(s,VFCTRL_START_FRAME,NULL); - priv->psi->active_slices=0; - mpi=priv->mpvdec->run(frame); + priv.psi.active_slices=0; + mpi=priv.mpvdec->run(frame); mpxp_dbg2<<"decvideo: decoding video "<<frame.len<<" bytes"<<std::endl; - while(priv->psi->active_slices!=0) yield_timeslice(); + while(priv.psi.active_slices!=0) yield_timeslice(); /* ------------------------ frame decoded. -------------------- */ if(!mpi) return 0; // error / skipped frame - mpcodecs_draw_image(opaque,mpi); + draw_image(mpi); t2=GetTimer();t=t2-t; tt = t*0.000001f; @@ -280,7 +279,7 @@ } if(frame.flags) return 0; - update_subtitle(opaque,frame.pts,mpi->xp_idx); + update_subtitle(frame.pts,mpi->xp_idx); mpxp_context().video().output->flush_page(dae_curr_vdecoded(mpxp_context().engine().xp_core)); t2=GetTimer()-t2; @@ -296,31 +295,27 @@ return 1; } -void mpcv_resync_stream(video_decoder_t& opaque) +void VD_Interface::resync_stream() const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh_video = priv->parent; - if(sh_video) - if(sh_video->inited && priv->mpvdec) priv->mpvdec->ctrl(VDCTRL_RESYNC_STREAM,NULL); + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + if(sh.inited && priv.mpvdec) priv.mpvdec->ctrl(VDCTRL_RESYNC_STREAM,NULL); } -#ifdef USE_SUB -static float sub_last_pts = -303; -#endif -static void update_subtitle(video_decoder_t& opaque,float v_pts,unsigned xp_idx) +void VD_Interface::update_subtitle(float v_pts,unsigned xp_idx) const { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh_video = priv->parent; - Demuxer_Stream *d_dvdsub=sh_video->ds->demuxer->sub; + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + Demuxer_Stream *d_dvdsub=sh.ds->demuxer->sub; #ifdef USE_SUB // find sub if(mpxp_context().subtitles && v_pts>0){ float pts=v_pts; - if(mp_conf.sub_fps==0) mp_conf.sub_fps=sh_video->fps; + if(mp_conf.sub_fps==0) mp_conf.sub_fps=sh.fps; MP_UNIT("find_sub"); - if (pts > sub_last_pts || pts < sub_last_pts-1.0 ) { + if (pts > priv.sub_last_pts || pts < priv.sub_last_pts-1.0 ) { find_sub(mpxp_context().subtitles,sub_uses_time?(100*pts):(pts*mp_conf.sub_fps),mpxp_context().video().output); // FIXME! frame counter... - sub_last_pts = pts; + priv.sub_last_pts = pts; } MP_UNIT(NULL); } @@ -356,36 +351,34 @@ } } -#include "libvo2/video_out.h" - -MPXP_Rc mpcodecs_config_vf(video_decoder_t& opaque, int w, int h){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh = priv->parent; +MPXP_Rc VD_Interface::config_vf(int w, int h) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; int i,j; unsigned int out_fmt=0; int screen_size_x=0;//SCREEN_SIZE_X; int screen_size_y=0;//SCREEN_SIZE_Y; - vf_stream_t* s=priv->vfilter; + vf_stream_t* s=priv.vfilter; vf_conf_t conf; int palette=0; - if(!(sh->src_w && sh->src_h)) - mpxp_warn<<"VDec: driver "<<sh->codec->codec_name<<" didn't set sh->src_w and sh->src_h, trying to workaround!"<<std::endl; - /* XXX: HACK, if sh->disp_* aren't set, + if(!(sh.src_w && sh.src_h)) + mpxp_warn<<"VDec: driver "<<sh.codec->codec_name<<" didn't set sh.src_w and sh.src_h, trying to workaround!"<<std::endl; + /* XXX: HACK, if sh.disp_* aren't set, * but we have w and h, set them :: atmos */ - if(!sh->src_w && w) - sh->src_w=w; - if(!sh->src_h && h) - sh->src_h=h; + if(!sh.src_w && w) + sh.src_w=w; + if(!sh.src_h && h) + sh.src_h=h; mpxp_v<<"VDec: vo config request - "<<w<<" x "<<h<<std::endl; - if(vf_config(s,sh->src_w,sh->src_h, - sh->src_w,sh->src_h, + if(vf_config(s,sh.src_w,sh.src_h, + sh.src_w,sh.src_h, mpxp_context().video().output->flags, out_fmt)==0){ MSG_WARN(MSGTR_CannotInitVO); - priv->vfilter_inited=-1; + priv.vfilter_inited=-1; return MPXP_False; } @@ -394,16 +387,16 @@ j=-1; for(i=0;i<CODECS_MAX_OUTFMT;i++){ int flags; - out_fmt=sh->codec->outfmt[i]; + out_fmt=sh.codec->outfmt[i]; if(out_fmt==0xFFFFFFFF||out_fmt==0x0) continue; flags=vf_query_format(s,out_fmt,w,h); mpxp_dbg2<<"vo_debug[step i="<<i<<"]: query("<<vo_format_name(out_fmt)<<" "<<w<<"x"<<h<<") returned 0x"<<std::hex<<flags<<" for:"<<std::endl; if(mp_conf.verbose>1) vf_showlist(s); if((flags&VFCAP_CSP_SUPPORTED_BY_HW) || ((flags&VFCAP_CSP_SUPPORTED) && j<0)){ // check (query) if codec really support this outfmt... - sh->outfmtidx=j; // pass index to the control() function this way - if(priv->mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)==MPXP_False) { - mpxp_dbg2<<"vo_debug: codec["<<priv->mpvdec->get_probe_information().driver<<"] query_format("<<vo_format_name(out_fmt)<<") returned FALSE"<<std::endl; + sh.outfmtidx=j; // pass index to the control() function this way + if(priv.mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)==MPXP_False) { + mpxp_dbg2<<"vo_debug: codec["<<priv.mpvdec->get_probe_information().driver<<"] query_format("<<vo_format_name(out_fmt)<<") returned FALSE"<<std::endl; continue; } j=i; @@ -411,8 +404,8 @@ if(flags&VFCAP_CSP_SUPPORTED_BY_HW) break; } else if(!palette && !(mpxp_context().video().output->flags&3) && (out_fmt==IMGFMT_RGB8||out_fmt==IMGFMT_BGR8)){ - sh->outfmtidx=j; // pass index to the control() function this way - if(priv->mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)!=MPXP_False) + sh.outfmtidx=j; // pass index to the control() function this way + if(priv.mpvdec->ctrl(VDCTRL_QUERY_FORMAT,&out_fmt)!=MPXP_False) palette=1; } } @@ -422,23 +415,23 @@ int ind; mpxp_warn<<"Can't find colorspace for: "; for(ind=0;ind<CODECS_MAX_OUTFMT;ind++) { - if(sh->codec->outfmt[ind]==0xFFFFFFFF|| - sh->codec->outfmt[ind]==0x0) break; - mpxp_warn<<"'"<<vo_format_name(sh->codec->outfmt[ind])<<"' "<<std::endl; + if(sh.codec->outfmt[ind]==0xFFFFFFFF|| + sh.codec->outfmt[ind]==0x0) break; + mpxp_warn<<"'"<<vo_format_name(sh.codec->outfmt[ind])<<"' "<<std::endl; } mpxp_warn<<"Trying -vf fmtcvt..."<<std::endl; - conf.w=sh->src_w; - conf.h=sh->src_h; - conf.fourcc=sh->codec->outfmt[sh->outfmtidx]; + conf.w=sh.src_w; + conf.h=sh.src_h; + conf.fourcc=sh.codec->outfmt[sh.outfmtidx]; vf_prepend_filter(s,"fmtcvt",&conf); goto csp_again; } else if(palette==1){ mpxp_v<<"vd: Trying -vf palette..."<<std::endl; palette=-1; - conf.w=sh->src_w; - conf.h=sh->src_h; - conf.fourcc=sh->codec->outfmt[sh->outfmtidx]; + conf.w=sh.src_w; + conf.h=sh.src_h; + conf.fourcc=sh.codec->outfmt[sh.outfmtidx]; vf_prepend_filter(s,"palette",&conf); goto csp_again; } else { @@ -447,45 +440,45 @@ if(strcmp(vf_get_first_name(s),"fmtcvt")==0) vf_remove_first(s); } MSG_WARN(MSGTR_VOincompCodec); - priv->vfilter_inited=-1; + priv.vfilter_inited=-1; return MPXP_False; // failed } - out_fmt=sh->codec->outfmt[j]; - sh->outfmtidx=j; + out_fmt=sh.codec->outfmt[j]; + sh.outfmtidx=j; // autodetect flipping if(vo_conf.flip==0){ mpxp_context().video().output->FLIP_UNSET(); - if(sh->codec->outflags[j]&CODECS_FLAG_FLIP) - if(!(sh->codec->outflags[j]&CODECS_FLAG_NOFLIP)) + if(sh.codec->outflags[j]&CODECS_FLAG_FLIP) + if(!(sh.codec->outflags[j]&CODECS_FLAG_NOFLIP)) mpxp_context().video().output->FLIP_SET(); } if(mpxp_context().video().output->flags&VFCAP_FLIPPED) mpxp_context().video().output->FLIP_REVERT(); if(mpxp_context().video().output->FLIP() && !(mpxp_context().video().output->flags&VFCAP_FLIP)){ // we need to flip, but no flipping filter avail. - conf.w=sh->src_w; - conf.h=sh->src_h; + conf.w=sh.src_w; + conf.h=sh.src_h; conf.fourcc=out_fmt; vf_prepend_filter(s,"flip",&conf); } // time to do aspect ratio corrections... - if(vo_conf.movie_aspect>-1.0) sh->aspect = vo_conf.movie_aspect; // cmdline overrides autodetect + if(vo_conf.movie_aspect>-1.0) sh.aspect = vo_conf.movie_aspect; // cmdline overrides autodetect if(vo_conf.image_width||vo_conf.image_height){ screen_size_x = vo_conf.image_width; screen_size_y = vo_conf.image_height; if(!vo_conf.vidmode){ if(!screen_size_x) screen_size_x=1; if(!screen_size_y) screen_size_y=1; - if(screen_size_x<=8) screen_size_x*=sh->src_w; - if(screen_size_y<=8) screen_size_y*=sh->src_h; + if(screen_size_x<=8) screen_size_x*=sh.src_w; + if(screen_size_y<=8) screen_size_y*=sh.src_h; } } else { // check source format aspect, calculate prescale ::atmos - screen_size_x=sh->src_w; - screen_size_y=sh->src_h; + screen_size_x=sh.src_w; + screen_size_y=sh.src_h; if(vo_conf.image_zoom>=0.001){ if(vo_conf.image_zoom<=8){ // -xy means x+y scale @@ -494,37 +487,37 @@ } else { // -xy means forced width while keeping correct aspect screen_size_x=vo_conf.image_zoom; - screen_size_y=vo_conf.image_zoom*sh->src_h/sh->src_w; + screen_size_y=vo_conf.image_zoom*sh.src_h/sh.src_w; } } - if(sh->aspect>0.01){ + if(sh.aspect>0.01){ int _w; - mpxp_v<<"Movie-Aspect is "<<sh->aspect<<":1 - prescaling to correct movie aspect."<<std::endl; - _w=(int)((float)screen_size_y*sh->aspect); _w+=_w%2; // round + mpxp_v<<"Movie-Aspect is "<<sh.aspect<<":1 - prescaling to correct movie aspect."<<std::endl; + _w=(int)((float)screen_size_y*sh.aspect); _w+=_w%2; // round // we don't like horizontal downscale || user forced width: if(_w<screen_size_x || vo_conf.image_zoom>8){ - screen_size_y=(int)((float)screen_size_x*(1.0/sh->aspect)); + screen_size_y=(int)((float)screen_size_x*(1.0/sh.aspect)); screen_size_y+=screen_size_y%2; // round - if(unsigned(screen_size_y)<sh->src_h) // Do not downscale verticaly - screen_size_y=sh->src_h; + if(unsigned(screen_size_y)<sh.src_h) // Do not downscale verticaly + screen_size_y=sh.src_h; } else screen_size_x=_w; // keep new width } else { mpxp_v<<"Movie-Aspect is undefined - no prescaling applied."<<std::endl; } } - mpxp_v<<"vf->config("<<sh->src_w<<"x"<<sh->src_h<<"->"<<screen_size_x<<"x"<<screen_size_y<<",flags=0x"<<std::hex + mpxp_v<<"vf->config("<<sh.src_w<<"x"<<sh.src_h<<"->"<<screen_size_x<<"x"<<screen_size_y<<",flags=0x"<<std::hex <<mpxp_context().video().output->flags<<",'"<<"MPlayerXP"<<"',"<<vo_format_name(out_fmt)<<std::endl; - if(vf_config(s,sh->src_w,sh->src_h, + if(vf_config(s,sh.src_w,sh.src_h, screen_size_x,screen_size_y, mpxp_context().video().output->flags, out_fmt)==0){ MSG_WARN(MSGTR_CannotInitVO); - priv->vfilter_inited=-1; + priv.vfilter_inited=-1; return MPXP_False; } - mpxp_dbg2<<"vf->config("<<sh->src_w<<"x"<<sh->src_h<<"->"<<screen_size_x<<"x"<<screen_size_y + mpxp_dbg2<<"vf->config("<<sh.src_w<<"x"<<sh.src_h<<"->"<<screen_size_x<<"x"<<screen_size_y <<",flags="<<mpxp_context().video().output->flags<<",'"<<vo_format_name(out_fmt)<<"')"<<std::endl; return MPXP_True; } @@ -533,20 +526,21 @@ // mp_imgflag: buffer requirements (read/write, preserve, stride limits), see xmp_image.h // returns NULL or allocated mp_image_t* // Note: buffer allocation may be moved to mpcodecs_config_vf() later... -mp_image_t* mpcodecs_get_image(video_decoder_t& opaque, int mp_imgtype, int mp_imgflag,int w, int h){ - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - sh_video_t* sh = priv->parent; - vf_stream_t* s = priv->vfilter; - mp_image_t* mpi=vf_get_new_image(s,sh->codec->outfmt[sh->outfmtidx],mp_imgtype,mp_imgflag,w,h,dae_curr_vdecoded(mpxp_context().engine().xp_core)); +mp_image_t* VD_Interface::get_image(int mp_imgtype, int mp_imgflag,int w, int h) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + sh_video_t& sh = priv.parent; + vf_stream_t* s = priv.vfilter; + mp_image_t* mpi=vf_get_new_image(s,sh.codec->outfmt[sh.outfmtidx],mp_imgtype,mp_imgflag,w,h,dae_curr_vdecoded(mpxp_context().engine().xp_core)); mpi->x=mpi->y=0; if(mpi->xp_idx==XP_IDX_INVALID) mpxp_v<<"[mpcodecs_get_image] Incorrect mpi->xp_idx. Be ready for segfault!"<<std::endl; return mpi; } -void mpcodecs_draw_slice(video_decoder_t& opaque, mp_image_t*mpi) { - decvideo_priv_t* priv=reinterpret_cast<decvideo_priv_t*>(opaque.vd_private); - vf_stream_t* vf = priv->vfilter; - vf_put_slice(vf,mpi); +void VD_Interface::draw_slice(const mp_image_t* mpi) const { + decvideo_priv_t& priv=reinterpret_cast<decvideo_priv_t&>(vd_private); + vf_stream_t* vf = priv.vfilter; + mp_image_t dmpi = *mpi; + vf_put_slice(vf,&dmpi); } } // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/dec_video.h =================================================================== --- mplayerxp/libmpcodecs/dec_video.h 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/dec_video.h 2013-06-11 17:36:43 UTC (rev 652) @@ -5,21 +5,34 @@ namespace usr { struct libinput_t; + class Video_Decoder; + struct vd_info_t; + struct put_slice_info_t; - struct video_decoder_t { - Opaque* vd_private; - }; + class VD_Interface : public Opaque { + public: + VD_Interface(sh_video_t& sh_video, const std::string& codec_name,const std::string& family,int status,libinput_t&libinput); + virtual ~VD_Interface(); -// dec_video.c: - video_decoder_t* __FASTCALL__ mpcv_init(sh_video_t *sh_video, const std::string& codec_name,const std::string& family,int status,libinput_t&libinput); - void __FASTCALL__ mpcv_uninit(video_decoder_t& handle); - int __FASTCALL__ mpcv_decode(video_decoder_t& handle,const enc_frame_t& frame); + virtual int run(const enc_frame_t& frame) const; - MPXP_Rc __FASTCALL__ mpcv_get_quality_max(video_decoder_t& handle,unsigned& quality); - MPXP_Rc __FASTCALL__ mpcv_set_quality(video_decoder_t& handle,int quality); - MPXP_Rc __FASTCALL__ mpcv_set_colors(video_decoder_t& handle,const std::string& item,int value); - void __FASTCALL__ mpcv_resync_stream(video_decoder_t& handle); + virtual MPXP_Rc get_quality_max(unsigned& quality) const; + virtual MPXP_Rc set_quality(int quality) const; + virtual MPXP_Rc set_colors(const std::string& item,int value) const; + virtual void resync_stream() const; - void vfm_help(void); + virtual MPXP_Rc config_vf(int w, int h) const; + virtual mp_image_t* get_image(int mp_imgtype, int mp_imgflag,int w, int h) const; + virtual void draw_slice(const mp_image_t*) const; + virtual void draw_image(const mp_image_t*) const; + static void print_help(); + private: + void print_codec_info() const; + void update_subtitle(float v_pts,unsigned idx) const; + const vd_info_t* find_driver(const std::string& name); + Video_Decoder* probe_driver(sh_video_t& sh,put_slice_info_t& psi); + + Opaque& vd_private; + }; } // namepsace usr #endif Modified: mplayerxp/libmpcodecs/vd.cpp =================================================================== --- mplayerxp/libmpcodecs/vd.cpp 2013-06-11 14:37:50 UTC (rev 651) +++ mplayerxp/libmpcodecs/vd.cpp 2013-06-11 17:36:43 UTC (rev 652) @@ -73,7 +73,7 @@ cfg.register_options(mpcodecs_vd_drivers[i]->options); } -const vd_info_t* vfm_find_driver(const std::string& name) { +const vd_info_t* VD_Interface::find_driver(const std::string& name) { unsigned i; for (i=0; mpcodecs_vd_drivers[i] != &vd_null_info; i++) if(name==mpcodecs_vd_drivers[i]->driver_name) { @@ -82,13 +82,13 @@ return NULL; } -Video_Decoder* vfm_probe_driver(video_decoder_t& handle,sh_video_t& sh,put_slice_info_t& psi) { +Video_Decoder* VD_Interface::probe_driver(sh_video_t& sh,put_slice_info_t& psi) { unsigned i; Video_Decoder* drv=NULL; for (i=0; mpcodecs_vd_drivers[i] != &vd_null_info; i++) { mpxp_v<<"Probing: "<<mpcodecs_vd_drivers[i]->driver_name<<std::endl; try { - drv = mpcodecs_vd_drivers[i]->query_interface(handle,sh,psi,sh.fourcc); + drv = mpcodecs_vd_drivers[i]->query_interface(*this,sh,psi,sh.fourcc); mpxp_v<<"ok"<<std::endl; mpxp_v<<"Driver: "<<mpcodecs_vd_drivers[i]->driver_name<<" supports these outfmt for "; fourcc(mpxp_v,sh.fourcc); @@ -110,7 +110,7 @@ return drv; } -void vfm_help() { +void VD_Interface::print_help() { unsigned i; mpxp_info<<"Available video codec families/drivers:"<<st... [truncated message content] |
From: <nic...@us...> - 2013-06-11 14:37:55
|
Revision: 651 http://sourceforge.net/p/mplayerxp/code/651 Author: nickols_k Date: 2013-06-11 14:37:50 +0000 (Tue, 11 Jun 2013) Log Message: ----------- convert libmpcodecs into class (note: doesn't work for me) about illegal-patch ==================== Log shows that it is working code, but it doesn't work for me due illegal-patch $sudo ./mplayerxp -vo fbdev -ao alsa /...path.../trassa e95.avi -v -v -v ---------------------- 8< --------------------- 8< ------------------------ *** Antiviral protection was inited ***!!! MPlayerXP svn.650 2002 Nickols_K 2000-2002 Arpad Gereoffy (?\209?\129?\208?\188. DOCS!) Can't open input config file /root/.mplayerxp/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 CPU: Advanced Micro Devices (Type: 9, Stepping: 3) extended cpuid-level: 26 extended cache-info: 33587520 Detected cache-line size is 64 bytes cpudetect: MMX=1 MMX2=1 3DNow=1 3DNow2=1 SSE=1 SSE2=1 SSE3=1 SSSE3=0 SSE41=0 SSE42=0 AES=0 AVX=0 FMA=0 User corrected CPU flags: MMX=1 MMX2=1 3DNow=1 3DNow2=1 SSE=1 SSE2=1 SSE3=1 SSSE3=0 SSE41=0 SSE42=0 AES=0 AVX=0 FMA=0 mpxp_context().mplayer_accel=4160749568 Environment: HOME => /root LANG => ru_RU.UTF-8 LOGNAME => root MAIL => /var/mail/root PATH => /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl SHELL => /bin/bash SUDO_COMMAND => ./mplayerxp -vo fbdev -ao alsa /...path.../trassa e95.avi -v -v -v SUDO_GID => 1000 SUDO_UID => 1000 SUDO_USER => kas TERM => linux USER => root USERNAME => root CommandLine: '-vo' 'fbdev' '-ao' 'alsa' '/...path.../trassa e95.avi' '-v' '-v' '-v' font: can't open file: /root/.mplayerxp/font/font.desc font: can't open file: /usr/local/share/mplayerxp/font/font.desc Menu init failed fbdev: using /dev/fb0 ?\208?\146?\208?\190?\209?\129?\208?\191?\209?\128?\208?\190?\208?\184?\208?\183?\208?\178?\208?\181?\208?\180?\208?\181?\208?\189?\208?\184?\208?\181 /...path.../trassa e95.avi Filename for url is now /...path.../trassa%20e95.avi Not an URL! [Stream]: Opening *:// ... False [Demuxer]: Probing RAW audio parser ...:False [Demuxer]: Probing RAW video parser ...:False [Demuxer]: Probing AVI - Audio Video Interleaved parser ...:Ok DEMUX: LIST 'hdrl' len=8830 DEMUX: list_end=0x2292 DEMUX: CHUNK 'avih' len=56 DEMUX: ======= AVI Header ======= us/frame: 40000 (fps=25.000) max bytes/sec: 0 padding: 0 DEMUX: MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED DEMUX: frames total: 6198 initial: 0 streams: 2 Suggested BufferSize: 0 Size: 352 x 288 DEMUX: list_end=0x2292 pos=0x58 chunksize=0x0 next=0x58 DEMUX: LIST 'strl' len=4244 DEMUX: list_end=0x10F4 DEMUX: CHUNK 'strh' len=56 [Demuxer]: ==> Found video stream: 0 [Demuxer]: ID_VIDEO_ID=0 DEMUX: ======= STREAM Header ======= Type: vids FCC: div3 (33766964) Flags: 0 Priority: 0 Language: 0 InitialFrames: 0 Rate: 25000/1000 = 25.000 Start: 0 Len: 6198 Suggested BufferSize: 21412 Quality 10000 Sample size: 0 DEMUX: list_end=0x10F4 pos=0xA4 chunksize=0x0 next=0xA4 DEMUX: CHUNK 'strf' len=40 DEMUX: found 'bih', 40 bytes of 40 DEMUX: ======= VIDEO Format (chunk size: 40 )====== biSize 40 biWidth 352 biHeight 288 biPlanes 1 biBitCount 24 biCompression 33564944='DIV3' biSizeImage 304128 biXPelPerMeter 0 biYPelPerMeter 0 biClrUsed 0 biClrIpmortant 0 DEMUX: ======= End of Video Format ======= DEMUX: Regenerating keyframe table for DIVX 3 video DEMUX: list_end=0x10F4 pos=0xD4 chunksize=0x0 next=0xD4 DEMUX: CHUNK 'JUNK' len=4120 DEMUX: list_end=0x10F4 pos=0x10F4 chunksize=0x0 next=0x10F4 DEMUX: LIST 'strl' len=4234 DEMUX: list_end=0x2186 DEMUX: CHUNK 'strh' len=56 DEMUX: avi: Found audio stream Demuxer: ==> Found audio stream: 1 Demuxer: ID_AUDIO_ID=1 DEMUX: ======= STREAM Header ======= Type: auds FCC: (0) Flags: 0 Priority: 0 Language: 0 InitialFrames: 1 Rate: 15963/1 = 15963.000 Start: 0 Len: 3957330 Suggested BufferSize: 7467 Quality -1 Sample size: 1 DEMUX: list_end=0x2186 pos=0x1140 chunksize=0x0 next=0x1140 DEMUX: CHUNK 'strf' len=30 DEMUX: found 'wf', 30 bytes of 18 DEMUX: ======= WAVE Format (chunk size: 30 )======= Format Tag: 85 (0x55) Channels: 2 Samplerate: 44100 avg byte/sec: 15963 Block align: 1 bits/sample: 0 cbSize: 12 DEMUX: mp3.wID=1 mp3.fdwFlags=0x2 mp3.nBlockSize=417 mp3.nFramesPerBlock=1 mp3.nCodecDelay=1393 DEMUX: ======= End of WAVE Format ======= DEMUX: list_end=0x2186 pos=0x1166 chunksize=0x0 next=0x1166 DEMUX: CHUNK 'JUNK' len=4120 DEMUX: list_end=0x2186 pos=0x2186 chunksize=0x0 next=0x2186 DEMUX: LIST 'odml' len=260 DEMUX: list_end=0x2292 DEMUX: CHUNK 'dmlh' len=248 DEMUX: Found ODML header 248 frames 6198 DEMUX: list_end=0x2292 pos=0x2292 chunksize=0x0 next=0x2292 DEMUX: CHUNK 'JUNK' len=1382 DEMUX: list_end=0x2292 pos=0x2800 chunksize=0x0 next=0x2800 DEMUX: Broken chunk? chunksize=0 (id=JUNK) DEMUX: CHUNK 'JUNK' len=1382 DEMUX: list_end=0x0 pos=0x2800 chunksize=0x0 next=0x2800 DEMUX: LIST 'movi' len=23710356 DEMUX: list_end=0x169F29C DEMUX: Found movie at 0x280C - 0x169F29C DEMUX: CHUNK 'idx1' len=198144 DEMUX: Reading INDEX block, 12384 chunks for 6198 frames DEMUX: 0: 01wb 10 00000004 len: 7467 pos: 0-> 0.000 0-> 0.000 DEMUX: 1: 00dc 10 00001D38 len: 556 pos: 0-> 0.000 0-> 0.000 DEMUX: 2: 01wb 10 00001F6C len: 419 pos: 7467-> 0.398 1-> 0.042 [snip] ... [/snip] DEMUX: 12381: 00dc 0 0169C7E6 len: 122 pos:19647058->1048.011 6195->258.383 DEMUX: 12382: 00dc 0 0169C868 len: 247 pos:19647180->1048.017 6196->258.425 DEMUX: 12383: 00dc 0 0169C968 len: 292 pos:19647427->1048.031 6197->258.467 DEMUX: list_end=0x0 pos=0x16CF8A4 chunksize=0x0 next=0x16CF8A4 DEMUX: CHUNK 'JUNK' len=1876 DEMUX: list_end=0x0 pos=0x16D0000 chunksize=0x0 next=0x16D0000 DEMUX: AVI index offset: 0x2808 (movi=0x280C idx0=0x4 idx1=0x1D38) DEMUX: Auto-selected AVI audio ID = 1 DEMUX: Auto-selected AVI video ID = 0 ds_fill_buffer(d_video) called DEMUX: demux_avi.read_packet: 62773130 DEMUX: DEMUX_AVI: Read 7467 data bytes from packet 62773130 DEMUX: Append packet: len=7467 pts=0 pos=0 [_packs: A=1 V=0] ds_read_packet(7467,0,0,0) DEMUX: DEMUX_AVI: Skipping 1 bytes from packet 62773130 DEMUX: demux_avi.read_packet: 63643030 DEMUX: DEMUX_AVI: Read 556 data bytes from packet 63643030 DEMUX: Append packet: len=556 pts=0 pos=1 [_packs: A=1 V=1] ds_read_packet(556,0,0,0) DEMUX: AVI: Searching for audio stream (id:1) ds_fill_buffer(d_audio) called DEMUX: AVI video size=19647719 (6198) audio size=3957330 (3957330) DEMUX: VIDEO: [DIV3] 352x288 24bpp 25.00 fps [Demuxer]: Using: AVI - Audio Video Interleaved parser [Stream]:Video=DIV3 Audio=00000055 [V] filefmt:6fourcc:0x33564944 size:160x120 fps:25 ftime:=0.04 MPSUB: SPU: Display only forced subs now disabled [codec_ld] ?\208?\145?\208?\184?\208?\177?\208?\187?\208?\184?\208?\190?\209?\130?\208?\181?\208?\186?\208?\176 ?\208?\183?\208?\176?\208?\179?\209?\128?\209?\131?\208?\182?\208?\181?\208?\189?\208?\176 ?\209?\131?\209?\129?\208?\191?\208?\181?\209?\136?\208?\189?\208?\190:libmpg123.so initial_apts from: stream_pts=0 pts_bytes=7467 got_bytes=7467 i_bps=15963 initial_apts is: 0 mpg123_init: MPEG-1.0 [Layer:III (CBR)], Hz=44100 128-kbit Joint-Stereo, BPF=417 Out=32-bit mpg123_init: Copyrght=No Orig=Yes CRC=No Priv=No Emphas=0 Optimiz=x86-64 Probing: mp3libok Driver: mp3lib supports these outfmt for 00000055 100000 10 0 Using SSE2 optimized memcpy fast_memcpy(0x3dc27a0, 0x7fff2f5dbf88, 64) [cl_size=64] dec_audio: Allocating 8192 + 65536 = 73728 bytes for output buffer [AC] Selecting drv:mp3lib.libmpg123.so ratio 15963->352800 alsa-init: compiled for ALSA-1.0.27.1 alsa-init: got device=0, subdevice=0 alsa-init: Testing & bugs are welcome. Found 1 cards, use: hw:0,0 alsa-init: pcm opend in block-mode snd_pcm_hw_params_any() snd_pcm_hw_params_set_access(SND_PCM_ACCESS_RW_INTERLEAVED) Initializing audio codec... AUDIO: srate=ac44 chans=2 bps=4 sfmt=0x100000 ratio: 3e5b->0 POSTPR: vo2(NULL, NULL) Probing: raw failed Probing: nuv failed Probing: mpeg2 failed Probing: xvid failed Probing: mpegpes failed Probing: huffyuv failed Probing: divx [codec_ld] ?\208?\157?\208?\181 ?\208?\188?\208?\190?\208?\179?\209?\131 ?\208?\183?\208?\176?\208?\179?\209?\128?\209?\131?\208?\183?\208?\184?\209?\130?\209?\140 ?\208?\177?\208?\184?\208?\177?\208?\187?\208?\184?\208?\190?\209?\130?\208?\181?\208?\186?\209?\131:libdivx.so {libdivx.so: cannot open shared object file: No such file or directory} [codec_ld] ?\208?\159?\208?\190?\208?\191?\209?\139?\209?\130?\208?\176?\208?\185?\209?\130?\208?\181?\209?\129?\209?\140 ?\208?\191?\208?\190?\208?\187?\209?\131?\209?\135?\208?\184?\209?\130?\209?\140 ?\209?\141?\209?\130?\208?\190?\209?\130 ?\208?\186?\208?\190?\208?\180?\208?\181?\208?\186 ?\209?\129:http://labs.divx.com/DivXLinuxCodec failed Probing: realvid failed Probing: xanim failed Probing: theora failed Probing: libdv failed Probing: lavc libavcodec.size: 352 x 288 Using 4 threads in lavc INFO: libavcodec.so (0) video codec[DIV3] init OK! VDec: vo config request - 352 x 288 dri_vo_dbg: vo_query_format(00000000) dri_vo: request for Unknown 0x0000 fourcc: 0 [vf_vo2] 0=query_format(Unknown 0x0000) vf_vo2->config(352,288,352,288,4,Unknown 0x0000) dri_vo_dbg: vo_config priv.video_out->config(352,288,352,288, 0x4,'MPlayerXP',Unknown 0x0000) fbdev: Can't set graphics mode: Inappropriate ioctl for device fbdev: var info: fbdev: xres: 1920 fbdev: yres: 1200 fbdev: xres_virtual: 1920 fbdev: yres_virtual: 1200 fbdev: xoffset: 0 fbdev: yoffset: 0 fbdev: bits_per_pixel: 32 fbdev: grayscale: 0 fbdev: red: 16 8 0 fbdev: green: 8 8 0 fbdev: blue: 0 8 0 fbdev: transp: 24 8 0 fbdev: nonstd: 0 fbdev: activate: 0 fbdev: height: 4294967295 fbdev: width: 4294967295 fbdev: accel_flags: 1 fbdev: timing: fbdev: pixclock: 0 fbdev: left_margin: 0 fbdev: right_margin: 0 fbdev: upper_margin: 0 fbdev: lower_margin: 0 fbdev: hsync_len: 0 fbdev: vsync_len: 0 fbdev: sync: 0 fbdev: vmode: 0 fbdev: fix info: fbdev: framebuffer size: 9216000 bytes fbdev: type: 0 fbdev: type_aux: 0 fbdev: visual: 2 fbdev: line_length: 7680 bytes fbdev: id: radeondrmfb fbdev: smem_start: 0xc0142000 fbdev: xpanstep: 1 fbdev: ypanstep: 1 fbdev: ywrapstep: 0 fbdev: mmio_start: 0 fbdev: mmio_len: 0 bytes fbdev: accel: 0 fbdev: priv.bpp: 32 fbdev: priv.real_bpp: 24 fbdev: priv.pixel_size: 4 bytes fbdev: other: fbdev: priv.in_width: 352 fbdev: priv.in_height: 288 fbdev: priv.out_width: 352 fbdev: priv.out_height: 288 fbdev: priv.last_row: 816 fbdev: frame_buffer @ 7f7549c01000 fbdev: L123123875 @ 7f7549f58c40 fbdev: pixel per line: 1920 fbdev: vt_set_textarea(330,4b0): 34,4b POSTPR: [stream: vf_reinit_vo]: 0x3de51c0 POSTPR: Call vf_reinit_vo <vo2: 352x288@Unknown 0x0000> -> <vo: 352x288@BGRA> POSTPR: vf->first: 352x288@Unknown 0x0000 POSTPR: [352x288@Unknown 0x0000](NULL<-vo2->NULL) POSTPR: Using(first:vo2) 352x288@Unknown 0x0000 POSTPR: vf_reinit->config_vf 352 288 Unknown 0x0000=> 352 288 BGRA POSTPR: Open video filter: [fmtcvt] <352x288 Unknown 0x0000> POSTPR: SwScale params: -1 x -1 (-1=no scaling) dri_vo_dbg: vo_query_format(51343434) dri_vo: request for Planar 444P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit little-endian) POSTPR: scale: query(Planar 444P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34343451) dri_vo: request for Planar 444P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit big-endian) POSTPR: scale: query(Planar 444P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51323234) dri_vo: request for Planar 422P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit little-endian) POSTPR: scale: query(Planar 422P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323251) dri_vo: request for Planar 422P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit big-endian) POSTPR: scale: query(Planar 422P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51303234) dri_vo: request for Planar 420P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit little-endian) POSTPR: scale: query(Planar 420P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323051) dri_vo: request for Planar 420P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit big-endian) POSTPR: scale: query(Planar 420P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(41303234) dri_vo: request for Planar YV12 with alpha fourcc: 0 [vf_vo2] 0=query_format(Planar YV12 with alpha) POSTPR: scale: query(Planar YV12 with alpha) -> 0 dri_vo_dbg: vo_query_format(50343434) dri_vo: request for Planar 444P fourcc: 0 [vf_vo2] 0=query_format(Planar 444P) POSTPR: scale: query(Planar 444P) -> 0 dri_vo_dbg: vo_query_format(50323234) dri_vo: request for Planar 422P fourcc: 0 [vf_vo2] 0=query_format(Planar 422P) POSTPR: scale: query(Planar 422P) -> 0 dri_vo_dbg: vo_query_format(32315659) dri_vo: request for Planar YV12 fourcc: 0 [vf_vo2] 0=query_format(Planar YV12) POSTPR: scale: query(Planar YV12) -> 0 dri_vo_dbg: vo_query_format(30323449) dri_vo: request for Planar I420 fourcc: 0 [vf_vo2] 0=query_format(Planar I420) POSTPR: scale: query(Planar I420) -> 0 dri_vo_dbg: vo_query_format(56555949) dri_vo: request for Planar IYUV fourcc: 0 [vf_vo2] 0=query_format(Planar IYUV) POSTPR: scale: query(Planar IYUV) -> 0 dri_vo_dbg: vo_query_format(39555659) dri_vo: request for Planar YVU9 fourcc: 0 [vf_vo2] 0=query_format(Planar YVU9) POSTPR: scale: query(Planar YVU9) -> 0 dri_vo_dbg: vo_query_format(39304649) dri_vo: request for Planar IF09 fourcc: 0 [vf_vo2] 0=query_format(Planar IF09) POSTPR: scale: query(Planar IF09) -> 0 dri_vo_dbg: vo_query_format(50313134) dri_vo: request for Planar 411P fourcc: 0 [vf_vo2] 0=query_format(Planar 411P) POSTPR: scale: query(Planar 411P) -> 0 dri_vo_dbg: vo_query_format(32595559) dri_vo: request for Packed YUY2 fourcc: 0 [vf_vo2] 0=query_format(Packed YUY2) POSTPR: scale: query(Packed YUY2) -> 0 dri_vo_dbg: vo_query_format(59565955) dri_vo: request for Packed UYVY fourcc: 0 [vf_vo2] 0=query_format(Packed UYVY) POSTPR: scale: query(Packed UYVY) -> 0 dri_vo_dbg: vo_query_format(52474230) dri_vo: request for RGB 48-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 48-bit) POSTPR: scale: query(RGB 48-bit) -> 0 dri_vo_dbg: vo_query_format(524742b0) dri_vo: request for BGR 48-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 48-bit) POSTPR: scale: query(BGR 48-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) POSTPR: scale: query(BGRA) -> 1 dri_vo_dbg: vo_query_format(52474220) dri_vo: request for RGBA fourcc: 0 [vf_vo2] 0=query_format(RGBA) POSTPR: scale: query(RGBA) -> 0 dri_vo_dbg: vo_query_format(42475218) dri_vo: request for BGR 24-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 24-bit) POSTPR: scale: query(BGR 24-bit) -> 0 dri_vo_dbg: vo_query_format(52474218) dri_vo: request for RGB 24-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 24-bit) POSTPR: scale: query(RGB 24-bit) -> 0 dri_vo_dbg: vo_query_format(42475210) dri_vo: request for BGR 16-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 16-bit) POSTPR: scale: query(BGR 16-bit) -> 0 dri_vo_dbg: vo_query_format(52474210) dri_vo: request for RGB 16-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 16-bit) POSTPR: scale: query(RGB 16-bit) -> 0 dri_vo_dbg: vo_query_format(4247520f) dri_vo: request for BGR 15-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 15-bit) POSTPR: scale: query(BGR 15-bit) -> 0 dri_vo_dbg: vo_query_format(5247420f) dri_vo: request for RGB 15-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 15-bit) POSTPR: scale: query(RGB 15-bit) -> 0 dri_vo_dbg: vo_query_format(30303859) dri_vo: request for Planar Y800 fourcc: 0 [vf_vo2] 0=query_format(Planar Y800) POSTPR: scale: query(Planar Y800) -> 0 dri_vo_dbg: vo_query_format(20203859) dri_vo: request for Planar Y8 fourcc: 0 [vf_vo2] 0=query_format(Planar Y8) POSTPR: scale: query(Planar Y8) -> 0 dri_vo_dbg: vo_query_format(42475208) dri_vo: request for BGR 8-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 8-bit) POSTPR: scale: query(BGR 8-bit) -> 0 dri_vo_dbg: vo_query_format(52474208) dri_vo: request for RGB 8-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 8-bit) POSTPR: scale: query(RGB 8-bit) -> 0 dri_vo_dbg: vo_query_format(42475204) dri_vo: request for BGR 4-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit) POSTPR: scale: query(BGR 4-bit) -> 0 dri_vo_dbg: vo_query_format(52474204) dri_vo: request for RGB 4-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit) POSTPR: scale: query(RGB 4-bit) -> 0 dri_vo_dbg: vo_query_format(42475284) dri_vo: request for BGR 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit per byte) POSTPR: scale: query(BGR 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(52474284) dri_vo: request for RGB 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit per byte) POSTPR: scale: query(RGB 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(42475201) dri_vo: request for BGR 1-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 1-bit) POSTPR: scale: query(BGR 1-bit) -> 0 dri_vo_dbg: vo_query_format(52474201) dri_vo: request for RGB 1-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 1-bit) POSTPR: scale: query(RGB 1-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) POSTPR: vf_scale: 1025=vf_next_query_format(0x56f2010,42475220,352,288); POSTPR: vf_scale: sws_getFlagsAndFilterFromCmdLine(...); POSTPR: vf_scale: sws_getContext(352, 288, Unknown 0x0000, 352, 288, BGRA, E0001004); [swscaler @ 0x56f25e0] (null) is not supported as input pixel format POSTPR: vf_scale: (nil)=sws_getContext POSTPR: Couldn't init SwScaler for this setup (nil) POSTPR: FATAL: ?\208?\157?\208?\181 ?\208?\188?\208?\190?\208?\179?\209?\131 ?\208?\191?\209?\128?\208?\190?\208?\184?\208?\189?\208?\184?\209?\134?\208?\184?\208?\176?\208?\187?\208?\184?\208?\183?\208?\184?\209?\128?\208?\190?\208?\178?\208?\176?\209?\130?\209?\140 ?\208?\178?\208?\184?\208?\180?\208?\181?\208?\190 ?\208?\180?\209?\128?\208?\176?\208?\185?\208?\178?\208?\181?\209?\128! POSTPR: vf->first: 352x288@Unknown 0x0000 POSTPR: [352x288@Unknown 0x0000](fmtcvt<-vo2->NULL) dri_vo_caps: driver does support DRI dri_vo_caps: caps=00000000 fourcc=42475220(BGRA) x,y,w,h(0 0 160 120) dri_vo_caps: width,height(160,120) strides(580000) priv.dri.bpp=20 dri_vo_src: w,h(160,120) d_w,d_h(160,120 dri_vo_src: flags=00000004 fourcc=00000000(Unknown 0x0000) dri_vo_dbg: vo_query_format(30323449) dri_vo: request for Planar I420 fourcc: 0 [vf_vo2] 0=query_format(Planar I420) vo_debug[step i=0]: query(Planar I420 352x288) returned 0x0 for: POSTPR: [libvf] Using video filters chain: POSTPR: VO-CONF: [fbdev] 352x288 => 352x288 Unknown 0x0000 [zoom] VO: Description: Framebuffer Device VO: Author: Szabolcs Berecz <sz...@in...> Can't find colorspace for: 'Planar I420' Trying -vf fmtcvt... Open video filter: [fmtcvt] <352x288 Planar I420> POSTPR: SwScale params: -1 x -1 (-1=no scaling) POSTPR: vf_scale: query_format(0x56f25e0, 30323449(Planar I420), 352, 288 dri_vo_dbg: vo_query_format(51343434) dri_vo: request for Planar 444P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit little-endian) POSTPR: scale: query(Planar 444P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34343451) dri_vo: request for Planar 444P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 444P 16-bit big-endian) POSTPR: scale: query(Planar 444P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51323234) dri_vo: request for Planar 422P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit little-endian) POSTPR: scale: query(Planar 422P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323251) dri_vo: request for Planar 422P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 422P 16-bit big-endian) POSTPR: scale: query(Planar 422P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(51303234) dri_vo: request for Planar 420P 16-bit little-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit little-endian) POSTPR: scale: query(Planar 420P 16-bit little-endian) -> 0 dri_vo_dbg: vo_query_format(34323051) dri_vo: request for Planar 420P 16-bit big-endian fourcc: 0 [vf_vo2] 0=query_format(Planar 420P 16-bit big-endian) POSTPR: scale: query(Planar 420P 16-bit big-endian) -> 0 dri_vo_dbg: vo_query_format(41303234) dri_vo: request for Planar YV12 with alpha fourcc: 0 [vf_vo2] 0=query_format(Planar YV12 with alpha) POSTPR: scale: query(Planar YV12 with alpha) -> 0 dri_vo_dbg: vo_query_format(50343434) dri_vo: request for Planar 444P fourcc: 0 [vf_vo2] 0=query_format(Planar 444P) POSTPR: scale: query(Planar 444P) -> 0 dri_vo_dbg: vo_query_format(50323234) dri_vo: request for Planar 422P fourcc: 0 [vf_vo2] 0=query_format(Planar 422P) POSTPR: scale: query(Planar 422P) -> 0 dri_vo_dbg: vo_query_format(32315659) dri_vo: request for Planar YV12 fourcc: 0 [vf_vo2] 0=query_format(Planar YV12) POSTPR: scale: query(Planar YV12) -> 0 dri_vo_dbg: vo_query_format(30323449) dri_vo: request for Planar I420 fourcc: 0 [vf_vo2] 0=query_format(Planar I420) POSTPR: scale: query(Planar I420) -> 0 dri_vo_dbg: vo_query_format(56555949) dri_vo: request for Planar IYUV fourcc: 0 [vf_vo2] 0=query_format(Planar IYUV) POSTPR: scale: query(Planar IYUV) -> 0 dri_vo_dbg: vo_query_format(39555659) dri_vo: request for Planar YVU9 fourcc: 0 [vf_vo2] 0=query_format(Planar YVU9) POSTPR: scale: query(Planar YVU9) -> 0 dri_vo_dbg: vo_query_format(39304649) dri_vo: request for Planar IF09 fourcc: 0 [vf_vo2] 0=query_format(Planar IF09) POSTPR: scale: query(Planar IF09) -> 0 dri_vo_dbg: vo_query_format(50313134) dri_vo: request for Planar 411P fourcc: 0 [vf_vo2] 0=query_format(Planar 411P) POSTPR: scale: query(Planar 411P) -> 0 dri_vo_dbg: vo_query_format(32595559) dri_vo: request for Packed YUY2 fourcc: 0 [vf_vo2] 0=query_format(Packed YUY2) POSTPR: scale: query(Packed YUY2) -> 0 dri_vo_dbg: vo_query_format(59565955) dri_vo: request for Packed UYVY fourcc: 0 [vf_vo2] 0=query_format(Packed UYVY) POSTPR: scale: query(Packed UYVY) -> 0 dri_vo_dbg: vo_query_format(52474230) dri_vo: request for RGB 48-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 48-bit) POSTPR: scale: query(RGB 48-bit) -> 0 dri_vo_dbg: vo_query_format(524742b0) dri_vo: request for BGR 48-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 48-bit) POSTPR: scale: query(BGR 48-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) POSTPR: scale: query(BGRA) -> 1 dri_vo_dbg: vo_query_format(52474220) dri_vo: request for RGBA fourcc: 0 [vf_vo2] 0=query_format(RGBA) POSTPR: scale: query(RGBA) -> 0 dri_vo_dbg: vo_query_format(42475218) dri_vo: request for BGR 24-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 24-bit) POSTPR: scale: query(BGR 24-bit) -> 0 dri_vo_dbg: vo_query_format(52474218) dri_vo: request for RGB 24-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 24-bit) POSTPR: scale: query(RGB 24-bit) -> 0 dri_vo_dbg: vo_query_format(42475210) dri_vo: request for BGR 16-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 16-bit) POSTPR: scale: query(BGR 16-bit) -> 0 dri_vo_dbg: vo_query_format(52474210) dri_vo: request for RGB 16-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 16-bit) POSTPR: scale: query(RGB 16-bit) -> 0 dri_vo_dbg: vo_query_format(4247520f) dri_vo: request for BGR 15-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 15-bit) POSTPR: scale: query(BGR 15-bit) -> 0 dri_vo_dbg: vo_query_format(5247420f) dri_vo: request for RGB 15-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 15-bit) POSTPR: scale: query(RGB 15-bit) -> 0 dri_vo_dbg: vo_query_format(30303859) dri_vo: request for Planar Y800 fourcc: 0 [vf_vo2] 0=query_format(Planar Y800) POSTPR: scale: query(Planar Y800) -> 0 dri_vo_dbg: vo_query_format(20203859) dri_vo: request for Planar Y8 fourcc: 0 [vf_vo2] 0=query_format(Planar Y8) POSTPR: scale: query(Planar Y8) -> 0 dri_vo_dbg: vo_query_format(42475208) dri_vo: request for BGR 8-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 8-bit) POSTPR: scale: query(BGR 8-bit) -> 0 dri_vo_dbg: vo_query_format(52474208) dri_vo: request for RGB 8-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 8-bit) POSTPR: scale: query(RGB 8-bit) -> 0 dri_vo_dbg: vo_query_format(42475204) dri_vo: request for BGR 4-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit) POSTPR: scale: query(BGR 4-bit) -> 0 dri_vo_dbg: vo_query_format(52474204) dri_vo: request for RGB 4-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit) POSTPR: scale: query(RGB 4-bit) -> 0 dri_vo_dbg: vo_query_format(42475284) dri_vo: request for BGR 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(BGR 4-bit per byte) POSTPR: scale: query(BGR 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(52474284) dri_vo: request for RGB 4-bit per byte fourcc: 0 [vf_vo2] 0=query_format(RGB 4-bit per byte) POSTPR: scale: query(RGB 4-bit per byte) -> 0 dri_vo_dbg: vo_query_format(42475201) dri_vo: request for BGR 1-bit fourcc: 0 [vf_vo2] 0=query_format(BGR 1-bit) POSTPR: scale: query(BGR 1-bit) -> 0 dri_vo_dbg: vo_query_format(52474201) dri_vo: request for RGB 1-bit fourcc: 0 [vf_vo2] 0=query_format(RGB 1-bit) POSTPR: scale: query(RGB 1-bit) -> 0 dri_vo_dbg: vo_query_format(42475220) dri_vo: request for BGRA fourcc: 1 [vf_vo2] 1=query_format(BGRA) POSTPR: [sw_scale] BGRA supported on vo2 like 1025 POSTPR: [sw_scale] returning: 1089 vo_debug[step i=0]: query(Planar I420 160x120) returned 0x441 for: POSTPR: [libvf] Using video filters chain: POSTPR: [vf_fmtcvt]: video[0x0] in[Unknown 0x0000] -> out[Unknown 0x0000] POSTPR: VO-CONF: [fbdev] 352x288 => 352x288 Unknown 0x0000 [zoom] VO: Description: Framebuffer Device VO: Author: Szabolcs Berecz <sz...@in...> ---------------------- 8< --------------------- 8< ------------------------ since this commit mplayerxp doesn't call exit() function at all. Therefore it's output without illegal-patch cannot be terminated here. Modified Paths: -------------- mplayerxp/input2/input.cpp mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_a52.cpp mplayerxp/libmpcodecs/ad_dca.cpp mplayerxp/libmpcodecs/ad_dvdpcm.cpp mplayerxp/libmpcodecs/ad_faad.cpp mplayerxp/libmpcodecs/ad_internal.h mplayerxp/libmpcodecs/ad_lavc.cpp mplayerxp/libmpcodecs/ad_libdv.cpp mplayerxp/libmpcodecs/ad_mp3.cpp mplayerxp/libmpcodecs/ad_null.cpp mplayerxp/libmpcodecs/ad_pcm.cpp mplayerxp/libmpcodecs/ad_real.cpp mplayerxp/libmpcodecs/ad_vorbis.cpp mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_audio.h mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_divx4.cpp mplayerxp/libmpcodecs/vd_huffyuv.cpp mplayerxp/libmpcodecs/vd_internal.h mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libdv.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpcodecs/vd_mpegpes.cpp mplayerxp/libmpcodecs/vd_null.cpp mplayerxp/libmpcodecs/vd_nuv.cpp mplayerxp/libmpcodecs/vd_raw.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpcodecs/vd_theora.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpcodecs/vd_xvid.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libmpdemux/demux_dv.cpp mplayerxp/libmpdemux/demux_ogg.cpp mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/postproc/af.h mplayerxp/postproc/vf.cpp mplayerxp/xmpcore/xmp_context.cpp Removed Paths: ------------- mplayerxp/libmpcodecs/ad_hwac3.cpp Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2013-06-10 07:27:20 UTC (rev 650) +++ mplayerxp/input2/input.cpp 2013-06-11 14:37:50 UTC (rev 651) @@ -26,6 +26,7 @@ #include "libmpconf/cfgparser.h" #include "in_msg.h" +#include "mpxp_help.h" #ifdef HAVE_LIRC #include "lirc.h" @@ -1360,7 +1361,7 @@ static int mp_input_print_key_list(libinput_t& handle) { mp_input_print_keys(handle); - exit(0); + exit_player(MSGTR_Exit_quit); } void mp_input_print_binds(libinput_t& handle) { @@ -1406,7 +1407,7 @@ static int mp_input_print_cmd_list(libinput_t& handle) { mp_input_print_cmds(handle); - exit(0); + exit_player(MSGTR_Exit_quit); } MPXP_Rc mp_input_check_interrupt(libinput_t& handle,int tim) { Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2013-06-10 07:27:20 UTC (rev 650) +++ mplayerxp/libmpcodecs/Makefile 2013-06-11 14:37:50 UTC (rev 651) @@ -6,7 +6,7 @@ DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done CXXSRCS=dec_video.cpp vd.cpp ad.cpp dec_audio.cpp -CXXSRCS+=ad_a52.cpp ad_hwac3.cpp +CXXSRCS+=ad_a52.cpp CXXSRCS+=vd_lavc.cpp \ Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-06-10 07:27:20 UTC (rev 650) +++ mplayerxp/libmpcodecs/ad.cpp 2013-06-11 14:37:50 UTC (rev 651) @@ -16,100 +16,106 @@ #include "ad_msg.h" /* Missed vorbis, mad, dshow */ +namespace usr { -extern const ad_functions_t mpcodecs_ad_null; -extern const ad_functions_t mpcodecs_ad_mp3; -extern const ad_functions_t mpcodecs_ad_lavc; -extern const ad_functions_t mpcodecs_ad_a52; -extern const ad_functions_t mpcodecs_ad_dca; -extern const ad_functions_t mpcodecs_ad_hwac3; -extern const ad_functions_t mpcodecs_ad_pcm; -extern const ad_functions_t mpcodecs_ad_libdv; -extern const ad_functions_t mpcodecs_ad_dvdpcm; -extern const ad_functions_t mpcodecs_ad_dshow; -extern const ad_functions_t mpcodecs_ad_msacm; -extern const ad_functions_t mpcodecs_ad_faad; -extern const ad_functions_t mpcodecs_ad_vorbis; -extern const ad_functions_t mpcodecs_ad_real; -extern const ad_functions_t mpcodecs_ad_twin; -extern const ad_functions_t mpcodecs_ad_dmo; -extern const ad_functions_t mpcodecs_ad_qtaudio; +extern const ad_info_t ad_null_info; +extern const ad_info_t ad_mp3_info; +extern const ad_info_t ad_lavc_info; +extern const ad_info_t ad_a52_info; +extern const ad_info_t ad_dca_info; +extern const ad_info_t ad_pcm_info; +extern const ad_info_t ad_libdv_info; +extern const ad_info_t ad_dvdpcm_info; +extern const ad_info_t ad_dshow_info; +extern const ad_info_t ad_msacm_info; +extern const ad_info_t ad_faad_info; +extern const ad_info_t ad_vorbis_info; +extern const ad_info_t ad_real_info; +extern const ad_info_t ad_twin_info; +extern const ad_info_t ad_dmo_info; +extern const ad_info_t ad_qtaudio_info; -static const ad_functions_t* mpcodecs_ad_drivers[] = { - &mpcodecs_ad_mp3, - &mpcodecs_ad_a52, - &mpcodecs_ad_dca, - &mpcodecs_ad_hwac3, - &mpcodecs_ad_pcm, - &mpcodecs_ad_dvdpcm, - &mpcodecs_ad_faad, +static const ad_info_t* mpcodecs_ad_drivers[] = { + &ad_mp3_info, + &ad_a52_info, + &ad_dca_info, + &ad_pcm_info, + &ad_dvdpcm_info, + &ad_faad_info, #ifdef HAVE_LIBVORBIS - &mpcodecs_ad_vorbis, + &ad_vorbis_info, #endif #ifdef HAVE_LIBDV - &mpcodecs_ad_libdv, + &ad_libdv_info, #endif #ifndef ENABLE_GPL_ONLY - &mpcodecs_ad_real, + &ad_real_info, #endif - &mpcodecs_ad_lavc, - &mpcodecs_ad_null, - + &ad_lavc_info, + &ad_null_info }; -static unsigned int nddrivers=sizeof(mpcodecs_ad_drivers)/sizeof(ad_functions_t*); - void libmpcodecs_ad_register_options(M_Config& cfg) { unsigned i; - for(i=0;i<nddrivers;i++) { - if(mpcodecs_ad_drivers[i]) - if(mpcodecs_ad_drivers[i]->options) - cfg.register_options(mpcodecs_ad_drivers[i]->options); - if(mpcodecs_ad_drivers[i]==&mpcodecs_ad_null) break; + for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { + if(mpcodecs_ad_drivers[i]->options) + cfg.register_options(mpcodecs_ad_drivers[i]->options); } } -const ad_functions_t* afm_find_driver(const std::string& name) { +const ad_info_t* afm_find_driver(const std::string& name) { unsigned i; - for (i=0; mpcodecs_ad_drivers[i] != &mpcodecs_ad_null; i++) { - if(name==mpcodecs_ad_drivers[i]->info->driver_name){ + for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { + if(name==mpcodecs_ad_drivers[i]->driver_name) return mpcodecs_ad_drivers[i]; - } } return NULL; } -const audio_probe_t* afm_probe_driver(Opaque& ctx,sh_audio_t *sh,audio_filter_info_t& afi) { +Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi) { unsigned i; - const audio_probe_t* probe; - for (i=0; mpcodecs_ad_drivers[i] != &mpcodecs_ad_null; i++) { - mpxp_v<<"Probing: "<<mpcodecs_ad_drivers[i]->info->driver_name<<std::endl; - if((probe=mpcodecs_ad_drivers[i]->probe(sh->wtag))!=NULL) { - Opaque* priv=mpcodecs_ad_drivers[i]->preinit(*probe,sh,afi); - mpxp_v<<"Driver: "<<mpcodecs_ad_drivers[i]->info->driver_name<<" supports these outfmt for "; - fourcc(mpxp_v,sh->wtag); + Audio_Decoder* drv=NULL; + for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { + mpxp_v<<"Probing: "<<mpcodecs_ad_drivers[i]->driver_name; + try { + /* Set up some common usefull defaults. ad->preinit() can override these: */ +#ifdef WORDS_BIGENDIAN + sh.afmt=AFMT_S16_BE; +#else + sh.afmt=AFMT_S16_LE; +#endif + sh.rate=0; + sh.o_bps=0; + drv=mpcodecs_ad_drivers[i]->query_interface(sh,afi,sh.wtag); + mpxp_v<<"ok"<<std::endl; + mpxp_v<<"Driver: "<<mpcodecs_ad_drivers[i]->driver_name<<" supports these outfmt for "; + fourcc(mpxp_v,sh.wtag); mpxp_v<<std::endl; + audio_probe_t probe=drv->get_probe_information(); for(i=0;i<Audio_MaxOutSample;i++) { - mpxp_v<<std::hex<<probe->sample_fmt[i]<<" "; - if(probe->sample_fmt[i]==-1||probe->sample_fmt[i]==0) break; + mpxp_v<<std::hex<<probe.sample_fmt[i]<<" "; + if(probe.sample_fmt[i]==unsigned(-1)||probe.sample_fmt[i]==0) break; } mpxp_v<<std::endl; - mpcodecs_ad_drivers[i]->uninit(*priv); - delete priv; - return probe; + break; + } catch (const bad_format_exception& ) { + mpxp_v<<"failed"<<std::endl; + delete drv; drv=NULL; + continue; } } - return NULL; + return drv; } -void afm_help(void) { - unsigned i; - mpxp_info<<"Available audio codec families/drivers:"<<std::endl; - for(i=0;i<nddrivers;i++) { - if(mpcodecs_ad_drivers[i]) - if(mpcodecs_ad_drivers[i]->options) - mpxp_info<<"\t"<<std::left<<std::setw(10)<<mpcodecs_ad_drivers[i]->info->driver_name<<" "<<mpcodecs_ad_drivers[i]->info->descr<<std::endl; - } - mpxp_info<<std::endl; +void afm_help() { + unsigned i; + mpxp_info<<"Available audio codec families/drivers:"<<std::endl; + for (i=0; mpcodecs_ad_drivers[i] != &ad_null_info; i++) { + if(mpcodecs_ad_drivers[i]) + if(mpcodecs_ad_drivers[i]->options) + mpxp_info<<"\t"<<std::left<<std::setw(10)<<mpcodecs_ad_drivers[i]->driver_name<<" "<<mpcodecs_ad_drivers[i]->descr<<std::endl; + } + mpxp_info<<std::endl; } +} //namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2013-06-10 07:27:20 UTC (rev 650) +++ mplayerxp/libmpcodecs/ad.h 2013-06-11 14:37:50 UTC (rev 651) @@ -8,57 +8,59 @@ #include "xmpcore/xmp_enums.h" #include "libao3/afmt.h" -struct ad_info_t { - const char *descr; /* driver description ("Autodesk FLI/FLC Animation decoder" */ - const char *driver_name; /* driver name ("dshow") */ - const char *author; /* interface author/maintainer */ - const char *url; /* URL of homepage */ -}; +namespace usr { + struct mpxp_options_t; + enum { + ADCTRL_RESYNC_STREAM=0, + ADCTRL_SKIP_FRAME =1 + }; -enum { - ADCTRL_RESYNC_STREAM=0, - ADCTRL_SKIP_FRAME =1 -}; + enum { + Audio_MaxOutSample =16, + }; -enum { - Audio_MaxOutSample =16, -}; + typedef enum { + ACodecStatus_Working =3, + ACodecStatus_Problems =2, + ACodecStatus_Untested =1, + ACodecStatus_NotWorking =0, + }acodec_status_e; -typedef enum { - ACodecStatus_Working =3, - ACodecStatus_Problems =2, - ACodecStatus_Untested =1, - ACodecStatus_NotWorking =0, -}acodec_status_e; + struct audio_probe_t { + const char* driver; + const char* codec_dll; + uint32_t wtag; + acodec_status_e status; + unsigned sample_fmt[Audio_MaxOutSample]; + }; -struct audio_probe_t { - const char* driver; - const char* codec_dll; - uint32_t wtag; - acodec_status_e status; - unsigned sample_fmt[Audio_MaxOutSample]; -}; + struct audio_filter_info_t { + af_stream_t* afilter; + int afilter_inited; + }; -struct audio_filter_info_t { - af_stream_t* afilter; - int afilter_inited; -}; + class Audio_Decoder : public Opaque { + public: + Audio_Decoder(sh_audio_t&,audio_filter_info_t&,uint32_t wtag) { UNUSED(wtag); } + virtual ~Audio_Decoder() {} -/* interface of video decoder drivers */ -struct ad_functions_t -{ - const ad_info_t* info; - const mpxp_option_t* options;/**< Optional: MPlayerXP's option related */ - const audio_probe_t*(* __FASTCALL__ probe)(uint32_t wtag); - Opaque* (* __FASTCALL__ preinit)(const audio_probe_t&,sh_audio_t*,audio_filter_info_t&); - MPXP_Rc (* __FASTCALL__ init)(Opaque& ctx); - void (* __FASTCALL__ uninit)(Opaque& ctx); - MPXP_Rc (*control_ad)(Opaque& ctx,int cmd,any_t* arg, ...); - unsigned (* __FASTCALL__ decode)(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts); -}; + virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) = 0; + virtual MPXP_Rc ctrl(int cmd,any_t* arg) = 0; + virtual audio_probe_t get_probe_information() const = 0; + }; -extern const ad_functions_t* afm_find_driver(const std::string& name); -extern const audio_probe_t* afm_probe_driver(Opaque& ctx,sh_audio_t*sh,audio_filter_info_t& afi); -inline float FIX_APTS(sh_audio_t* sh_audio,float& pts,unsigned in_size) { return sh_audio->i_bps?(pts+float(in_size))/float(sh_audio->i_bps):pts; } + struct ad_info_t { + const char* descr; /* driver description ("Autodesk FLI/FLC Animation decoder" */ + const char* driver_name; /* driver name ("dshow") */ + const char* author; /* interface author/maintainer */ + const char* url; /* URL of homepage */ + Audio_Decoder* (*query_interface)(sh_audio_t&,audio_filter_info_t&,uint32_t wtag); + const mpxp_option_t* options; + }; + const ad_info_t* afm_find_driver(const std::string& name); + Audio_Decoder* afm_probe_driver(sh_audio_t& sh,audio_filter_info_t& afi); + inline float FIX_APTS(sh_audio_t& sh_audio,float& pts,unsigned in_size) { return sh_audio.i_bps?(pts+float(in_size))/float(sh_audio.i_bps):pts; } +} //namespace usr + #endif Modified: mplayerxp/libmpcodecs/ad_a52.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-10 07:27:20 UTC (rev 650) +++ mplayerxp/libmpcodecs/ad_a52.cpp 2013-06-11 14:37:50 UTC (rev 651) @@ -8,6 +8,7 @@ #include <assert.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "ad_internal.h" +#include "liba52/a52.h" #include "codecs_ld.h" #include "mplayerxp.h" @@ -17,41 +18,32 @@ #include "osdep/mm_accel.h" #include "mplayerxp.h" -#include "liba52/a52.h" #include "libao3/afmt.h" #include "libao3/audio_out.h" #include "postproc/af.h" -struct a52_private_t : public Opaque { - a52_private_t(); - virtual ~a52_private_t(); +namespace usr { + class a52_decoder : public Audio_Decoder { + public: + a52_decoder(sh_audio_t&,audio_filter_info_t&,uint32_t wtag); + virtual ~a52_decoder(); - sh_audio_t* sh; - float last_pts; -}; -a52_private_t::a52_private_t() {} -a52_private_t::~a52_private_t() {} + virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts); + virtual MPXP_Rc ctrl(int cmd,any_t* arg); + virtual audio_probe_t get_probe_information() const; + private: + int printinfo() const; + int fillbuffer(float& pts); -static const int MAX_AC3_FRAME=3840; + a52_state_t* mpxp_a52_state; + uint32_t mpxp_a52_accel; + uint32_t mpxp_a52_flags; + sh_audio_t& sh; + float last_pts; + const audio_probe_t* probe; + static const int MAX_AC3_FRAME=3840; + }; -a52_state_t* mpxp_a52_state; -uint32_t mpxp_a52_accel=0; -uint32_t mpxp_a52_flags=0; - -static const ad_info_t info = -{ - "liba52 AC3 driver", - "liba52", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(a52) - static const audio_probe_t probes[] = { { "liba52", "liba52", 0x2000, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S16_LE} }, { "liba52", "liba52", 0x20736D, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S16_LE} }, @@ -61,56 +53,47 @@ { NULL, NULL, 0x0, ACodecStatus_NotWorking, {AFMT_S8}} }; -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { - unsigned i; - for(i=0;probes[i].driver;i++) - if(wtag==probes[i].wtag) - return &probes[i]; - return NULL; -} - -int a52_fillbuff(a52_private_t& priv,float& pts){ +int a52_decoder::fillbuffer(float& pts){ int length=0; int flags=0; int sample_rate=0; int bit_rate=0; float apts=0.,null_pts; - sh_audio_t* sh_audio = priv.sh; - sh_audio->a_in_buffer_len=0; + sh.a_in_buffer_len=0; /* sync frame:*/ while(1){ - while(sh_audio->a_in_buffer_len<8){ - int c=demux_getc_r(*sh_audio->ds,apts?null_pts:apts); - if(c<0) { priv.last_pts=pts=apts; return -1; } /* EOF*/ - sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c; + while(sh.a_in_buffer_len<8){ + int c=demux_getc_r(*sh.ds,apts?null_pts:apts); + if(c<0) { last_pts=pts=apts; return -1; } /* EOF*/ + sh.a_in_buffer[sh.a_in_buffer_len++]=c; } - if(sh_audio->wtag!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); - length = a52_syncinfo ((uint8_t*)sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); + if(sh.wtag!=0x2000) swab(sh.a_in_buffer,sh.a_in_buffer,8); + length = a52_syncinfo ((uint8_t*)sh.a_in_buffer, &flags, &sample_rate, &bit_rate); if(length>=7 && length<=MAX_AC3_FRAME) break; /* we're done.*/ /* bad file => resync*/ - if(sh_audio->wtag!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8); - memmove(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,7); - --sh_audio->a_in_buffer_len; + if(sh.wtag!=0x2000) swab(sh.a_in_buffer,sh.a_in_buffer,8); + memmove(sh.a_in_buffer,sh.a_in_buffer+1,7); + --sh.a_in_buffer_len; apts=0; } - MSG_DBG2("a52: len=%d flags=0x%X %d Hz %d bit/s\n",length,flags,sample_rate,bit_rate); - sh_audio->rate=sample_rate; - sh_audio->i_bps=bit_rate/8; - demux_read_data_r(*sh_audio->ds,(uint8_t*)sh_audio->a_in_buffer+8,length-8,apts?null_pts:apts); - if(sh_audio->wtag!=0x2000) swab(sh_audio->a_in_buffer+8,sh_audio->a_in_buffer+8,length-8); - priv.last_pts=pts=apts; - if(crc16_block((uint8_t*)sh_audio->a_in_buffer+2,length-2)!=0) - MSG_STATUS("a52: CRC check failed! \n"); + mpxp_dbg2<<"a52: len="<<length<<" flags=0x"<<std::hex<<flags<<" "<<sample_rate<<" Hz "<<bit_rate<<" bit/s"<<std::endl; + sh.rate=sample_rate; + sh.i_bps=bit_rate/8; + demux_read_data_r(*sh.ds,(uint8_t*)sh.a_in_buffer+8,length-8,apts?null_pts:apts); + if(sh.wtag!=0x2000) swab(sh.a_in_buffer+8,sh.a_in_buffer+8,length-8); + last_pts=pts=apts; + if(crc16_block((uint8_t*)sh.a_in_buffer+2,length-2)!=0) + mpxp_status<<"a52: CRC check failed!"<<std::endl; return length; } /* returns: number of available channels*/ -static int a52_printinfo(sh_audio_t *sh_audio){ +int a52_decoder::printinfo() const { int flags, sample_rate, bit_rate; const char* mode="unknown"; int channels=0; - a52_syncinfo ((uint8_t*)sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate); + a52_syncinfo ((uint8_t*)sh.a_in_buffer, &flags, &sample_rate, &bit_rate); switch(flags&A52_CHANNEL_MASK){ case A52_CHANNEL: mode="channel"; channels=2; break; case A52_MONO: mode="mono"; channels=1; break; @@ -124,20 +107,22 @@ case A52_CHANNEL2: mode="channel2"; channels=2; break; case A52_DOLBY: mode="dolby"; channels=2; break; } - MSG_INFO("AC3: %d.%d (%s%s) %d Hz %3.1f kbit/s Out: %u-bit\n", - channels, (flags&A52_LFE)?1:0, - mode, (flags&A52_LFE)?"+lfe":"", - sample_rate, bit_rate*0.001f, - afmt2bps(sh_audio->afmt)*8); - return (flags&A52_LFE) ? (channels+1) : channels; + mpxp_info<<"AC3: "<<channels<<"."<<((flags&A52_LFE)?1:0)<<" ("<<mode<<((flags&A52_LFE)?"+lfe":"")<<") "<<sample_rate<<" Hz "<<(bit_rate*0.001f)<<"f kbit/s Out: "<<(afmt2bps(sh.afmt)*8)<<"-bit"<<std::endl; + return (flags&A52_LFE) ? (channels+1) : channels; } -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh,audio_filter_info_t& afi) +a52_decoder::a52_decoder(sh_audio_t& _sh,audio_filter_info_t& afi,uint32_t wtag) + :Audio_Decoder(_sh,afi,wtag) + ,sh(_sh) { - UNUSED(probe); - a52_private_t* ctx=new(zeromem) a52_private_t; - /* Dolby AC3 audio: */ - /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */ + unsigned i; + for(i=0;probes[i].driver;i++) + if(wtag==probes[i].wtag) + probe=&probes[i]; + if(!probe) throw bad_format_exception(); + + /* Dolby AC3 audio: */ + /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */ #ifdef WORDS_BIGENDIAN #define A52_FMT32 AFMT_S32_BE #define A52_FMT24 AFMT_S24_BE @@ -145,41 +130,26 @@ #define A52_FMT32 AFMT_S32_LE #define A52_FMT24 AFMT_S24_LE #endif - sh->afmt=bps2afmt(2); - if(af_query_fmt(afi.afilter,mpaf_format_e(AFMT_FLOAT32)) == MPXP_Ok|| - af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT32)) == MPXP_Ok || - af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT24)) == MPXP_Ok) { - sh->afmt=AFMT_FLOAT32; - } - sh->audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh->afmt)*256*6; - sh->audio_in_minsize=MAX_AC3_FRAME; - ctx->sh=sh; - return ctx; -} + sh.afmt=bps2afmt(2); + if(af_query_fmt(afi.afilter,mpaf_format_e(AFMT_FLOAT32)) == MPXP_Ok|| + af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT32)) == MPXP_Ok || + af_query_fmt(afi.afilter,mpaf_format_e(A52_FMT24)) == MPXP_Ok) sh.afmt=AFMT_FLOAT32; + sh.audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh.afmt)*256*6; + sh.audio_in_minsize=MAX_AC3_FRAME; -MPXP_Rc init(Opaque& ctx) -{ - a52_private_t& priv=static_cast<a52_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; sample_t level=1, bias=384; float pts; int flags=0; /* Dolby AC3 audio:*/ mpxp_a52_accel = mpxp_context().mplayer_accel; mpxp_a52_state=a52_init (mpxp_a52_accel); - if (mpxp_a52_state == NULL) { - MSG_ERR("A52 init failed\n"); - return MPXP_False; - } - if(a52_fillbuff(priv,pts)<0){ - MSG_ERR("A52 sync failed\n"); - return MPXP_False; - } + if (mpxp_a52_state == NULL) throw bad_format_exception(); + if(fillbuffer(pts)<0) throw bad_format_exception(); /* 'a52 cannot upmix' hotfix:*/ - a52_printinfo(priv.sh); - sh_audio->nch=mp_conf.ao_channels; - while(sh_audio->nch>0){ - switch(sh_audio->nch){ + printinfo(); + sh.nch=mp_conf.ao_channels; + while(sh.nch>0){ + switch(sh.nch){ case 1: mpxp_a52_flags=A52_MONO; break; /* case 2: mpxp_a52_flags=A52_STEREO; break; */ case 2: mpxp_a52_flags=A52_DOLBY; break; @@ -191,41 +161,34 @@ } /* test:*/ flags=mpxp_a52_flags|A52_ADJUST_LEVEL; - MSG_V("A52 flags before a52_frame: 0x%X\n",flags); - if (a52_frame (mpxp_a52_state, (uint8_t*)sh_audio->a_in_buffer, &flags, &level, bias)){ - MSG_ERR("a52: error decoding frame -> nosound\n"); - return MPXP_False; - } - MSG_V("A52 flags after a52_frame: 0x%X\n",flags); + mpxp_v<<"A52 flags before a52_frame: 0x"<<std::hex<<flags<<std::endl; + if (a52_frame (mpxp_a52_state, (uint8_t*)sh.a_in_buffer, &flags, &level, bias)) throw bad_format_exception(); + mpxp_v<<"A52 flags after a52_frame: 0x"<<std::hex<<flags<<std::endl; /* frame decoded, let's init resampler:*/ - if(afmt2bps(sh_audio->afmt)==4) { - if(a52_resample_init_float(mpxp_a52_state,mpxp_a52_accel,flags,sh_audio->nch)) break; + if(afmt2bps(sh.afmt)==4) { + if(a52_resample_init_float(mpxp_a52_state,mpxp_a52_accel,flags,sh.nch)) break; } else { - if(a52_resample_init(mpxp_a52_state,mpxp_a52_accel,flags,sh_audio->nch)) break; + if(a52_resample_init(mpxp_a52_state,mpxp_a52_accel,flags,sh.nch)) break; } - --sh_audio->nch; /* try to decrease no. of channels*/ + --sh.nch; /* try to decrease no. of channels*/ } - if(sh_audio->nch<=0){ - MSG_ERR("a52: no resampler. try different channel setup!\n"); - return MPXP_False; - } - return MPXP_Ok; + if(sh.nch<=0) throw bad_format_exception(); } -void uninit(Opaque& ctx) { UNUSED(ctx); } +a52_decoder::~a52_decoder() {} -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) +audio_probe_t a52_decoder::get_probe_information() const { return *probe; } + +MPXP_Rc a52_decoder::ctrl(int cmd,any_t* arg) { - a52_private_t& priv=static_cast<a52_private_t&>(ctx); - sh_audio_t* sh = priv.sh; UNUSED(arg); switch(cmd) { case ADCTRL_RESYNC_STREAM: - sh->a_in_buffer_len=0; // reset ACM/DShow audio buffer + sh.a_in_buffer_len=0; // reset ACM/DShow audio buffer return MPXP_True; case ADCTRL_SKIP_FRAME: { float pts; - a52_fillbuff(priv,pts); // skip AC3 frame + fillbuffer(pts); // skip AC3 frame return MPXP_True; } default: @@ -234,35 +197,50 @@ return MPXP_Unknown; } -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) +unsigned a52_decoder::run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) { - a52_private_t& priv=static_cast<a52_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; sample_t level=1, bias=384; int flags=mpxp_a52_flags|A52_ADJUST_LEVEL; unsigned i; unsigned len=0; UNUSED(minlen); UNUSED(maxlen); - if(!sh_audio->a_in_buffer_len) { - if(a52_fillbuff(priv,pts)<0) return len; /* EOF */ - } else pts=priv.last_pts; - sh_audio->a_in_buffer_len=0; - if (a52_frame (mpxp_a52_state, (uint8_t*)sh_audio->a_in_buffer, &flags, &level, bias)){ - MSG_WARN("a52: error decoding frame\n"); + if(!sh.a_in_buffer_len) { + if(fillbuffer(pts)<0) return len; /* EOF */ + } else pts=last_pts; + sh.a_in_buffer_len=0; + if (a52_frame (mpxp_a52_state, (uint8_t*)sh.a_in_buffer, &flags, &level, bias)){ + mpxp_warn<<"a52: error decoding frame"<<std::endl; return len; } // a52_dynrng(&mpxp_a52_state, NULL, NULL); len=0; for (i = 0; i < 6; i++) { if (a52_block (mpxp_a52_state)){ - MSG_WARN("a52: error at resampling\n"); + mpxp_warn<<"a52: error at resampling"<<std::endl; break; } - if(afmt2bps(sh_audio->afmt)==4) + if(afmt2bps(sh.afmt)==4) len+=4*a52_resample32(a52_samples(mpxp_a52_state),(float *)&buf[len]); else len+=2*a52_resample(a52_samples(mpxp_a52_state),(int16_t *)&buf[len]); } return len; } + +static const mpxp_option_t options[] = { + { NULL, NULL, 0, 0, 0, 0, NULL} +}; + +static Audio_Decoder* query_interface(sh_audio_t& sh,audio_filter_info_t& afi,uint32_t wtag) { return new(zeromem) a52_decoder(sh,afi,wtag); } + +extern const ad_info_t ad_a52_info = { + "liba52 AC3 driver", + "liba52", + "Nickols_K", + "build-in", + query_interface, + options +}; + +} // namespace usr \ No newline at end of file Modified: mplayerxp/libmpcodecs/ad_dca.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-10 07:27:20 UTC (rev 650) +++ mplayerxp/libmpcodecs/ad_dca.cpp 2013-06-11 14:37:50 UTC (rev 651) @@ -22,35 +22,29 @@ #include "libao3/audio_out.h" #include "postproc/af.h" -static const unsigned MAX_AC5_FRAME=4096; +namespace usr { + class dca_decoder : public Audio_Decoder { + public: + dca_decoder(sh_audio_t&,audio_filter_info_t&,uint32_t wtag); + virtual ~dca_decoder(); -dca_state_t* mpxp_dca_state; -uint32_t mpxp_dca_accel=0; -uint32_t mpxp_dca_flags=0; + virtual unsigned run(unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts); + virtual MPXP_Rc ctrl(int cmd,any_t* arg); + virtual audio_probe_t get_probe_information() const; + private: + int fillbuffer(float& pts); + int printinfo() const; -struct dca_private_t : public Opaque { - dca_private_t(); - virtual ~dca_private_t(); + float last_pts; + sh_audio_t& sh; + const audio_probe_t*probe; - float last_pts; - sh_audio_t* sh; -}; -dca_private_t::dca_private_t() {} -dca_private_t::~dca_private_t() {} + dca_state_t* mpxp_dca_state; + uint32_t mpxp_dca_accel; + uint32_t mpxp_dca_flags; + static const unsigned MAX_AC5_FRAME=4096; + }; -static const ad_info_t info = { - "DTS Coherent Acoustics", - "libdca", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(dca) - static const audio_probe_t probes[] = { { "libdca", "libdca", 0x86, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S24_LE, AFMT_S16_LE} }, { "libdca", "libdca", 0x2001, ACodecStatus_Working, {AFMT_FLOAT32, AFMT_S24_LE, AFMT_S16_LE} }, @@ -63,51 +57,42 @@ { NULL, NULL, 0x0, ACodecStatus_NotWorking, {AFMT_S8}} }; -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { - unsigned i; - for(i=0;probes[i].driver;i++) - if(wtag==probes[i].wtag) - return &probes[i]; - return NULL; -} - -int dca_fillbuff(dca_private_t& priv,float& pts){ +int dca_decoder::fillbuffer(float& pts){ int length=0,flen=0; int flags=0; int sample_rate=0; int bit_rate=0; float apts=0.,null_pts; - sh_audio_t* sh_audio=priv.sh; - sh_audio->a_in_buffer_len=0; + sh.a_in_buffer_len=0; /* sync frame:*/ while(1){ - while(sh_audio->a_in_buffer_len<16){ - int c=demux_getc_r(*sh_audio->ds,apts?null_pts:apts); - if(c<0) { priv.last_pts=pts=apts; return -1; } /* EOF*/ - sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c; + while(sh.a_in_buffer_len<16){ + int c=demux_getc_r(*sh.ds,apts?null_pts:apts); + if(c<0) { last_pts=pts=apts; return -1; } /* EOF*/ + sh.a_in_buffer[sh.a_in_buffer_len++]=c; } - length = dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh_audio->a_in_buffer), reinterpret_cast<int *>(&flags), &sample_rate, &bit_rate, &flen); - if(length>=16 && length<=MAX_AC5_FRAME) break; /* we're done.*/ + length = dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh.a_in_buffer), reinterpret_cast<int *>(&flags), &sample_rate, &bit_rate, &flen); + if(length>=16 && length<=int(MAX_AC5_FRAME)) break; /* we're done.*/ /* bad file => resync*/ - memmove(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,15); - --sh_audio->a_in_buffer_len; + memmove(sh.a_in_buffer,sh.a_in_buffer+1,15); + --sh.a_in_buffer_len; apts=0; } - MSG_DBG2("dca[%08X]: len=%d flags=0x%X %d Hz %d bit/s frame=%u\n",*((long *)sh_audio->a_in_buffer),length,flags,sample_rate,bit_rate,flen); - sh_audio->rate=sample_rate; - sh_audio->i_bps=bit_rate/8; - demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(sh_audio->a_in_buffer+16),length-16,apts?null_pts:apts); - priv.last_pts=pts=apts; + mpxp_dbg2<<"dca["<<std::hex<<std::setfill('0')<<std::setw(8)<<(*((long *)sh.a_in_buffer))<<"]: len="<<length<<" flags=0x"<<std::hex<<flags<<" "<<sample_rate<<" Hz "<<bit_rate<<" bit/s frame="<<flen<<std::endl; + sh.rate=sample_rate; + sh.i_bps=bit_rate/8; + demux_read_data_r(*sh.ds,reinterpret_cast<unsigned char*>(sh.a_in_buffer+16),length-16,apts?null_pts:apts); + last_pts=pts=apts; return length; } /* returns: number of available channels*/ -static int dca_printinfo(sh_audio_t *sh_audio){ - int flags, sample_rate, bit_rate,flen,length; +int dca_decoder::printinfo() const { + int flags, sample_rate, bit_rate,flen; const char* mode="unknown"; int channels=0; - length=dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh_audio->a_in_buffer), reinterpret_cast<int*>(&flags), &sample_rate, &bit_rate,&flen); + dca_syncinfo (mpxp_dca_state,reinterpret_cast<uint8_t*>(sh.a_in_buffer), reinterpret_cast<int*>(&flags), &sample_rate, &bit_rate,&flen); switch(flags&DCA_CHANNEL_MASK){ case DCA_CHANNEL: mode="channel"; channels=2; break; case DCA_MONO: mode="mono"; channels=1; break; @@ -121,17 +106,19 @@ case DCA_DOLBY: mode="dolby"; channels=2; break; default: channels=0; break; } - MSG_INFO("DCA: %d.%d (%s%s) %d Hz %3.1f kbit/s Out: %u-bit\n", - channels, (flags&DCA_LFE)?1:0, - mode, (flags&DCA_LFE)?"+lfe":"", - sample_rate, bit_rate*0.001f, - afmt2bps(sh_audio->afmt)*8); + mpxp_info<<"DCA: "<<channels<<"."<<((flags&DCA_LFE)?1:0)<<" ("<<mode<<((flags&DCA_LFE)?"+lfe":"")<<") "<<sample_rate<<" Hz "<<bit_rate*0.001f<<" kbit/s Out: "<<(afmt2bps(sh.afmt)*8)<<"-bit"<<std::endl; return (flags&DCA_LFE) ? (channels+1) : channels; } -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh,audio_filter_info_t& afi) +dca_decoder::dca_decoder(sh_audio_t& _sh,audio_filter_info_t& afi,uint32_t wtag) + :Audio_Decoder(_sh,afi,wtag) + ,sh(_sh) { - UNUSED(probe); + unsigned i; + for(i=0;probes[i].driver;i++) + if(wtag==probes[i].wtag) + probe=&probes[i]; + if(!probe) throw bad_format_exception(); /* DTS audio: however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */ #ifdef WORDS_BIGENDIAN @@ -141,43 +128,29 @@ #define DCA_FMT32 AFMT_S32_LE #define DCA_FMT24 AFMT_S24_LE #endif - sh->afmt=bps2afmt(2); + sh.afmt=bps2afmt(2); if( af_query_fmt(afi.afilter,afmt2mpaf(AFMT_FLOAT32)) == MPXP_Ok|| af_query_fmt(afi.afilter,afmt2mpaf(DCA_FMT32)) == MPXP_Ok || - af_query_fmt(afi.afilter,afmt2mpaf(DCA_FMT24)) == MPXP_Ok) - { - sh->afmt=AFMT_FLOAT32; + af_query_fmt(afi.afilter,afmt2mpaf(DCA_FMT24)) == MPXP_Ok) { + sh.afmt=AFMT_FLOAT32; } - sh->audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh->afmt)*256*8; - sh->audio_in_minsize=MAX_AC5_FRAME; - dca_private_t* priv = new(zeromem) dca_private_t; - priv->sh = sh; - return priv; -} + sh.audio_out_minsize=mp_conf.ao_channels*afmt2bps(sh.afmt)*256*8; + sh.audio_in_minsize=MAX_AC5_FRAME; -MPXP_Rc init(Opaque& ctx) -{ - dca_private_t& priv=static_cast<dca_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; sample_t level=1, bias=384; float pts; int flags=0; /* Dolby AC3 audio:*/ mpxp_dca_accel = mpxp_context().mplayer_accel; mpxp_dca_state = dca_init(mpxp_dca_accel); - if (mpxp_dca_state == NULL) { - MSG_ERR("dca init failed\n"); - return MPXP_False; - } - if(dca_fillbuff(priv,pts)<0){ - MSG_ERR("dca sync failed\n"); - return MPXP_False; - } + if (mpxp_dca_state == NULL) throw bad_format_exception(); + if(fillbuffer(pts)<0) throw bad_format_exception(); + /* 'dca cannot upmix' hotfix:*/ - dca_printinfo(sh_audio); - sh_audio->nch=mp_conf.ao_channels; - while(sh_audio->nch>0){ - switch(sh_audio->nch){ + printinfo(); + sh.nch=mp_conf.ao_channels; + while(sh.nch>0){ + switch(sh.nch){ case 1: mpxp_dca_flags=DCA_MONO; break; case 2: mpxp_dca_flags=DCA_STEREO; break; /* case 2: mpxp_dca_flags=DCA_DOLBY; break; */ @@ -189,40 +162,34 @@ } /* test:*/ flags=mpxp_dca_flags|DCA_ADJUST_LEVEL; - MSG_V("dca flags before dca_frame: 0x%X\n",flags); - if (dca_frame (mpxp_dca_state, reinterpret_cast<uint8_t*>(sh_audio->a_in_buffer), reinterpret_cast<int*>(&flags), &level, bias)){ - MSG_ERR("dca: error decoding frame -> nosound\n"); - return MPXP_False; - } - MSG_V("dca flags after dca_frame: 0x%X\n",flags); - if(afmt2bps(sh_audio->afmt)==4) { - if(dca_resample_init_float(mpxp_dca_state,mpxp_dca_accel,flags,sh_audio->nch)) break; + mpxp_v<<"dca flags before dca_frame: 0x"<<std::hex<<flags<<std::endl; + if (dca_frame (mpxp_dca_state, reinterpret_cast<uint8_t*>(sh.a_in_buffer), reinterpret_cast<int*>(&flag... [truncated message content] |
From: <nic...@us...> - 2013-06-10 07:27:28
|
Revision: 650 http://sourceforge.net/p/mplayerxp/code/650 Author: nickols_k Date: 2013-06-10 07:27:20 +0000 (Mon, 10 Jun 2013) Log Message: ----------- remove support of win32 binary codecs as incompatible with GPL-licence Modified Paths: -------------- mplayerxp/Makefile mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpconf/Makefile mplayerxp/libmpconf/codec-cfg.h mplayerxp/libmpdemux/asf.h mplayerxp/libmpdemux/aviprint.h mplayerxp/libmpdemux/demux_mkv.cpp mplayerxp/libmpdemux/demux_mov.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpdemux/mux_mpxp64.cpp mplayerxp/libmpdemux/mux_raw.cpp mplayerxp/libmpdemux/muxer.cpp mplayerxp/libmpdemux/stheader.h mplayerxp/libmpstream2/s_oss.cpp mplayerxp/main.cpp mplayerxp/postproc/af_format.cpp mplayerxp/xmpcore/xmp_aframe.cpp Added Paths: ----------- mplayerxp/win32sdk/ mplayerxp/win32sdk/avifmt.h mplayerxp/win32sdk/basetsd.h mplayerxp/win32sdk/debugtools.h mplayerxp/win32sdk/driver.h mplayerxp/win32sdk/elfdll.h mplayerxp/win32sdk/heap.h mplayerxp/win32sdk/ldt.h mplayerxp/win32sdk/mmreg.h mplayerxp/win32sdk/module.h mplayerxp/win32sdk/msacm.h mplayerxp/win32sdk/msacmdrv.h mplayerxp/win32sdk/ntdef.h mplayerxp/win32sdk/objbase.h mplayerxp/win32sdk/pe_image.h mplayerxp/win32sdk/poppack.h mplayerxp/win32sdk/pshpack1.h mplayerxp/win32sdk/pshpack2.h mplayerxp/win32sdk/pshpack4.h mplayerxp/win32sdk/pshpack8.h mplayerxp/win32sdk/qtxsdk/ mplayerxp/win32sdk/vfw.h mplayerxp/win32sdk/winbase.h mplayerxp/win32sdk/windef.h mplayerxp/win32sdk/windows.h mplayerxp/win32sdk/winerror.h mplayerxp/win32sdk/winestring.h mplayerxp/win32sdk/winnt.h mplayerxp/win32sdk/winreg.h mplayerxp/win32sdk/winuser.h Removed Paths: ------------- mplayerxp/libmpcodecs/ad_acm.cpp mplayerxp/libmpcodecs/ad_dmo.cpp mplayerxp/libmpcodecs/ad_dshow.cpp mplayerxp/libmpcodecs/ad_qtaudio.cpp mplayerxp/libmpcodecs/ad_twin.cpp mplayerxp/libmpcodecs/vd_dmo.cpp mplayerxp/libmpcodecs/vd_dshow.cpp mplayerxp/libmpcodecs/vd_qtvideo.cpp mplayerxp/libmpcodecs/vd_vfw.cpp mplayerxp/libmpconf/codec-cfg.cpp mplayerxp/win32loader/ Modified: mplayerxp/Makefile =================================================================== --- mplayerxp/Makefile 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/Makefile 2013-06-10 07:27:20 UTC (rev 650) @@ -12,9 +12,7 @@ TARGET_EXE = $(PROGNAME) # these subdirectories required installation due binaries within them SUBDIRS = libmpdemux libmpstream2 libmpsub libplaytree2 libmpcodecs libmpconf libao3 osdep postproc input2 nls libvo2 xmpcore -ifeq ($(ENABLE_WIN32LOADER),yes) -SUBDIRS+=win32loader -endif + DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done DO_MAKE_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done @@ -45,9 +43,6 @@ nls/libnls.a \ libmpconf/libmpconf.a \ xmpcore/libxmpcore.a -ifeq ($(ENABLE_WIN32LOADER),yes) - MP_LIBS += win32loader/libwin32loader.a -endif LIBS+= $(MP_LIBS) $(LAVC_LIBS) $(EXTRALIBS) -lm CXXFLAGS = $(OPTXXFLAGS) $(EXTRA_INC) Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/configure 2013-06-10 07:27:20 UTC (rev 650) @@ -87,7 +87,6 @@ "profile|compile profiling information into PROGRAM", "static|build static libraries", "dbg23|allow additional level of debug messages", - "win32loader|build support for Win32 codecs", "random_name|generates pseudo random suffix of target", "sdl|build with SDL video and audio output|http://www.libsdl.org", "sdl_image|build with SDL_image for screenshots|http://www.libsdl.org/projects/SDL_image", @@ -106,7 +105,6 @@ "libdir|object code libraries|\$exec_prefix/lib", "datadir|read-only architecture-independent data|\$prefix/share/mplayerxp", "confdir|read-only configuration files|\$prefix/share/mplayerxp", - "win32libdir|win32 .dll locations [/usr/lib/win32]" ) PROGNAME_LIST=( @@ -580,26 +578,6 @@ test -f nls/mpxp_help-$linguas.h || die "nls/mpxp_help-$linguas.h not found" echo "#define I18N_LANGUAGE \"$linguas\"" >>mpxp_config.h -enabled gpl_only && disable win32loader - -if win32 || ! x86_32 ; then -disable win32loader -fi -win32 && add_ldflags -lkernel32 -print_config ENABLE_ mpxp_config.h mpxp_config.mak win32loader - -echo -n "win32 dll's ... " -if test -z "$win32libdir" ; then - for I in /usr/local/lib/win32 /usr/lib/win32 ; do - if test -d "$I" ; then - win32libdir="$I" - break; - fi; - done -fi -echo "$win32libdir" -echo "#define WIN32_PATH \"$win32libdir\"" >>mpxp_config.h - ######### # VIDEO # ######### Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/Makefile 2013-06-10 07:27:20 UTC (rev 650) @@ -42,18 +42,6 @@ CXXSRCS+= ad_libdv.cpp vd_libdv.cpp endif -ifeq ($(ENABLE_WIN32LOADER),yes) -CXXSRCS+=vd_dshow.cpp \ - vd_vfw.cpp \ - vd_dmo.cpp \ - vd_qtvideo.cpp \ - ad_dshow.cpp \ - ad_acm.cpp \ - ad_dmo.cpp \ - ad_qtaudio.cpp \ - ad_twin.cpp -endif - OBJS=$(SRCS:.c=.o) CXXOBJS=$(CXXSRCS:.cpp=.o) Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -52,13 +52,6 @@ #ifndef ENABLE_GPL_ONLY &mpcodecs_ad_real, #endif -#ifdef ENABLE_WIN32LOADER - &mpcodecs_ad_dshow, - &mpcodecs_ad_twin, - &mpcodecs_ad_msacm, - &mpcodecs_ad_dmo, - &mpcodecs_ad_qtaudio, -#endif &mpcodecs_ad_lavc, &mpcodecs_ad_null, Deleted: mplayerxp/libmpcodecs/ad_acm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_acm.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_acm.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,268 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#define __AD_ACM -#include "ad_internal.h" -#include "codecs_ld.h" -#include "win32loader/wineacm.h" -#include "libmpdemux/aviprint.h" -#include "libao3/afmt.h" -#include "mpxp_help.h" - -static const ad_info_t info = { - "Win32/ACM decoders", - "acm", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(msacm) - -struct acm_private_t : public Opaque { - acm_private_t(); - virtual ~acm_private_t(); - - float pts; - WAVEFORMATEX o_wf; // out format - HACMSTREAM srcstream; // handle - sh_audio_t* sh; -}; -acm_private_t::acm_private_t() {} -acm_private_t::~acm_private_t() {} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static int init_acm_audio_codec(acm_private_t& priv){ - sh_audio_t* sh_audio = priv.sh; - HRESULT ret; - WAVEFORMATEX *in_fmt=sh_audio->wf; - unsigned int srcsize=0; - - MSG_V("======= Win32 (ACM) AUDIO Codec init =======\n"); - - priv.srcstream=0; - - priv.o_wf.nChannels=sh_audio->nch; - priv.o_wf.nSamplesPerSec=sh_audio->rate; - priv.o_wf.nAvgBytesPerSec=2*priv.o_wf.nSamplesPerSec*priv.o_wf.nChannels; - priv.o_wf.wFormatTag=WAVE_FORMAT_PCM; - priv.o_wf.nBlockAlign=2*sh_audio->nch; - priv.o_wf.wBitsPerSample=sh_audio->afmt?afmt2bps(sh_audio->afmt)*8:16; - priv.o_wf.cbSize=0; - if(!in_fmt) { - in_fmt=sh_audio->wf=new(zeromem) WAVEFORMATEX; - memcpy(in_fmt,&priv.o_wf,sizeof(WAVEFORMATEX)); - in_fmt->wFormatTag=sh_audio->wtag; - } - - if(mp_conf.verbose) { - MSG_V("Output fmt:\n"); - print_wave_header(&priv.o_wf,sizeof(WAVEFORMATEX)); - } - MSACM_RegisterDriver((const char *)sh_audio->codec->dll_name, sh_audio->wtag, 0); - ret=acmStreamOpen(&priv.srcstream,(HACMDRIVER)NULL,in_fmt,&priv.o_wf,NULL,0,0,0); - if(ret){ - if(ret==ACMERR_NOTPOSSIBLE) - MSG_ERR("ACM_Decoder: Unappropriate audio format\n"); - else - MSG_ERR("ACM_Decoder: acmStreamOpen error: %d", (int)ret); - priv.srcstream=0; - return 0; - } - MSG_V("Audio codec opened OK! ;-)\n"); - - acmStreamSize(priv.srcstream, in_fmt->nBlockAlign, (LPDWORD)&srcsize, ACM_STREAMSIZEF_SOURCE); - srcsize*=2; - //if(srcsize<MAX_OUTBURST) srcsize=MAX_OUTBURST; - if(!srcsize){ - MSG_WARN("Warning! ACM codec reports srcsize=0\n"); - srcsize=16384; - } - // limit srcsize to 4-16kb - //while(srcsize && srcsize<4096) srcsize*=2; - //while(srcsize>16384) srcsize/=2; - sh_audio->audio_out_minsize=srcsize; // audio output min. size - MSG_V("Audio ACM output buffer min. size: %ld\n",srcsize); - - acmStreamSize(priv.srcstream, srcsize, (LPDWORD)&srcsize, ACM_STREAMSIZEF_DESTINATION); - if(srcsize<in_fmt->nBlockAlign) srcsize=2*in_fmt->nBlockAlign; - sh_audio->audio_in_minsize=srcsize; // audio input min. size - MSG_V("Audio ACM input buffer min. size: %ld\n",srcsize); - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; - sh_audio->nch=priv.o_wf.nChannels; - sh_audio->rate=priv.o_wf.nSamplesPerSec; - sh_audio->afmt=bps2afmt((priv.o_wf.wBitsPerSample+7)/8); - sh_audio->a_in_buffer_size=2*sh_audio->audio_in_minsize; - sh_audio->a_in_buffer=new char [sh_audio->a_in_buffer_size]; - sh_audio->a_in_buffer_len=0; - - return 1; -} - -static int close_acm_audio_codec(acm_private_t& priv) -{ - HRESULT ret; - - ret = acmStreamClose(priv.srcstream, 0); - - if (ret) - switch(ret) - { - case ACMERR_BUSY: - case ACMERR_CANCELED: - MSG_DBG2( "ACM_Decoder: stream busy, waiting..\n"); - sleep(100); - return close_acm_audio_codec(priv); - case ACMERR_UNPREPARED: - case ACMERR_NOTPOSSIBLE: - return 0; - default: - MSG_WARN( "ACM_Decoder: unknown error occured: %d\n", ret); - return 0; - } -/* MSACM_UnregisterAllDrivers();*/ - return 1; -} - -MPXP_Rc init(Opaque& ctx) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - float pts; - int ret=decode(priv,reinterpret_cast<unsigned char*>(sh_audio->a_buffer),4096,sh_audio->a_buffer_size,pts); - if(ret<0){ - MSG_INFO("ACM decoding error: %d\n",ret); - return MPXP_False; - } - sh_audio->a_buffer_len=ret; - return MPXP_Ok; -} - -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(probe); - UNUSED(afi); - /* Win32 ACM audio codec: */ - acm_private_t *priv; - if(!(priv=new(zeromem) acm_private_t)) return NULL; - priv->sh = sh_audio; - if(!init_acm_audio_codec(*priv)){ - MSG_ERR(MSGTR_ACMiniterror); - delete priv; - return NULL; - } - MSG_V("INFO: Win32/ACM init OK!\n"); - return priv; -} - -void uninit(Opaque& ctx) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - close_acm_audio_codec(priv); -} - -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { -// case ADCTRL_RESYNC_STREAM: -// sh_audio->a_in_buffer_len=0;/* reset ACM/DShow audio buffer */ -// return MPXP_True; - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - return MPXP_True; - } - default: - return MPXP_Unknown; - } - return MPXP_Unknown; -} - -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - acm_private_t& priv=static_cast<acm_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - ACMSTREAMHEADER ash; - HRESULT hr; - DWORD srcsize=0; - DWORD len=minlen; - - acmStreamSize(priv.srcstream,len , &srcsize, ACM_STREAMSIZEF_DESTINATION); - MSG_V("acm says: srcsize=%ld (bufflen=%d size=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,len); - - if(srcsize<sh_audio->wf->nBlockAlign){ - srcsize=sh_audio->wf->nBlockAlign; - acmStreamSize(priv.srcstream, srcsize, &len, ACM_STREAMSIZEF_SOURCE); - MSG_V("acm says: srcsize=%ld (bufflen=%d size=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,len); - if(len>maxlen) len=maxlen; - } - //if(srcsize==0) srcsize=priv.o_wf.nBlockAlign; - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if(sh_audio->a_in_buffer_len<srcsize){ - int l; - l = demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len]), - srcsize-sh_audio->a_in_buffer_len,pts); - pts=FIX_APTS(sh_audio,pts,-sh_audio->a_in_buffer_len); - sh_audio->a_in_buffer_len+=l; - priv.pts=pts; - } - else pts=priv.pts; - /* !!! NK: FINALY WE MUST KNOW size of output buffer after a_in_buffer_len modifying !!!! */ - acmStreamSize(priv.srcstream,sh_audio->a_in_buffer_len, &len, ACM_STREAMSIZEF_SOURCE); - MSG_DBG2("acm convert %d -> %d bytes\n",sh_audio->a_in_buffer_len,len); - - memset(&ash, 0, sizeof(ash)); - ash.cbStruct=sizeof(ash); - ash.fdwStatus=0; - ash.dwUser=0; - ash.pbSrc=reinterpret_cast<BYTE*>(sh_audio->a_in_buffer); - ash.cbSrcLength=sh_audio->a_in_buffer_len; - ash.pbDst=buf; - ash.cbDstLength=len; - hr=acmStreamPrepareHeader(priv.srcstream,&ash,0); - if(hr){ - MSG_V("ACM_Decoder: acmStreamPrepareHeader error %d\n",(int)hr); - return -1; - } - hr=acmStreamConvert(priv.srcstream,&ash,0); - if(hr){ - MSG_DBG2("ACM_Decoder: acmStreamConvert error %d\n",(int)hr); - switch(hr) - { - case ACMERR_NOTPOSSIBLE: - case ACMERR_UNPREPARED: - MSG_DBG2( "ACM_Decoder: acmStreamConvert error: probarly not initialized!\n"); - } - } - MSG_DBG2("acm converted %d -> %d\n",ash.cbSrcLengthUsed,ash.cbDstLengthUsed); - if(ash.cbSrcLengthUsed>=sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=ash.cbSrcLengthUsed; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[ash.cbSrcLengthUsed],sh_audio->a_in_buffer_len); - priv.pts=FIX_APTS(sh_audio,priv.pts,ash.cbSrcLengthUsed); - } - len=ash.cbDstLengthUsed; - hr=acmStreamUnprepareHeader(priv.srcstream,&ash,0); - if(hr){ - MSG_V("ACM_Decoder: acmStreamUnprepareHeader error %d\n",(int)hr); - } - return len; -} Deleted: mplayerxp/libmpcodecs/ad_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_dmo.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,133 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> - -#include "codecs_ld.h" - -#include "mplayerxp.h" -#include "mpxp_help.h" -#include "ad_internal.h" -#include "ad_msg.h" - -static const ad_info_t info = { - "Win32/DMO decoders", - "dmo", - "A'rpi", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(dmo) - -#include "win32loader/dmo/DMO_AudioDecoder.h" - -struct admo_private_t : public Opaque { - admo_private_t(); - virtual ~admo_private_t(); - - float pts; - DMO_AudioDecoder* ds_adec; - sh_audio_t* sh; -}; -admo_private_t::admo_private_t() {} -admo_private_t::~admo_private_t() { - DMO_AudioDecoder_Destroy(ds_adec); -} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static MPXP_Rc init(admo_private_t *p) -{ - UNUSED(p); - return MPXP_Ok; -} - -static Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(probe); - UNUSED(afi); - admo_private_t*priv; - int chans=(mp_conf.ao_channels==sh_audio->wf->nChannels) ? - mp_conf.ao_channels : (sh_audio->wf->nChannels>=2 ? 2 : 1); - if(!(priv=new(zeromem) admo_private_t)) return NULL; - priv->sh=sh_audio; - if(!(priv->ds_adec=DMO_AudioDecoder_Open(sh_audio->codec->dll_name,&sh_audio->codec->guid,sh_audio->wf,chans))) { - MSG_ERR(MSGTR_MissingDLLcodec,sh_audio->codec->dll_name); - delete priv; - return NULL; - } - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; - sh_audio->nch=chans; - sh_audio->rate=sh_audio->wf->nSamplesPerSec; - sh_audio->audio_in_minsize=4*sh_audio->wf->nBlockAlign; - if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; - sh_audio->audio_out_minsize=4*16384; - MSG_V("INFO: Win32/DMO audio codec init OK!\n"); - return priv; -} - -static void uninit(Opaque& ctx) { UNUSED(ctx); } - -static MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - admo_private_t& priv=static_cast<admo_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - return MPXP_True; - } - } - return MPXP_Unknown; -} - -static unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - admo_private_t& priv=static_cast<admo_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - unsigned len=0; - UNUSED(minlen); - { - unsigned size_in=0; - unsigned size_out=0; - unsigned srcsize=DMO_AudioDecoder_GetSrcSize(priv.ds_adec, maxlen); - MSG_DBG2("DMO says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if((unsigned)sh_audio->a_in_buffer_len<srcsize){ - unsigned l; - l=demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len]), - srcsize-sh_audio->a_in_buffer_len,pts); - sh_audio->a_in_buffer_len+=l; - priv.pts=pts; - } - else pts=priv.pts; - DMO_AudioDecoder_Convert(priv.ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len, - buf,maxlen, &size_in,&size_out); - MSG_DBG2("DMO: audio %d -> %d converted (in_buf_len=%d of %d) %f\n" - ,size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,pts); - if(size_in>=(unsigned)sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=size_in; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); - priv.pts=FIX_APTS(sh_audio,priv.pts,size_in); - } - len=size_out; - } - return len; -} Deleted: mplayerxp/libmpcodecs/ad_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_dshow.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,131 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" -#include "mpxp_help.h" -#include "win32loader/dshow/DS_AudioDecoder.h" -#include "codecs_ld.h" - -static const ad_info_t info = { - "Win32/DirectShow decoders", - "dshow", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(dshow) - -struct adshow_private_t : public Opaque { - adshow_private_t(); - virtual ~adshow_private_t(); - - float pts; - DS_AudioDecoder* ds_adec; - sh_audio_t* sh; -}; -adshow_private_t::adshow_private_t() {} -adshow_private_t::~adshow_private_t() { - DS_AudioDecoder_Destroy(ds_adec); -} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -MPXP_Rc init(Opaque& ctx) -{ - UNUSED(ctx); - return MPXP_Ok; -} - -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(probe); - UNUSED(afi); - adshow_private_t *priv; - if(!(priv=new(zeromem) adshow_private_t)) return NULL; - priv->sh = sh_audio; - if(!(priv->ds_adec=DS_AudioDecoder_Open(sh_audio->codec->dll_name,&sh_audio->codec->guid,sh_audio->wf))) { - MSG_ERR(MSGTR_MissingDLLcodec,sh_audio->codec->dll_name); - delete priv; - return NULL; - } - sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec; - sh_audio->nch=sh_audio->wf->nChannels; - sh_audio->rate=sh_audio->wf->nSamplesPerSec; - sh_audio->audio_in_minsize=2*sh_audio->wf->nBlockAlign; - if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; - sh_audio->audio_out_minsize=16384; - MSG_V("INFO: Win32/DShow init OK!\n"); - return priv; -} - -void uninit(Opaque& ctx) { UNUSED(ctx); } - - -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - adshow_private_t& priv=static_cast<adshow_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { - case ADCTRL_RESYNC_STREAM: - sh_audio->a_in_buffer_len=0; // reset ACM/DShow audio buffer - return MPXP_True; - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - } - return MPXP_True; - default: - return MPXP_Unknown; - } - return MPXP_Unknown; -} - -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - adshow_private_t& priv=static_cast<adshow_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - unsigned len=0; - UNUSED(minlen); - { unsigned size_in=0; - unsigned size_out=0; - unsigned srcsize=DS_AudioDecoder_GetSrcSize(priv.ds_adec, maxlen); - MSG_DBG3("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen); - if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!! - if((unsigned)sh_audio->a_in_buffer_len<srcsize){ - unsigned l; - l=demux_read_data_r(*sh_audio->ds,reinterpret_cast<unsigned char*>(&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len]), - srcsize-sh_audio->a_in_buffer_len,pts); - sh_audio->a_in_buffer_len+=l; - priv.pts=pts; - } - else pts=priv.pts; - DS_AudioDecoder_Convert(priv.ds_adec, reinterpret_cast<unsigned char*>(sh_audio->a_in_buffer),sh_audio->a_in_buffer_len, - buf,maxlen, &size_in,&size_out); - MSG_DBG2("DShow: audio %d -> %d converted (in_buf_len=%d of %d) %f\n" - ,size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,pts); - if(size_in>=(unsigned)sh_audio->a_in_buffer_len){ - sh_audio->a_in_buffer_len=0; - } else { - sh_audio->a_in_buffer_len-=size_in; - memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len); - priv.pts=FIX_APTS(sh_audio,priv.pts,size_in); - } - len=size_out; - } - return len; -} Deleted: mplayerxp/libmpcodecs/ad_qtaudio.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,331 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <inttypes.h> -#include <dlfcn.h> - -#include "ad_internal.h" -#include "osdep/bswap.h" -#include "codecs_ld.h" -#include "mplayerxp.h" -#include "libao3/afmt.h" -#ifdef WIN32_LOADER -#include "win32loader/ldt_keeper.h" -#endif - -#ifdef MACOSX -#include <QuickTime/QuickTimeComponents.h> -#endif - -static const ad_info_t info = { - "QuickTime Audio Decoder", - "qtaudio", - "A'rpi & Sascha Sommer", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(qtaudio) - - -typedef struct OpaqueSoundConverter* SoundConverter; -typedef unsigned long OSType; -typedef unsigned long UnsignedFixed; -typedef uint8_t Byte; -typedef struct SoundComponentData { - long flags; - OSType format; - short numChannels; - short sampleSize; - UnsignedFixed sampleRate; - long sampleCount; - Byte* buffer; - long reserved; -}SoundComponentData; - -typedef int (__cdecl* LPFUNC1)(long flag); -typedef int (__cdecl* LPFUNC2)(const SoundComponentData *, const SoundComponentData *,SoundConverter *); -typedef int (__cdecl* LPFUNC3)(SoundConverter sc); -typedef int (__cdecl* LPFUNC4)(void); -typedef int (__cdecl* LPFUNC5)(SoundConverter sc, OSType selector,any_t* infoPtr); -typedef int (__cdecl* LPFUNC6)(SoundConverter sc, - unsigned long inputBytesTarget, - unsigned long *inputFrames, - unsigned long *inputBytes, - unsigned long *outputBytes ); -typedef int (__cdecl* LPFUNC7)(SoundConverter sc, - const any_t*inputPtr, - unsigned long inputFrames, - any_t*outputPtr, - unsigned long *outputFrames, - unsigned long *outputBytes ); -typedef int (__cdecl* LPFUNC8)(SoundConverter sc, - any_t*outputPtr, - unsigned long *outputFrames, - unsigned long *outputBytes); -typedef int (__cdecl* LPFUNC9)(SoundConverter sc); - -static HINSTANCE qtml_dll; -static LPFUNC1 InitializeQTML; -static LPFUNC2 SoundConverterOpen; -static LPFUNC3 SoundConverterClose; -static LPFUNC4 TerminateQTML; -static LPFUNC5 SoundConverterSetInfo; -static LPFUNC6 SoundConverterGetBufferSizes; -static LPFUNC7 SoundConverterConvertBuffer; -static LPFUNC8 SoundConverterEndConversion; -static LPFUNC9 SoundConverterBeginConversion; - -#define siDecompressionParams 2002876005 // siDecompressionParams = FOUR_CHAR_CODE('wave') - -HMODULE WINAPI LoadLibraryA(LPCSTR); -FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); -int WINAPI FreeLibrary(HMODULE); - -static int loader_init() -{ -#ifdef WIN32_LOADER - Setup_LDT_Keeper(); -#endif - qtml_dll = LoadLibraryA((LPCSTR)"qtmlClient.dll"); - if( !qtml_dll ) { - MSG_ERR("failed loading dll\n" ); - return 1; - } -#if 1 - InitializeQTML = (LPFUNC1)GetProcAddress(qtml_dll,(LPCSTR)"InitializeQTML"); - if ( InitializeQTML == NULL ) { - MSG_ERR("failed geting proc address InitializeQTML\n"); - return 1; - } - SoundConverterOpen = (LPFUNC2)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterOpen"); - if ( SoundConverterOpen == NULL ) { - MSG_ERR("failed getting proc address SoundConverterOpen\n"); - return 1; - } - SoundConverterClose = (LPFUNC3)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterClose"); - if ( SoundConverterClose == NULL ) { - MSG_ERR("failed getting proc address SoundConverterClose\n"); - return 1; - } - TerminateQTML = (LPFUNC4)GetProcAddress(qtml_dll,(LPCSTR)"TerminateQTML"); - if ( TerminateQTML == NULL ) { - MSG_ERR("failed getting proc address TerminateQTML\n"); - return 1; - } - SoundConverterSetInfo = (LPFUNC5)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterSetInfo"); - if ( SoundConverterSetInfo == NULL ) { - MSG_ERR("failed getting proc address SoundConverterSetInfo\n"); - return 1; - } - SoundConverterGetBufferSizes = (LPFUNC6)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterGetBufferSizes"); - if ( SoundConverterGetBufferSizes == NULL ) { - MSG_ERR("failed getting proc address SoundConverterGetBufferSizes\n"); - return 1; - } - SoundConverterConvertBuffer = (LPFUNC7)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterConvertBuffer"); - if ( SoundConverterConvertBuffer == NULL ) { - MSG_ERR("failed getting proc address SoundConverterConvertBuffer1\n"); - return 1; - } - SoundConverterEndConversion = (LPFUNC8)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterEndConversion"); - if ( SoundConverterEndConversion == NULL ) { - MSG_ERR("failed getting proc address SoundConverterEndConversion\n"); - return 1; - } - SoundConverterBeginConversion = (LPFUNC9)GetProcAddress(qtml_dll,(LPCSTR)"SoundConverterBeginConversion"); - if ( SoundConverterBeginConversion == NULL ) { - MSG_ERR("failed getting proc address SoundConverterBeginConversion\n"); - return 1; - } - MSG_V("Standard init done you may now call supported functions\n"); -#endif - MSG_V("loader_init DONE???\n"); - return 0; -} - -static SoundConverter myConverter = NULL; -static SoundComponentData InputFormatInfo,OutputFormatInfo; - -static int InFrameSize; -static int OutFrameSize; - -struct qta_private_t : public Opaque { - qta_private_t(); - virtual ~qta_private_t(); - - sh_audio_t* sh; -}; - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh,audio_filter_info_t& afi){ - UNUSED(probe); - UNUSED(afi); - int error; - unsigned long FramesToGet=0; //how many frames the demuxer has to get - unsigned long InputBufferSize=0; //size of the input buffer - unsigned long OutputBufferSize=0; //size of the output buffer - unsigned long WantedBufferSize=0; //the size you want your buffers to be - - if(mp_conf.s_cache_size) { - MSG_FATAL("Disabling sound:\nwin32 quicktime DLLs must be initialized in single-threaded mode! Try -nocache\n"); - return NULL; - } - MSG_INFO("win32 libquicktime loader (c) Sascha Sommer\n"); - -#ifdef MACOSX - EnterMovies(); -#else - if(loader_init()) return NULL; // failed to load DLL - - MSG_V("loader_init DONE!\n"); - - error = InitializeQTML(6+16); - MSG_ERR("InitializeQTML:%i\n",error); - if(error) return NULL; -#endif - -#if 1 - OutputFormatInfo.flags = InputFormatInfo.flags = 0; - OutputFormatInfo.sampleCount = InputFormatInfo.sampleCount = 0; - OutputFormatInfo.buffer = InputFormatInfo.buffer = NULL; - OutputFormatInfo.reserved = InputFormatInfo.reserved = 0; - OutputFormatInfo.numChannels = InputFormatInfo.numChannels = sh->wf->nChannels; - InputFormatInfo.sampleSize = sh->wf->wBitsPerSample; - OutputFormatInfo.sampleSize = 16; - OutputFormatInfo.sampleRate = InputFormatInfo.sampleRate = sh->wf->nSamplesPerSec; - InputFormatInfo.format = bswap_32(sh->wtag); //1363430706;///*1768775988;//*/1902406962;//qdm2//1768775988;//FOUR_CHAR_CODE('ima4'); - OutputFormatInfo.format = 1313820229;// FOUR_CHAR_CODE('NONE'); - - error = SoundConverterOpen(&InputFormatInfo, &OutputFormatInfo, &myConverter); - MSG_V("SoundConverterOpen:%i\n",error); - if(error) return NULL; - - if(sh->codecdata){ - error = SoundConverterSetInfo(myConverter,siDecompressionParams,sh->codecdata); - MSG_V("SoundConverterSetInfo:%i\n",error); -// if(error) return 0; - } - - WantedBufferSize=OutputFormatInfo.numChannels*OutputFormatInfo.sampleRate*2; - error = SoundConverterGetBufferSizes(myConverter, - WantedBufferSize,&FramesToGet,&InputBufferSize,&OutputBufferSize); - MSG_V("SoundConverterGetBufferSizes:%i\n",error); - MSG_V("WantedBufferSize = %li\n",WantedBufferSize); - MSG_V("InputBufferSize = %li\n",InputBufferSize); - MSG_V("OutputBufferSize = %li\n",OutputBufferSize); - MSG_V("FramesToGet = %li\n",FramesToGet); - - InFrameSize=(InputBufferSize+FramesToGet-1)/FramesToGet; - OutFrameSize=OutputBufferSize/FramesToGet; - - MSG_V("FrameSize: %i -> %i\n",InFrameSize,OutFrameSize); - - error = SoundConverterBeginConversion(myConverter); - MSG_V("SoundConverterBeginConversion:%i\n",error); - if(error) return NULL; - - sh->audio_out_minsize=OutputBufferSize; - sh->audio_in_minsize=InputBufferSize; - - sh->nch=sh->wf->nChannels; - sh->rate=sh->wf->nSamplesPerSec; - sh->afmt=bps2afmt(2); //(sh->wf->wBitsPerSample+7)/8; - - sh->i_bps=sh->wf->nAvgBytesPerSec; -//InputBufferSize*WantedBufferSize/OutputBufferSize; - -#endif - qta_private_t* priv = new(zeromem) qta_private_t; - priv->sh = sh; - return priv; // return values: 1=OK 0=ERROR -} - -static MPXP_Rc init(Opaque& ctx) -{ - UNUSED(ctx); - return MPXP_Ok; // return values: 1=OK 0=ERROR -} - -static void uninit(Opaque& ctx){ - qta_private_t& priv=static_cast<qta_private_t&>(ctx); - sh_audio_t* sh = priv.sh; - int error; - unsigned long ConvertedFrames=0; - unsigned long ConvertedBytes=0; - UNUSED(sh); - error=SoundConverterEndConversion(myConverter,NULL,&ConvertedFrames,&ConvertedBytes); - MSG_V("SoundConverterEndConversion:%i\n",error); - error = SoundConverterClose(myConverter); - MSG_V("SoundConverterClose:%i\n",error); -// error = TerminateQTML(); -// MSG_V("TerminateQTML:%i\n",error); -// FreeLibrary( qtml_dll ); -// qtml_dll = NULL; -// printf("qt dll loader uninit done\n"); -#ifdef MACOSX - ExitMovies(); -#endif -} - -static unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts){ - qta_private_t& priv=static_cast<qta_private_t&>(ctx); - sh_audio_t* sh = priv.sh; - int error; - unsigned long FramesToGet=0; //how many frames the demuxer has to get - unsigned long InputBufferSize=0; //size of the input buffer - unsigned long ConvertedFrames=0; - unsigned long ConvertedBytes=0; - - FramesToGet=minlen/OutFrameSize; - if(FramesToGet*OutFrameSize<minlen && - (FramesToGet+1)*OutFrameSize<=maxlen) ++FramesToGet; - if(FramesToGet*InFrameSize>sh->a_in_buffer_size) - FramesToGet=sh->a_in_buffer_size/InFrameSize; - - InputBufferSize=FramesToGet*InFrameSize; - -// printf("FramesToGet = %li (%li -> %li bytes)\n",FramesToGet, -// InputBufferSize, FramesToGet*OutFrameSize); - - if(InputBufferSize>(unsigned)sh->a_in_buffer_len){ - int x=demux_read_data_r(*sh->ds,reinterpret_cast<unsigned char*>(&sh->a_in_buffer[sh->a_in_buffer_len]), - InputBufferSize-sh->a_in_buffer_len,pts); - if(x>0) sh->a_in_buffer_len+=x; - if(InputBufferSize>(unsigned)sh->a_in_buffer_len) - FramesToGet=sh->a_in_buffer_len/InFrameSize; // not enough data! - } - -// printf("\nSoundConverterConvertBuffer(myConv=%p,inbuf=%p,frames=%d,outbuf=%p,&convframes=%p,&convbytes=%p)\n", -// myConverter,sh->a_in_buffer,FramesToGet,buf,&ConvertedFrames,&ConvertedBytes); - error = SoundConverterConvertBuffer(myConverter,sh->a_in_buffer, - FramesToGet,buf,&ConvertedFrames,&ConvertedBytes); -// printf("SoundConverterConvertBuffer:%i\n",error); -// printf("ConvertedFrames = %li\n",ConvertedFrames); -// printf("ConvertedBytes = %li\n",ConvertedBytes); - -// InputBufferSize=(ConvertedBytes/OutFrameSize)*InFrameSize; // FIXME!! - InputBufferSize=FramesToGet*InFrameSize; - sh->a_in_buffer_len-=InputBufferSize; - if(sh->a_in_buffer_len<0) sh->a_in_buffer_len=0; // should not happen... - else if(sh->a_in_buffer_len>0){ - memcpy(sh->a_in_buffer,&sh->a_in_buffer[InputBufferSize],sh->a_in_buffer_len); - } - - return ConvertedBytes; -} - -static MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...){ - // various optional functions you MAY implement: - UNUSED(ctx); - UNUSED(cmd); - UNUSED(arg); - return MPXP_Unknown; -} Deleted: mplayerxp/libmpcodecs/ad_twin.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_twin.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/ad_twin.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,644 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdexcept> - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ -#include "ad_internal.h" -#include "codecs_ld.h" -#include "win32loader/ldt_keeper.h" -#include "win32loader/wine/windef.h" -#include "libao3/afmt.h" -#include "libmpdemux/aviprint.h" -#include "mpxp_help.h" - -static const ad_info_t info = { - "TWinVQ decoder", - "vqf", - "Nickols_K", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBAD_EXTERN(twin) - - -/************************/ -/*** General settings ***/ -/************************/ -/* Initialization error code */ -enum INIT_ERROR_CODE { - TVQ_NO_ERROR = 0, // no error - TVQ_ERROR, // general - TVQ_ERROR_VERSION, // wrong version - TVQ_ERROR_CHANNEL, // channel setting error - TVQ_ERROR_MODE, // wrong coding mode - TVQ_ERROR_PARAM, // inner parameter setting error - TVQ_ERROR_N_CAN, // wrong number of VQ pre-selection candidates, used only in encoder -}; - -/* version ID */ -#define TVQ_UNKNOWN_VERSION -1 -#define V2 0 -#define V2PP 1 - -#define N_VERSIONS 2 - -/* window types */ -enum WINDOW_TYPE { - ONLY_LONG_WINDOW = 0, - LONG_SHORT_WINDOW, - ONLY_SHORT_WINDOW, - SHORT_LONG_WINDOW, - SHORT_MEDIUM_WINDOW, - MEDIUM_LONG_WINDOW, - LONG_MEDIUM_WINDOW, - MEDIUM_SHORT_WINDOW, - ONLY_MEDIUM_WINDOW, -}; - -/* block types */ -enum BLOCK_TYPE { - BLK_SHORT = 0, - BLK_MEDIUM, - BLK_LONG, - BLK_PPC, -}; -#define N_BTYPE 3 // number of block types -#define N_INTR_TYPE 4 // number of interleave types, enum BLOCK_TYPE is commonly used for detecting interleave types. - -/* maximum number of channels */ -#define N_CH_MAX 2 - -/* type definition of code information interface */ -typedef struct { - /* block type */ - int w_type; - int btype; - /* FBC info */ - int *segment_sw[ N_CH_MAX ]; - int *band_sw[ N_CH_MAX ]; - int *fg_intensity[ N_CH_MAX ]; - /* VQ info */ - int *wvq; - /* BSE info */ - int *fw; - int *fw_alf; - /* gain info */ - int *pow; - /* LSP info */ - int *lsp[ N_CH_MAX ]; - /* PPC info */ - int pit[ N_CH_MAX ]; - int *pls; - int pgain[ N_CH_MAX ]; - /* EBC info */ - int *bc[ N_CH_MAX ]; - any_t*manager; -} INDEX; - -/***********************************************/ -/*** Definitions about program configuration ***/ -/***********************************************/ -/* type definition of tvqConfInfoSubBlock */ -typedef struct { - int sf_sz; // subframe size - int nsf; // number of subframes - int ndiv; // number of division of weighted interleave vector quantization - int ncrb; // number of Bark-scale subbands - int fw_ndiv; // number of division of BSE VQ - int fw_nbit; // number of bits for BSE VQ - int nsubg; // number of sub-blocks for gain coding - int ppc_enable; // PPC switch - int ebc_enable; // EBC switch - int ebc_crb_base; // EBC base band - int ebc_bits; // EBC bits - int fbc_enable; // FBC switch - int fbc_n_segment; // FBC number of segments - int fbc_nband; // FBC number of subbands - int *fbc_crb_tbl; // FBC subband table -} tvqConfInfoSubBlock; - -/* type definition of tvqConfInfo */ -typedef struct { - /* frame configuration */ - int N_CH; - /* window type coding */ - int BITS_WTYPE; - /* LSP coding */ - int LSP_BIT0; - int LSP_BIT1; - int LSP_BIT2; - int LSP_SPLIT; - /* Bark-scale envelope coding */ - int FW_ARSW_BITS; - /* gain coding */ - int GAIN_BITS; - int SUB_GAIN_BITS; - /* pitch excitation */ - int N_DIV_P; - int BASF_BIT; - int PGAIN_BIT; - /* block type dependent parameters */ - tvqConfInfoSubBlock cfg[N_BTYPE]; -} tvqConfInfo; - -#define KEYWORD_BYTES 4 -#define VERSION_BYTES 8 -#define ELEM_BYTES sizeof(unsigned long) -/* - */ -typedef struct{ - char ID[KEYWORD_BYTES+VERSION_BYTES+1]; - int size; - /* Common Chunk */ - int channelMode; /* channel mode (mono:0/stereo:1) */ - int bitRate; /* bit rate (kbit/s) */ - int samplingRate; /* sampling rate (44.1 kHz -> 44) */ - int securityLevel; /* security level (always 0) */ - /* Text Chunk */ - char Name[BUFSIZ]; - char Comt[BUFSIZ]; - char Auth[BUFSIZ]; - char Cpyr[BUFSIZ]; - char File[BUFSIZ]; - char Extr[BUFSIZ]; // add by OKAMOTO 99.12.21 - /* Data size chunk*/ - int Dsiz; -} headerInfo; - -extern HMODULE WINAPI LoadLibraryA(LPCSTR); -extern FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); -extern int WINAPI FreeLibrary(HMODULE); - -static int (__cdecl* TvqInitialize_ptr)( headerInfo *setupInfo, INDEX *index, int dispErrorMessageBox ); -#define TvqInitialize(a,b,c) (*TvqInitialize_ptr)(a,b,c) -static void (__cdecl* TvqTerminate_ptr)( INDEX *index ); -#define TvqTerminate(a) (*TvqTerminate_ptr)(a) -static void (__cdecl* TvqGetVectorInfo_ptr)(int *bits0[], int *bits1[]); -#define TvqGetVectorInfo(a,b) (*TvqGetVectorInfo_ptr)(a,b) - -static void (__cdecl* TvqDecodeFrame_ptr)(INDEX *indexp, float out[]); -#define TvqDecodeFrame(a,b) (*TvqDecodeFrame_ptr)(a,b) -static int (__cdecl* TvqWtypeToBtype_ptr)( int w_type, int *btype ); -#define TvqWtypeToBtype(a,b) (*TvqWtypeToBtype_ptr)(a,b) -static void (__cdecl* TvqUpdateVectorInfo_ptr)(int varbits, int *ndiv, int bits0[], int bits1[]); -#define TvqUpdateVectorInfo(a,b,c,d) (*TvqUpdateVectorInfo_ptr)(a,b,c,d) - -static int (__cdecl* TvqCheckVersion_ptr)(char *versionID); -#define TvqCheckVersion(a) (*TvqCheckVersion_ptr)(a) -static void (__cdecl* TvqGetConfInfo_ptr)(tvqConfInfo *cf); -#define TvqGetConfInfo(a) (*TvqGetConfInfo_ptr)(a) -static int (__cdecl* TvqGetFrameSize_ptr)(); -#define TvqGetFrameSize() (*TvqGetFrameSize_ptr)() -static int (__cdecl* TvqGetNumFixedBitsPerFrame_ptr)(); -#define TvqGetNumFixedBitsPerFrame() (*TvqGetNumFixedBitsPerFrame_ptr)() - -#define BYTE_BIT 8 -#define BBUFSIZ 1024 /* Bit buffer size (bytes) */ -#define BBUFLEN (BBUFSIZ*BYTE_BIT) /* Bit buffer length (bits) */ -struct twin_private_t : public Opaque { - twin_private_t(); - virtual ~twin_private_t(); - - float pts; - WAVEFORMATEX o_wf; // out format - INDEX index; - tvqConfInfo cf; - headerInfo hi; - int *bits_0[N_INTR_TYPE], *bits_1[N_INTR_TYPE]; - unsigned framesize; - /* stream related */ - int readable; - int ptr; /* current point in the bit buffer */ - int nbuf; /* bit buffer size */ - char buf[BBUFSIZ]; /* the bit buffer */ - sh_audio_t* sh; -}; -twin_private_t::twin_private_t() {} -twin_private_t::~twin_private_t() {} - -static const audio_probe_t* __FASTCALL__ probe(uint32_t wtag) { return NULL; } - -static HINSTANCE vqf_dll; - -static int load_dll( const char *libname ) -{ -#ifdef WIN32_LOADER - Setup_LDT_Keeper_ptr(); -#endif - vqf_dll = LoadLibraryA((LPCSTR)libname); - if( vqf_dll == NULL ) { - MSG_ERR("failed loading dll\n" ); - return 0; - } - TvqInitialize_ptr = (int (*)(headerInfo*,INDEX*,int))GetProcAddress(vqf_dll,(LPCSTR)"TvqInitialize"); - TvqTerminate_ptr = (void (*)(INDEX*))GetProcAddress(vqf_dll,(LPCSTR)"TvqTerminate"); - TvqGetVectorInfo_ptr = (void (*)(int**,int**))GetProcAddress(vqf_dll,(LPCSTR)"TvqGetVectorInfo"); - TvqDecodeFrame_ptr = (void (*)(INDEX*,float*))GetProcAddress(vqf_dll,(LPCSTR)"TvqDecodeFrame"); - TvqWtypeToBtype_ptr = (int (*)(int,int*))GetProcAddress(vqf_dll,(LPCSTR)"TvqWtypeToBtype"); - TvqUpdateVectorInfo_ptr = (void (*)(int,int*,int*,int*))GetProcAddress(vqf_dll,(LPCSTR)"TvqUpdateVectorInfo"); - TvqCheckVersion_ptr = (int (*)(char*))GetProcAddress(vqf_dll,(LPCSTR)"TvqCheckVersion"); - TvqGetConfInfo_ptr = (void (*)(tvqConfInfo*))GetProcAddress(vqf_dll,(LPCSTR)"TvqGetConfInfo"); - TvqGetFrameSize_ptr = (int (*)())GetProcAddress(vqf_dll,(LPCSTR)"TvqGetFrameSize"); - TvqGetNumFixedBitsPerFrame_ptr = (int (*)())GetProcAddress(vqf_dll,(LPCSTR)"TvqGetNumFixedBitsPerFrame"); - return TvqInitialize_ptr && TvqTerminate_ptr && TvqGetVectorInfo_ptr && - TvqDecodeFrame_ptr && TvqWtypeToBtype_ptr && TvqUpdateVectorInfo_ptr && - TvqCheckVersion_ptr && TvqGetConfInfo_ptr && TvqGetFrameSize_ptr && - TvqGetNumFixedBitsPerFrame_ptr; -} - -static int init_vqf_audio_codec(twin_private_t& priv){ - sh_audio_t* sh_audio = priv.sh; - WAVEFORMATEX *in_fmt=sh_audio->wf; - int ver; - MSG_V("======= Win32 (TWinVQ) AUDIO Codec init =======\n"); - - priv.o_wf.nChannels=in_fmt->nChannels; - priv.o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec; - priv.o_wf.nAvgBytesPerSec=in_fmt->nSamplesPerSec; - priv.o_wf.wFormatTag=0x01; - priv.o_wf.nBlockAlign=4*in_fmt->nChannels; - priv.o_wf.wBitsPerSample=in_fmt->wBitsPerSample; - priv.o_wf.cbSize=0; - sh_audio->nch=in_fmt->nChannels; - sh_audio->rate=in_fmt->nSamplesPerSec; - sh_audio->afmt=AFMT_FLOAT32; - - if(mp_conf.verbose) { - MSG_V("Input format:\n"); - print_wave_header(in_fmt,sizeof(WAVEFORMATEX)); - MSG_V("Output fmt:\n"); - print_wave_header(&priv.o_wf,sizeof(WAVEFORMATEX)); - } - memcpy(&priv.hi,&in_fmt[1],sizeof(headerInfo)); - if((ver=TvqInitialize(&priv.hi,&priv.index,0))){ - const char *tvqe[]={ - "No errors", - "General error", - "Wrong version", - "Channel setting error", - "Wrong coding mode", - "Inner parameter setting error", - "Wrong number of VQ pre-selection candidates, used only in encoder" }; - MSG_ERR("Tvq initialization error: %s\n",ver>=0&&ver<7?tvqe[ver]:"Unknown"); - return 0; - } - ver=TvqCheckVersion(priv.hi.ID); - if(ver==TVQ_UNKNOWN_VERSION){ - MSG_ERR("Tvq unknown version of stream\n" ); - return 0; - } - TvqGetConfInfo(&priv.cf); - TvqGetVectorInfo(priv.bits_0,priv.bits_1); - priv.framesize=TvqGetFrameSize(); - sh_audio->audio_in_minsize=priv.framesize*in_fmt->nChannels; - sh_audio->a_in_buffer_size=4*sh_audio->audio_in_minsize; - sh_audio->a_in_buffer=new char [sh_audio->a_in_buffer_size]; - sh_audio->a_in_buffer_len=0; - - return 1; -} - -static int close_vqf_audio_codec(twin_private_t& priv) -{ - TvqTerminate(&priv.index); - return 1; -} - -MPXP_Rc init(Opaque& ctx) -{ - UNUSED(ctx); - return MPXP_Ok; -} - -Opaque* preinit(const audio_probe_t& probe,sh_audio_t *sh_audio,audio_filter_info_t& afi) -{ - UNUSED(afi); - /* Win32 VQF audio codec: */ - twin_private_t *priv; - if(!(priv=new(zeromem) twin_private_t)) return NULL; - priv->sh = sh_audio; - if(!load_dll(probe.codec_dll)) { - MSG_ERR("win32.dll looks broken :(\n"); - delete priv; - return NULL; - } - if(!init_vqf_audio_codec(*priv)){ - MSG_ERR("TWinVQ initialization fail\n"); - delete priv; - return NULL; - } - MSG_V("INFO: TWinVQ audio codec init OK!\n"); - return priv; -} - -void uninit(Opaque& ctx) -{ - twin_private_t& priv=static_cast<twin_private_t&>(ctx); - close_vqf_audio_codec(priv); - FreeLibrary(vqf_dll); -} - -MPXP_Rc control_ad(Opaque& ctx,int cmd,any_t* arg, ...) -{ - twin_private_t& priv=static_cast<twin_private_t&>(ctx); - sh_audio_t* sh_audio = priv.sh; - int skip; - UNUSED(arg); - switch(cmd) { - case ADCTRL_SKIP_FRAME: { - float pts; - skip=sh_audio->wf->nBlockAlign; - if(skip<16){ - skip=(sh_audio->wf->nAvgBytesPerSec/16)&(~7); - if(skip<16) skip=16; - } - demux_read_data_r(*sh_audio->ds,NULL,skip,pts); - return MPXP_True; - } - default: - return MPXP_Unknown; - } - return MPXP_Unknown; -} - -static int bread(char *data, /* Output: Output data array */ - int size, /* Input: Length of each data */ - int nbits, /* Input: Number of bits to write */ - twin_private_t &priv, /* Input: File pointer */ - float &pts) -{ - /*--- Variables ---*/ - int ibits, iptr, idata, ibufadr, ibufbit, icl; - unsigned char mask, tmpdat; - int retval; - sh_audio_t* sh = priv.sh; - - /*--- Main operation ---*/ - retval = 0; - mask = 0x1; - for ( ibits=0; ibits<nbits; ibits++ ){ - if ( priv.readable == 0 ){ /* when the file data buffer is empty */ - priv.nbuf = demux_read_data_r(*sh->ds, reinterpret_cast<unsigned char*>(priv.buf), BBUFSIZ, priv.pts); - priv.nbuf *= 8; - priv.readable = 1; - } - pts=FIX_APTS(sh,priv.pts,priv.ptr); - iptr = priv.ptr; /* current file data buffer pointer */ - if ( iptr >= priv.nbuf ) /* If data file is empty then return */ - return retval; - ibufadr = iptr/BYTE_BIT; /* current file data buffer address */ - ibufbit = iptr%BYTE_BIT; /* current file data buffer bit */ - /* tmpdat = stream->buf[ibufadr] >> (BYTE_BIT-ibufbit-1); */ - tmpdat = (unsigned char)priv.buf[ibufadr]; - tmpdat >>= (BYTE_BIT-ibufbit-1); - /* current data bit */ - - idata = ibits*size; /* output data address */ - data[idata] = (char)(tmpdat & mask); /* set output data */ - for (icl=1; icl<size; icl++) - data[idata+icl] = 0; /* clear the rest output data buffer */ - priv.ptr += 1; /* update data buffer pointer */ - if (priv.ptr == BBUFLEN){ - priv.ptr = 0; - priv.readable = 0; - } - ++retval; - } - return retval; -} - -static const int BITS_INT=(sizeof(int)*8); - -static int get_bstm(int *data, /* Input: input data */ - unsigned nbits, /* Input: number of bits */ - twin_private_t& priv, /* Input: bit file pointer */ - float& pts) -{ - unsigned ibit; - unsigned mask; - unsigned work; - char tmpbit[BITS_INT]; - int retval; - - if ( nbits > BITS_INT ) throw std::runtime_error("get_bstm(): falied"); - - retval = bread(tmpbit, sizeof(*tmpbit), nbits, priv, pts ); - for (ibit=retval; ibit<nbits; ibit++){ - tmpbit[ibit] = 0; - } - mask = 0x1<<(nbits-1); - work=0; - for ( ibit=0; ibit<nbits; ibit++ ){ - work += mask*tmpbit[ibit]; - mask >>= 1; - } - *data = work; - return retval; -} - -static int GetVqInfo( tvqConfInfoSubBlock *cfg, - int bits0[], - int bits1[], - int variableBits, - INDEX *_index, - twin_private_t& priv) -{ - int idiv; - int bitcount = 0; - float pts; - if ( _index->btype == BLK_LONG ){ - TvqUpdateVectorInfo( variableBits, &cfg->ndiv, bits0, bits1 ); // re-calculate VQ bits - } - for ( idiv=0; idiv<cfg->ndiv; idiv++ ){ - bitcount += get_bstm(&_index->wvq[idiv],bits0[idiv],priv,pts); /* CB 0 */ - bitcount += get_bstm(&_index->wvq[idiv+cfg->ndiv],bits1[idiv],priv,pts); /* CB 1 */ - } - return bitcount; -} - -static int GetBseInfo( tvqConfInfo *cf, tvqConfInfoSubBlock *cfg, INDEX *_index, twin_private_t& priv) -{ - int i_sup, isf, itmp, idiv; - int bitcount = 0; - float pts; - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - for ( isf=0; isf<cfg->nsf; isf++ ){ - for ( idiv=0; idiv<cfg->fw_ndiv; idiv++ ){ - itmp = idiv + ( isf + i_sup * cfg->nsf ) * cfg->fw_ndiv; - bitcount += get_bstm(&_index->fw[itmp],cfg->fw_nbit,priv,pts); - } - } - } - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - for ( isf=0; isf<cfg->nsf; isf++ ){ - bitcount += get_bstm(&_index->fw_alf[i_sup * cfg->nsf + isf],cf->FW_ARSW_BITS,priv,pts); - } - } - return bitcount; -} - -static int GetGainInfo(tvqConfInfo *cf, tvqConfInfoSubBlock *cfg, INDEX *_index, twin_private_t& priv ) -{ - int i_sup, iptop, isf; - int bitcount = 0; - float pts; - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - iptop = ( cfg->nsubg + 1 ) * i_sup; - bitcount += get_bstm(&_index->pow[iptop], cf->GAIN_BITS,priv,pts); - for ( isf=0; isf<cfg->nsubg; isf++ ){ - bitcount += get_bstm(&_index->pow[iptop+isf+1], cf->SUB_GAIN_BITS,priv,pts); - } - } - return bitcount; -} - -static int GetLspInfo( tvqConfInfo *cf, INDEX *_index, twin_private_t& priv ) -{ - int i_sup, itmp; - int bitcount = 0; - float pts; - - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - bitcount += get_bstm(&_index->lsp[i_sup][0], cf->LSP_BIT0,priv,pts); /* pred. switch */ - bitcount += get_bstm(&_index->lsp[i_sup][1], cf->LSP_BIT1,priv,pts); /* first stage */ - for ( itmp=0; itmp<cf->LSP_SPLIT; itmp++ ){ /* second stage */ - bitcount += get_bstm(&_index->lsp[i_sup][itmp+2], cf->LSP_BIT2,priv,pts); - } - } - - return bitcount; -} - -static int GetPpcInfo( tvqConfInfo *cf, INDEX *_index, twin_private_t& priv) -{ - int idiv, i_sup; - int bitcount = 0; - float pts; - - for ( idiv=0; idiv<cf->N_DIV_P; idiv++ ){ - bitcount += get_bstm(&(_index->pls[idiv]), priv.bits_0[BLK_PPC][idiv],priv,pts); /*CB0*/ - bitcount += get_bstm(&(_index->pls[idiv+cf->N_DIV_P]), priv.bits_1[BLK_PPC][idiv],priv,pts);/*CB1*/ - } - for (i_sup=0; i_sup<cf->N_CH; i_sup++){ - bitcount += get_bstm(&(_index->pit[i_sup]), cf->BASF_BIT,priv,pts); - bitcount += get_bstm(&(_index->pgain[i_sup]), cf->PGAIN_BIT,priv,pts); - } - - return bitcount; -} - -static int GetEbcInfo( tvqConfInfo *cf, tvqConfInfoSubBlock *cfg, INDEX *_index, twin_private_t& priv) -{ - int i_sup, isf, itmp; - int bitcount = 0; - float pts; - - for ( i_sup=0; i_sup<cf->N_CH; i_sup++ ){ - for ( isf=0; isf<cfg->nsf; isf++){ - int indexSfOffset = isf * ( cfg->ncrb - cfg->ebc_crb_base ) - cfg->ebc_crb_base; - for ( itmp=cfg->ebc_crb_base; itmp<cfg->ncrb; itmp++ ){ - bitcount += get_bstm(&_index->bc[i_sup][itmp+indexSfOffset], cfg->ebc_bits,priv,pts); - } - } - } - - return bitcount; -} - -static int vqf_read_frame(twin_private_t& priv,INDEX *_index,float& pts) -{ - /*--- Variables ---*/ - tvqConfInfoSubBlock *cfg; - int variableBits; - int bitcount; - int numFixedBitsPerFrame = TvqGetNumFixedBitsPerFrame(); - int btype; - - /*--- Initialization ---*/ - variableBits = 0; - bitcount = 0; - - /*--- read block independent factors ---*/ - /* Window type */ - bitcount += get_bstm( &_index->w_type, priv.cf.BITS_WTYPE,priv,pts); - if ( TvqWtypeToBtype( _index->w_type, &_index->btype ) ) { - MSG_ERR("Error: unknown window type: %d\n", _index->w_type); - return 0; - } - btype = _index->btype; - - /*--- read block dependent factors ---*/ - cfg = &priv.cf.cfg[btype]; // set the block dependent paremeters table - - bitcount += variableBits; - - /* Interleaved vector quantization */ - bitcount += GetVqInfo( cfg, priv.bits_0[btype], priv.bits_1[btype], variableBits, _index, priv); - - /* Bark-scale envelope */ - bitcount += GetBseInfo( &priv.cf, cfg, _index, priv); - /* Gain */ - bitcount += GetGainInfo( &priv.cf, cfg, _index, priv); - /* LSP */ - bitcount += GetLspInfo( &priv.cf, _index, priv ); - /* PPC */ - if ( cfg->ppc_enable ){ - bitcount += GetPpcInfo( &priv.cf, _index, priv); - } - /* Energy Balance Calibration */ - if ( cfg->ebc_enable ){ - bitcount += GetEbcInfo( &priv.cf, cfg, _index, priv); - } - - return bitcount == numFixedBitsPerFrame ? bitcount/8 : 0; -} - -static void frtobuf(float out[], /* Input --- input data frame */ - float bufout[], /* Output --- output data buffer array */ - unsigned frameSize, /* Input --- frame size */ - unsigned numChannels) /* Input --- number of channels */ -{ - /*--- Variables ---*/ - unsigned ismp, ich; - float *ptr; - register float dtmp; - - for ( ich=0; ich<numChannels; ich++ ){ - ptr = out+ich*frameSize; - for ( ismp=0; ismp<frameSize; ismp++ ){ - dtmp = ptr[ismp]; - if ( dtmp >= 0. ) - bufout[ismp*numChannels+ich] = (dtmp+0.5)/32767.; - else - bufout[ismp*numChannels+ich] = (dtmp-0.5)/32767.; - } - } -} - -unsigned decode(Opaque& ctx,unsigned char *buf,unsigned minlen,unsigned maxlen,float& pts) -{ - twin_private_t& priv=static_cast<twin_private_t&>(ctx); - unsigned l,len=0; - float null_pts; - sh_audio_t* sh_audio = priv.sh; - UNUSED(maxlen); - while(len<minlen) - { - float out[priv.framesize*sh_audio->nch]; - l=vqf_read_frame(priv,&priv.index,len?null_pts:pts); - if(!l) break; - TvqDecodeFrame(&priv.index, out); - frtobuf(out, (float *)buf, priv.framesize, sh_audio->nch); - len += priv.framesize*sh_audio->nch*4; - buf += priv.framesize*sh_audio->nch*4; - } - return len; -} Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -221,44 +221,6 @@ } if(done) vf_showlist(priv->vfilter); -#ifdef ENABLE_WIN32LOADER - if(sh_video->codec) { - done=0; - MSG_DBG3("mpcv_init(%p, %s, %s, %i)\n",sh_video,codecname,vfm,status); - while((sh_video->codec=find_codec(sh_video->fourcc, - sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL, - sh_video->codec,0) )){ - // ok we found one codec - if(sh_video->codec->flags&CODECS_FLAG_SELECTED) { - MSG_DBG3("mpcv_init: %s already tried and failed\n",sh_video->codec->codec_name); - continue; - } - if(codecname && strcmp(sh_video->codec->codec_name,codecname)) { - MSG_DBG3("mpcv_init: %s != %s [-vc]\n",sh_video->codec->codec_name,codecname); - continue; - } - if(vfm && strcmp(sh_video->codec->driver_name,vfm)!=0) { - MSG_DBG3("mpcv_init: vfm doesn't match %s != %s\n",vfm,sh_video->codec->driver_name); - continue; // vfm doesn't match - } - if(sh_video->codec->status<status) { - MSG_DBG3("mpcv_init: %s too unstable\n",sh_video->codec->codec_name); - continue; - } - sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it - // ok, it matches all rules, let's find the driver! - if(!(priv->mpvdec=vfm_find_driver(sh_video->codec->driver_name))) continue; - else MSG_DBG3("mpcv_init: mpcodecs_vd_drivers[%s]->mpvdec==0\n",priv->mpvdec->info->driver_name); - // it's available, let's try to init! - if(priv->mpvdec->init(*priv->ctx,*handle)!=MPXP_Ok){ - MSG_ERR(MSGTR_CODEC_CANT_INITV); - continue; // try next... - } - done=1; - break; - } - } -#endif if(done) { mpcv_print_codec_info(*priv); // memory leak here Modified: mplayerxp/libmpcodecs/vd.cpp =================================================================== --- mplayerxp/libmpcodecs/vd.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/vd.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -43,13 +43,6 @@ extern const vd_functions_t mpcodecs_vd_theora; static const vd_functions_t* mpcodecs_vd_drivers[] = { -#ifdef ENABLE_WIN32LOADER - &mpcodecs_vd_dshow, - &mpcodecs_vd_vfw, - &mpcodecs_vd_vfwex, - &mpcodecs_vd_dmo, - &mpcodecs_vd_qtvideo, -#endif &mpcodecs_vd_raw, &mpcodecs_vd_nuv, &mpcodecs_vd_libmpeg2, Deleted: mplayerxp/libmpcodecs/vd_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.cpp 2013-06-08 14:04:10 UTC (rev 649) +++ mplayerxp/libmpcodecs/vd_dmo.cpp 2013-06-10 07:27:20 UTC (rev 650) @@ -1,131 +0,0 @@ -#include "mpxp_config.h" -#include "osdep/mplib.h" -using namespace usr; -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> - -#include "mpxp_help.h" - -#include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ - -#include "vd_internal.h" -#include "codecs_ld.h" -#include "win32loader/dmo/DMO_VideoDecoder.h" -#include "vd_msg.h" - -static const vd_info_t info = { - "Win32/DMO video codecs", - "dmo", - "A'rpi", - "build-in" -}; - -static const mpxp_option_t options[] = { - { NULL, NULL, 0, 0, 0, 0, NULL} -}; - -LIBVD_EXTERN(dmo) - -struct vdmo_private_t : public Opaque { - vdmo_private_t(); - virtual ~vdmo_private_t(); - - DMO_VideoDecoder* dmo; - sh_video_t* sh; - video_decoder_t* parent; -}; -vdmo_private_t::vdmo_private_t() {} -vdmo_private_t::~vdmo_private_t() { - DMO_VideoDecoder_Destroy(dmo); -} - -static const video_probe_t* __FASTCALL__ probe(uint32_t fourcc) { return NULL; } - -// to set/get/query special features/parameters -static MPXP_Rc control_vd(Opaque& ctx,int cmd,any_t* arg,...){ - UNUSED(ctx); - switch(cmd){ - case VDCTRL_QUERY_FORMAT: - if (*((int*)arg) == IMGFMT_YV12 || - *((int*)arg) == IMGFMT_I420 || - *((int*)arg) == IMGFMT_IYUV || - *((int*)arg) == IMGFMT_YVU9 || - *((int*)arg) == IMGFMT_YUY2 || - *((int*)arg) == IMGFMT_UYVY) - return MPXP_True; - else return MPXP_False; - default: break; - } - return MPXP_Unknown; -} - -static Opaque* preinit(const video_probe_t& probe,sh_video_t *sh,put_slice_info_t& psi){ - UNUSED(probe); - UNUSED(psi); - vdmo_private_t* priv = new(zeromem) vdmo_private_t; - priv->sh=sh; - return priv; -} - -// init driver -static MPXP_Rc init(Opaque& ctx,video_decoder_t& opaque){ - unsigned int out_fmt; - vdmo_private_t& priv=static_cast<vdmo_private_t&>(ctx); - priv.parent = &opaque; - sh_video_t* sh = pr... [truncated message content] |
From: <nic...@us...> - 2013-06-08 14:04:16
|
Revision: 649 http://sourceforge.net/p/mplayerxp/code/649 Author: nickols_k Date: 2013-06-08 14:04:10 +0000 (Sat, 08 Jun 2013) Log Message: ----------- import idea of binary_packet from beye Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/libmpdemux/demux_ac3.cpp mplayerxp/libmpdemux/demux_aiff.cpp mplayerxp/libmpdemux/demux_asf.cpp mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demux_bmp.cpp mplayerxp/libmpdemux/demux_dca.cpp mplayerxp/libmpdemux/demux_film.cpp mplayerxp/libmpdemux/demux_flac.cpp mplayerxp/libmpdemux/demux_fli.cpp mplayerxp/libmpdemux/demux_lavf.cpp mplayerxp/libmpdemux/demux_mkv.cpp mplayerxp/libmpdemux/demux_mov.cpp mplayerxp/libmpdemux/demux_mp3.cpp mplayerxp/libmpdemux/demux_mpg.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpdemux/demux_musepack.cpp mplayerxp/libmpdemux/demux_nsv.cpp mplayerxp/libmpdemux/demux_nuv.cpp mplayerxp/libmpdemux/demux_ogg.cpp mplayerxp/libmpdemux/demux_pva.cpp mplayerxp/libmpdemux/demux_rawaudio.cpp mplayerxp/libmpdemux/demux_real.cpp mplayerxp/libmpdemux/demux_realaud.cpp mplayerxp/libmpdemux/demux_roq.cpp mplayerxp/libmpdemux/demux_smjpeg.cpp mplayerxp/libmpdemux/demux_snd_au.cpp mplayerxp/libmpdemux/demux_ts.cpp mplayerxp/libmpdemux/demux_ty.cpp mplayerxp/libmpdemux/demux_viv.cpp mplayerxp/libmpdemux/demux_voc.cpp mplayerxp/libmpdemux/demux_vqf.cpp mplayerxp/libmpdemux/demux_wav.cpp mplayerxp/libmpdemux/demux_y4m.cpp mplayerxp/libmpdemux/demuxer_r.cpp mplayerxp/libmpdemux/demuxer_stream.cpp mplayerxp/libmpdemux/mp3_hdr.cpp mplayerxp/libmpdemux/mp3_hdr.h mplayerxp/libmpdemux/mpeg_hdr.cpp mplayerxp/libmpdemux/mux_mpxp64.cpp mplayerxp/libmpdemux/parse_mp4.cpp mplayerxp/libmpdemux/yuv4mpeg.cpp mplayerxp/libmpstream2/cache2.cpp mplayerxp/libmpstream2/stream.cpp mplayerxp/libmpstream2/stream.h mplayerxp/libmpsub/vobsub.cpp mplayerxp/libplaytree2/playtreeparser.cpp mplayerxp/xmpcore/Makefile Added Paths: ----------- mplayerxp/xmpcore/binary_packet.cpp mplayerxp/xmpcore/binary_packet.h Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/dump.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -41,7 +41,6 @@ void dump_stream(Stream *stream) { char buf[4096]; - int len; std::ofstream f; const char *ext,*name; MP_UNIT("dumpstream"); @@ -65,8 +64,8 @@ } MSG_INFO("Dumping stream to %s\n",name); while(!stream->eof()){ - len=stream->read(buf,4096); - if(len>0) f.write(buf,len); + binary_packet bp=stream->read(4096); + if(bp.size()>0) f.write(bp.cdata(),bp.size()); } f.close(); mpxp_info<<MSGTR_StreamDumped<<std::endl; Modified: mplayerxp/libmpdemux/demux_ac3.cpp =================================================================== --- mplayerxp/libmpdemux/demux_ac3.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_ac3.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -141,39 +141,38 @@ demuxer->movi_end = s->end_pos(); memcpy(b,hdr,4); s->seek(pos+4); - s->read(&b[4],4); + binary_packet bp=s->read(4); + memcpy(&b[4],bp.data(),bp.size()); for(n = 0; n < 5 ; n++) { - MSG_DBG2("read_ac3_tags\n"); - pos = ac3_decode_header(b,bitrate,samplerate,channels); - if(pos < 0) - return 0; - s->skip(pos-8); - if(s->eof()) - return 0; - s->read(b,8); - if(s->eof()) - return 0; + MSG_DBG2("read_ac3_tags\n"); + pos = ac3_decode_header(b,bitrate,samplerate,channels); + if(pos < 0) return 0; + s->skip(pos-8); + if(s->eof()) return 0; + bp=s->read(8); + memcpy(b,bp.data(),bp.size()); + if(s->eof()) return 0; } return 1; } static int ac3_get_raw_id(Demuxer *demuxer,off_t fptr,unsigned *brate,unsigned *samplerate,unsigned *channels) { - uint32_t fcc,fcc1,fmt; - uint8_t *p,b[32]; - Stream *s; - *brate=*samplerate=*channels=0; - s = demuxer->stream; - s->seek(fptr); - fcc=fcc1=s->read_dword(); - fcc1=me2be_32(fcc1); - p = (uint8_t *)&fcc1; - s->seek(fptr); - s->read(b,sizeof(b)); - /* ac3 header check */ - if(ac3_decode_header(b,samplerate,brate,channels)>0) return 1; - s->seek(fptr); - return 0; + uint32_t fcc,fcc1; + uint8_t *p; + Stream *s; + *brate=*samplerate=*channels=0; + s = demuxer->stream; + s->seek(fptr); + fcc=fcc1=s->read_dword(); + fcc1=me2be_32(fcc1); + p = (uint8_t *)&fcc1; + s->seek(fptr); + binary_packet bp=s->read(32); + /* ac3 header check */ + if(ac3_decode_header((const uint8_t*)bp.data(),samplerate,brate,channels)>0) return 1; + s->seek(fptr); + return 0; } static MPXP_Rc ac3_probe(Demuxer* demuxer) @@ -213,7 +212,8 @@ step = 1; if(pos < HDR_SIZE) { - s->read(&hdr[pos],HDR_SIZE-pos); + binary_packet bp=s->read(HDR_SIZE-pos); + memcpy(&hdr[pos],bp.data(),bp.size()); pos = HDR_SIZE; } @@ -224,7 +224,8 @@ uint8_t b[21]; MSG_DBG2("initial mp3_header: 0x%08X at %lu\n",*(uint32_t *)hdr,st_pos); memcpy(b,hdr,HDR_SIZE); - s->read(&b[HDR_SIZE],12-HDR_SIZE); + binary_packet bp=s->read(12-HDR_SIZE); + memcpy(&b[HDR_SIZE],bp.data(),bp.size()); if((n = ac3_decode_header(b,&fmt,&fmt,&fmt)) > 0) { demuxer->movi_start = st_pos; break; @@ -294,11 +295,10 @@ } frmt=priv->frmt; while(!s->eof() || (demux->movi_end && s->tell() >= demux->movi_end) ) { - uint8_t hdr[8]; int len; unsigned dummy; - s->read(hdr,8); - len = ac3_decode_header(hdr,&dummy,&dummy,&dummy); + binary_packet hdr=s->read(8); + len = ac3_decode_header((const uint8_t*)hdr.data(),&dummy,&dummy,&dummy); MSG_DBG2("ac3_fillbuffer %u bytes\n",len); if(s->eof()) return 0; /* workaround for dead-lock (skip(-7)) below */ if(len < 0) { @@ -309,9 +309,11 @@ if(len>8) { Demuxer_Packet* dp = new(zeromem) Demuxer_Packet(len); - memcpy(dp->buffer(),hdr,8); + memcpy(dp->buffer(),hdr.data(),hdr.size()); dp->resize(len+8); - len=s->read(dp->buffer()+8,len-8); + binary_packet bp=s->read(len-8); + len=bp.size(); + memcpy(dp->buffer()+8,bp.data(),bp.size()); priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + len/(float)sh_audio->i_bps; dp->pts = priv->last_pts - (demux->audio->tell_pts()-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; dp->flags=DP_NONKEYFRAME; @@ -325,25 +327,24 @@ } static void high_res_ac3_seek(Demuxer *demuxer,float _time) { - uint8_t hdr[8]; - int len,nf; - unsigned tmp; - ac3_priv_t* priv = static_cast<ac3_priv_t*>(demuxer->priv); - sh_audio_t* sh = (sh_audio_t*)demuxer->audio->sh; + int len,nf; + unsigned tmp; + ac3_priv_t* priv = static_cast<ac3_priv_t*>(demuxer->priv); + sh_audio_t* sh = (sh_audio_t*)demuxer->audio->sh; - nf = _time*sh->rate/1152; - while(nf > 0) { - demuxer->stream->read(hdr,8); - MSG_DBG2("high_res_mp3_seek\n"); - len = ac3_decode_header(hdr,&tmp,&tmp,&tmp); - if(len < 0) { - demuxer->stream->skip(-7); - continue; + nf = _time*sh->rate/1152; + while(nf > 0) { + binary_packet bp = demuxer->stream->read(8); + MSG_DBG2("high_res_mp3_seek\n"); + len = ac3_decode_header((const uint8_t*)bp.data(),&tmp,&tmp,&tmp); + if(len < 0) { + demuxer->stream->skip(-7); + continue; + } + demuxer->stream->skip(len-8); + priv->last_pts += 1152/(float)sh->rate; + nf--; } - demuxer->stream->skip(len-8); - priv->last_pts += 1152/(float)sh->rate; - nf--; - } } static void ac3_seek(Demuxer *demuxer,const seek_args_t* seeka){ Modified: mplayerxp/libmpdemux/demux_aiff.cpp =================================================================== --- mplayerxp/libmpdemux/demux_aiff.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_aiff.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -42,13 +42,14 @@ static MPXP_Rc aiff_probe(Demuxer* demuxer) { - char buf[12]; - Stream *s; - s = demuxer->stream; - s->read(buf,12); - if(*((uint32_t *)&buf[0])==mmioFOURCC('F','O','R','M') && *((uint32_t *)&buf[8])==mmioFOURCC('A','I','F','F')) return MPXP_Ok; - if(*((uint32_t *)&buf[0])==mmioFOURCC('F','O','R','M') && *((uint32_t *)&buf[8])==mmioFOURCC('A','I','F','C')) return MPXP_Ok; - return MPXP_False; + char buf[12]; + Stream *s; + s = demuxer->stream; + binary_packet bp=s->read(12); + memcpy(buf,bp.data(),bp.size()); + if(*((uint32_t *)&buf[0])==mmioFOURCC('F','O','R','M') && *((uint32_t *)&buf[8])==mmioFOURCC('A','I','F','F')) return MPXP_Ok; + if(*((uint32_t *)&buf[0])==mmioFOURCC('F','O','R','M') && *((uint32_t *)&buf[8])==mmioFOURCC('A','I','F','C')) return MPXP_Ok; + return MPXP_False; } static Opaque* aiff_open(Demuxer* demuxer) { @@ -72,14 +73,18 @@ w->cbSize = 0; s->reset(); s->seek(8); - if(s->read(preamble,4)!=4) return NULL; + binary_packet bp=s->read(4); + if(bp.size()!=4) return NULL; + memcpy(preamble,bp.data(),bp.size()); if(*((uint32_t *)&preamble[0])==mmioFOURCC('A','I','F','C')) priv->verc=1; demuxer->movi_start=0; while(1) { unsigned frames=0; - int chunk_size; - if(s->read(preamble,8)!=8) break; + unsigned chunk_size; + bp=s->read(8); + if(bp.size()!=8) return NULL; + memcpy(preamble,bp.data(),bp.size()); chunk_size=be2me_32(*((uint32_t *)&preamble[4])); MSG_V("Got preamble: %c%c%c%c\n",preamble[0],preamble[1],preamble[2],preamble[3]); if(*((uint32_t *)&preamble[0])==mmioFOURCC('F','V','E','R')) @@ -89,7 +94,9 @@ MSG_V("Wrong length of VFER chunk %lu\n",be2me_32(*((uint32_t *)&preamble[4]))); return NULL; } - if(s->read(preamble,4)!=4) return NULL; + bp=s->read(4); + if(bp.size()!=4) return NULL; + memcpy(preamble,bp.data(),bp.size()); if(be2me_32(*((uint32_t *)&preamble[0])) == 0xA2805140) priv->verc=1; else { @@ -102,12 +109,13 @@ { char buf[chunk_size]; unsigned clen=priv->verc?22:18; - if(chunk_size < clen) - { + if(chunk_size < clen) { MSG_V("Invalid COMM length %u\n",chunk_size); return NULL; } - if(s->read(buf,chunk_size)!=chunk_size) return NULL; + bp=s->read(chunk_size); + if(bp.size()!=chunk_size) return NULL; + memcpy(buf,bp.data(),bp.size()); w->nChannels = sh_audio->nch = be2me_16(*((uint16_t *)&buf[0])); frames=be2me_32(*((uint32_t *)&buf[2])); w->wBitsPerSample = be2me_16(*((uint16_t *)&buf[6])); @@ -136,37 +144,37 @@ else if(*((uint32_t *)&preamble[0])==mmioFOURCC('N','A','M','E')) { - char buf[chunk_size+1]; - s->read(buf,chunk_size); - buf[chunk_size]=0; - demuxer->info().add(INFOT_NAME, buf); + bp=s->read(chunk_size); + bp.resize(bp.size()+1); + bp[chunk_size]=0; + demuxer->info().add(INFOT_NAME, bp.cdata()); if(priv->verc && (chunk_size&1)) s->read_char(); } else if(*((uint32_t *)&preamble[0])==mmioFOURCC('A','U','T','H')) { - char buf[chunk_size+1]; - s->read(buf,chunk_size); - buf[chunk_size]=0; - demuxer->info().add(INFOT_AUTHOR, buf); + bp=s->read(chunk_size); + bp.resize(bp.size()+1); + bp[chunk_size]=0; + demuxer->info().add(INFOT_AUTHOR, bp.cdata()); if(priv->verc && (chunk_size&1)) s->read_char(); } else if(*((uint32_t *)&preamble[0])==mmioFOURCC('(','c',')',' ')) { - char buf[chunk_size+1]; - s->read(buf,chunk_size); - buf[chunk_size]=0; - demuxer->info().add(INFOT_COPYRIGHT, buf); + bp=s->read(chunk_size); + bp.resize(bp.size()+1); + bp[chunk_size]=0; + demuxer->info().add(INFOT_COPYRIGHT, bp.cdata()); if(priv->verc && (chunk_size&1)) s->read_char(); } else if(*((uint32_t *)&preamble[0])==mmioFOURCC('A','N','N','O')) { - char buf[chunk_size+1]; - s->read(buf,chunk_size); - buf[chunk_size]=0; - demuxer->info().add(INFOT_DESCRIPTION, buf); + bp=s->read(chunk_size); + bp.resize(bp.size()+1); + bp[chunk_size]=0; + demuxer->info().add(INFOT_DESCRIPTION, bp.cdata()); if(priv->verc && (chunk_size&1)) s->read_char(); } else @@ -185,23 +193,24 @@ } static int aiff_demux(Demuxer* demuxer, Demuxer_Stream *ds) { - sh_audio_t* sh_audio = reinterpret_cast<sh_audio_t*>(demuxer->audio->sh); - int l = sh_audio->wf->nAvgBytesPerSec; - off_t spos = demuxer->stream->tell(); + sh_audio_t* sh_audio = reinterpret_cast<sh_audio_t*>(demuxer->audio->sh); + int l = sh_audio->wf->nAvgBytesPerSec; + off_t spos = demuxer->stream->tell(); - if(demuxer->stream->eof()) - return 0; + if(demuxer->stream->eof()) return 0; - Demuxer_Packet* dp = new(zeromem) Demuxer_Packet(l); - dp->pts = spos / (float)(sh_audio->wf->nAvgBytesPerSec); - dp->pos = spos; - dp->flags = DP_NONKEYFRAME; + Demuxer_Packet* dp = new(zeromem) Demuxer_Packet(l); + dp->pts = spos / (float)(sh_audio->wf->nAvgBytesPerSec); + dp->pos = spos; + dp->flags = DP_NONKEYFRAME; - l=demuxer->stream->read(dp->buffer(),l); - dp->resize(l); - ds->add_packet(dp); + binary_packet bp=demuxer->stream->read(l); + l=bp.size(); + memcpy(dp->buffer(),bp.data(),l); + dp->resize(l); + ds->add_packet(dp); - return 1; + return 1; } static void aiff_seek(Demuxer *demuxer,const seek_args_t* seeka){ Modified: mplayerxp/libmpdemux/demux_asf.cpp =================================================================== --- mplayerxp/libmpdemux/demux_asf.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_asf.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -133,7 +133,8 @@ apriv->asf_packetrate=0; apriv->asf_movielength=0; - demuxer->stream->read((char*)&apriv->asfh,sizeof(ASF_header_t)); // header obj + binary_packet bp=demuxer->stream->read(sizeof(ASF_header_t)); // header obj + memcpy((char*)&apriv->asfh,bp.data(),bp.size()); le2me_ASF_header_t(&apriv->asfh); // swap to machine endian if(memcmp(asf2hdrguid,apriv->asfh.objh.guid,16)==0){ MSG_ERR("ASF_check: found ASF v2 guid!\nCurrently is not supported - please report!\n"); @@ -155,25 +156,27 @@ } static Opaque* asf_open(Demuxer *demuxer){ - static unsigned char buffer[2048]; - uint32_t* streams = NULL; - int audio_streams=0; - int video_streams=0; - uint16_t stream_count=0; - int best_video = -1; - int best_audio = -1; - asf_priv_t *apriv=static_cast<asf_priv_t*>(demuxer->priv); + binary_packet bp(1); + uint32_t* streams = NULL; + int audio_streams=0; + int video_streams=0; + uint16_t stream_count=0; + int best_video = -1; + int best_audio = -1; + asf_priv_t *apriv=static_cast<asf_priv_t*>(demuxer->priv); while(!demuxer->stream->eof()){ - int pos,endpos; - pos=demuxer->stream->tell(); - demuxer->stream->read((char*) &apriv->objh,sizeof(ASF_obj_header_t)); - le2me_ASF_obj_header_t(&apriv->objh); - if(demuxer->stream->eof()) break; // EOF - endpos=pos+apriv->objh.size; - switch(ASF_LOAD_GUID_PREFIX(apriv->objh.guid)){ + int pos,endpos; + pos=demuxer->stream->tell(); + bp=demuxer->stream->read(sizeof(ASF_obj_header_t)); + memcpy(&apriv->objh,bp.data(),bp.size()); + le2me_ASF_obj_header_t(&apriv->objh); + if(demuxer->stream->eof()) break; // EOF + endpos=pos+apriv->objh.size; + switch(ASF_LOAD_GUID_PREFIX(apriv->objh.guid)){ case ASF_GUID_PREFIX_stream_header: - demuxer->stream->read((char*) &apriv->streamh,sizeof(ASF_stream_header_t)); + bp=demuxer->stream->read(sizeof(ASF_stream_header_t)); + memcpy(&apriv->streamh,bp.data(),bp.size()); le2me_ASF_stream_header_t(&apriv->streamh); MSG_V("stream type: %s\n" "stream concealment: %s\n" @@ -186,20 +189,20 @@ ,(unsigned long)apriv->streamh.unk1,(unsigned int)apriv->streamh.unk2 ,demuxer->stream->tell()); // type-specific data: - demuxer->stream->read((char*) buffer,apriv->streamh.type_size); + bp=demuxer->stream->read(apriv->streamh.type_size); switch(ASF_LOAD_GUID_PREFIX(apriv->streamh.type)){ case ASF_GUID_PREFIX_audio_stream: { sh_audio_t* sh_audio=demuxer->new_sh_audio(apriv->streamh.stream_no & 0x7F); ++audio_streams; sh_audio->wf=(WAVEFORMATEX*)mp_calloc((apriv->streamh.type_size<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):apriv->streamh.type_size,1); - memcpy(sh_audio->wf,buffer,apriv->streamh.type_size); + memcpy(sh_audio->wf,bp.data(),bp.size()); le2me_WAVEFORMATEX(sh_audio->wf); if(mp_conf.verbose>=1) print_wave_header(sh_audio->wf,apriv->streamh.type_size); if(ASF_LOAD_GUID_PREFIX(apriv->streamh.concealment)==ASF_GUID_PREFIX_audio_conceal_interleave){ - demuxer->stream->read((char*) buffer,apriv->streamh.stream_size); - apriv->asf_scrambling_h=buffer[0]; - apriv->asf_scrambling_w=(buffer[2]<<8)|buffer[1]; - apriv->asf_scrambling_b=(buffer[4]<<8)|buffer[3]; + bp=demuxer->stream->read(apriv->streamh.stream_size); + apriv->asf_scrambling_h=bp.cdata()[0]; + apriv->asf_scrambling_w=(bp.cdata()[2]<<8)|bp.cdata()[1]; + apriv->asf_scrambling_b=(bp.cdata()[4]<<8)|bp.cdata()[3]; apriv->asf_scrambling_w/=apriv->asf_scrambling_b; } else { apriv->asf_scrambling_b=apriv->asf_scrambling_h=apriv->asf_scrambling_w=1; @@ -212,7 +215,7 @@ unsigned int len=apriv->streamh.type_size-(4+4+1+2); ++video_streams; sh_video->bih=(BITMAPINFOHEADER*)mp_mallocz(len<sizeof(BITMAPINFOHEADER)?sizeof(BITMAPINFOHEADER):len); - memcpy(sh_video->bih,&buffer[4+4+1+2],len); + memcpy(sh_video->bih,&bp.cdata()[4+4+1+2],len); le2me_BITMAPINFOHEADER(sh_video->bih); if(mp_conf.verbose>=1) print_video_header(sh_video->bih,len); break; @@ -222,7 +225,8 @@ break; // case ASF_GUID_PREFIX_header_2_0: return "guid_header_2_0"; case ASF_GUID_PREFIX_file_header: // guid_file_header - demuxer->stream->read((char*) &apriv->fileh,sizeof(ASF_file_header_t)); + bp=demuxer->stream->read(sizeof(ASF_file_header_t)); + memcpy((char*) &apriv->fileh,bp.data(),bp.size()); le2me_ASF_file_header_t(&apriv->fileh); MSG_V("ASF: size: %llu play_duration: %llu send_duration: %llu packets: %d\nflags: %d min_packet_size: %d max_packet_size: %d max_bitrate: %d preroll: %d\n", (uint64_t)apriv->fileh.file_size,(uint64_t)apriv->fileh.play_duration,(uint64_t)apriv->fileh.send_duration, @@ -242,49 +246,39 @@ case ASF_GUID_PREFIX_content_desc: // Content description { - char *string=NULL; - demuxer->stream->read((char*) &apriv->contenth,sizeof(ASF_content_description_t)); + bp=demuxer->stream->read(sizeof(ASF_content_description_t)); + memcpy((char*) &apriv->contenth,bp.data(),bp.size()); le2me_ASF_content_description_t(&apriv->contenth); MSG_V("\n"); // extract the title if( apriv->contenth.title_size!=0 ) { - string=new char[apriv->contenth.title_size]; - demuxer->stream->read( string, apriv->contenth.title_size); - pack_asf_string(string, apriv->contenth.title_size); - demuxer->info().add(INFOT_NAME, string); - delete string; + bp=demuxer->stream->read(apriv->contenth.title_size); + pack_asf_string(bp.cdata(), bp.size()); + demuxer->info().add(INFOT_NAME, bp.cdata()); } // extract the author if( apriv->contenth.author_size!=0 ) { - string=new char [apriv->contenth.author_size]; - demuxer->stream->read( string, apriv->contenth.author_size); - pack_asf_string(string, apriv->contenth.author_size); - demuxer->info().add(INFOT_AUTHOR, string); - delete string; + bp=demuxer->stream->read(apriv->contenth.author_size); + pack_asf_string(bp.cdata(),bp.size()); + demuxer->info().add(INFOT_AUTHOR, bp.cdata()); } // extract the copyright if( apriv->contenth.copyright_size!=0 ) { - string=new char [apriv->contenth.copyright_size]; - demuxer->stream->read( string, apriv->contenth.copyright_size); - pack_asf_string(string, apriv->contenth.copyright_size); - demuxer->info().add(INFOT_COPYRIGHT, string); - delete string; + bp=demuxer->stream->read(apriv->contenth.copyright_size); + pack_asf_string(bp.cdata(), bp.size()); + demuxer->info().add(INFOT_COPYRIGHT, bp.cdata()); } // extract the comment if( apriv->contenth.comment_size!=0 ) { - string=new char [apriv->contenth.comment_size]; - demuxer->stream->read( string, apriv->contenth.comment_size); - pack_asf_string(string, apriv->contenth.comment_size); - demuxer->info().add(INFOT_COMMENTS, string); - delete string; + bp=demuxer->stream->read(apriv->contenth.comment_size); + pack_asf_string(bp.cdata(), bp.size()); + demuxer->info().add(INFOT_COMMENTS, bp.cdata()); } // extract the rating if( apriv->contenth.rating_size!=0 ) { - string=new char [apriv->contenth.rating_size]; - demuxer->stream->read( string, apriv->contenth.rating_size); - pack_asf_string(string, apriv->contenth.comment_size); - demuxer->info().add(INFOT_RATING, string); - delete string; + bp=demuxer->stream->read(apriv->contenth.rating_size); + pack_asf_string(bp.cdata(), bp.size()); + demuxer->info().add(INFOT_RATING, bp.cdata()); } MSG_V("\n"); break; @@ -295,19 +289,12 @@ char *object=NULL, *ptr=NULL; MSG_V("============ ASF Stream group == START ===\n"); MSG_V(" object size = %d\n", (int)apriv->objh.size); - object = new char[apriv->objh.size]; - if( object==NULL ) { - MSG_ERR("Memory allocation failed\n"); - delete demuxer->priv; - return NULL; - } - demuxer->stream->read(object, apriv->objh.size ); + bp=demuxer->stream->read(apriv->objh.size ); // FIXME: We need some endian handling below... - ptr = object; + ptr = bp.cdata(); stream_count = le2me_16(*(uint16_t*)ptr); ptr += sizeof(uint16_t); - if(stream_count > 0) - streams = (uint32_t*)mp_malloc(2*stream_count*sizeof(uint32_t)); + if(stream_count > 0) streams = new uint32_t[2*stream_count]; MSG_V(" stream count=[0x%x][%u]\n", stream_count, stream_count ); for( i=0 ; i<stream_count && ptr<((char*)object+apriv->objh.size) ; i++ ) { stream_id = le2me_16(*(uint16_t*)ptr); @@ -321,7 +308,6 @@ streams[2*i+1] = max_bitrate; } MSG_V("============ ASF Stream group == END ===\n"); - delete object ; break; } } // switch GUID @@ -460,7 +446,8 @@ if(dp->length()!=unsigned(offs) && offs!=-1) MSG_V("warning! fragment.len=%d BUT next fragment offset=%d \n",dp->length(),offs); dp->resize(dp->length()+len); demux->stream->seek(dataoff); - demux->stream->read(dp->buffer()+dp->length(),len); + binary_packet bp=demux->stream->read(len); + memcpy(dp->buffer()+dp->length(),bp.data(),bp.size()); MSG_DBG3("data appended! %d+%d\n",dp->length(),len); // we are ready now. return 1; @@ -474,7 +461,9 @@ } Demuxer_Packet* dp=new(zeromem) Demuxer_Packet(len); demux->stream->seek(dataoff); - len=demux->stream->read(dp->buffer(),len); + binary_packet bp=demux->stream->read(len); + len=bp.size(); + memcpy(dp->buffer(),bp.data(),len); dp->resize(len); dp->pts=time*0.001f; dp->flags=keyframe?DP_KEYFRAME:DP_NONKEYFRAME; Modified: mplayerxp/libmpdemux/demux_avi.cpp =================================================================== --- mplayerxp/libmpdemux/demux_avi.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_avi.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -118,14 +118,15 @@ extern const demuxer_driver_t demux_avi; static void read_avi_header(Demuxer *demuxer,int index_mode){ -MainAVIHeader avih; -sh_audio_t *sh_audio=NULL; -sh_video_t *sh_video=NULL; -int stream_id=-1; -int idxfix_videostream=0; -int idxfix_divx=0; -avi_priv_t* priv=static_cast<avi_priv_t*>(demuxer->priv); -off_t list_end=0; + binary_packet bp(1); + MainAVIHeader avih; + sh_audio_t *sh_audio=NULL; + sh_video_t *sh_video=NULL; + int stream_id=-1; + int idxfix_videostream=0; + int idxfix_divx=0; + avi_priv_t* priv=static_cast<avi_priv_t*>(demuxer->priv); + off_t list_end=0; //---- AVI header: priv->idx_size=0; @@ -248,7 +249,8 @@ case mmioFOURCC('I','D','I','T'): hdr="Digitization Time";break; case ckidAVIMAINHDR: // read 'avih' - demuxer->stream->read((char*) &avih,std::min(size2,unsigned(sizeof(avih)))); + bp=demuxer->stream->read(std::min(size2,unsigned(sizeof(avih)))); + memcpy(&avih,bp.data(),bp.size()); le2me_MainAVIHeader(&avih); // swap to machine endian chunksize-=std::min(size2,unsigned(sizeof(avih))); demuxer->movi_length=avih.dwTotalFrames; @@ -256,7 +258,8 @@ break; case ckidSTREAMHEADER: { // read 'strh' AVIStreamHeader h; - demuxer->stream->read((char*) &h,std::min(size2,unsigned(sizeof(h)))); + bp=demuxer->stream->read(std::min(size2,unsigned(sizeof(h)))); + memcpy(&h,bp.data(),bp.size()); le2me_AVIStreamHeader(&h); // swap to machine endian chunksize-=std::min(size2,unsigned(sizeof(h))); ++stream_id; @@ -293,8 +296,9 @@ s->bIndexType = demuxer->stream->read_char(); s->nEntriesInUse = demuxer->stream->read_dword_le(); *(uint32_t *)s->dwChunkId = demuxer->stream->read_dword_le(); - demuxer->stream->read( (char *)s->dwReserved, 3*4); - memset(s->dwReserved, 0, 3*4); + bp=demuxer->stream->read(3*4); + memcpy(s->dwReserved,bp.data(),bp.size()); + memset(s->dwReserved,0,3*4); print_avisuperindex_chunk(s); @@ -319,7 +323,8 @@ if(last_fccType==streamtypeVIDEO){ sh_video->bih=(BITMAPINFOHEADER*)mp_mallocz((chunksize<sizeof(BITMAPINFOHEADER))?sizeof(BITMAPINFOHEADER):chunksize); MSG_V("found 'bih', %u bytes of %d\n",chunksize,sizeof(BITMAPINFOHEADER)); - demuxer->stream->read((char*) sh_video->bih,chunksize); + bp=demuxer->stream->read(chunksize); + memcpy(sh_video->bih,bp.data(),bp.size()); le2me_BITMAPINFOHEADER(sh_video->bih); // swap to machine endian // fixup MS-RLE header (seems to be broken for <256 color files) if(sh_video->bih->biCompression<=1 && sh_video->bih->biSize==40) @@ -372,7 +377,8 @@ unsigned wf_size = chunksize<sizeof(WAVEFORMATEX)?sizeof(WAVEFORMATEX):chunksize; sh_audio->wf=(WAVEFORMATEX*)mp_mallocz(wf_size); MSG_V("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX)); - demuxer->stream->read((char*) sh_audio->wf,chunksize); + bp=demuxer->stream->read(chunksize); + memcpy(sh_audio->wf,bp.data(),bp.size()); le2me_WAVEFORMATEX(sh_audio->wf); if (sh_audio->wf->cbSize != 0 && wf_size < sizeof(WAVEFORMATEX)+sh_audio->wf->cbSize) { @@ -388,7 +394,8 @@ case mmioFOURCC('v', 'p', 'r', 'p'): { VideoPropHeader* vprp = (VideoPropHeader*)mp_malloc(chunksize); unsigned int i; - demuxer->stream->read( (any_t*)vprp, chunksize); + bp=demuxer->stream->read(chunksize); + memcpy(vprp,bp.data(),bp.size()); le2me_VideoPropHeader(vprp); chunksize -= sizeof(*vprp)-sizeof(vprp->FieldInfo); chunksize /= sizeof(VIDEO_FIELD_DESC); @@ -423,7 +430,8 @@ MSG_V("Reading INDEX block, %d chunks for %ld frames\n", priv->idx_size,avih.dwTotalFrames); priv->idx=(AVIINDEXENTRY*)mp_malloc(priv->idx_size<<4); - demuxer->stream->read((char*)priv->idx,priv->idx_size<<4); + bp=demuxer->stream->read(priv->idx_size<<4); + memcpy(priv->idx,bp.data(),bp.size()); for (i = 0; i < priv->idx_size; i++) { // swap index to machine endian AVIINDEXENTRY *entry=(AVIINDEXENTRY*)priv->idx + i; le2me_AVIINDEXENTRY(entry); @@ -469,14 +477,14 @@ if(size2==3) chunksize=1; // empty else { - char buf[256]; int len=(size2<250)?size2:250; - demuxer->stream->read(buf,len); + bp=demuxer->stream->read(len); chunksize-=len; - buf[len]=0; - MSG_V("%-10s: %s\n",hdr,buf); - if(infot!=-1) demuxer->info().add(infot, buf); - else MSG_V(" %s: %s\n",hdr,buf); + bp.resize(bp.size()+1); + bp.cdata()[len]=0; + MSG_V("%-10s: %s\n",hdr,bp.cdata()); + if(infot!=-1) demuxer->info().add(infot, bp.cdata()); + else MSG_V(" %s: %s\n",hdr,bp.cdata()); } } MSG_DBG2("list_end=0x%X pos=0x%X chunksize=0x%X next=0x%X\n", @@ -520,7 +528,9 @@ int ret1, ret2; memset(&cx->stdidx[j], 0, 32); ret1 = demuxer->stream->seek( (off_t)cx->aIndex[j].qwOffset); - ret2 = demuxer->stream->read( (char *)&cx->stdidx[j], 32); + bp = demuxer->stream->read(32); + ret2 = bp.size(); + memcpy(&cx->stdidx[j],bp.data(),ret2); if (ret2 != 32 || cx->stdidx[j].nEntriesInUse==0) { // this is a broken file (probably incomplete) let the standard // gen_index routine handle this @@ -534,8 +544,8 @@ print_avistdindex_chunk(&cx->stdidx[j]); priv->idx_size += cx->stdidx[j].nEntriesInUse; cx->stdidx[j].aIndex = new avistdindex_entry[cx->stdidx[j].nEntriesInUse]; - demuxer->stream->read( (char *)cx->stdidx[j].aIndex, - cx->stdidx[j].nEntriesInUse*sizeof(avistdindex_entry)); + bp=demuxer->stream->read(cx->stdidx[j].nEntriesInUse*sizeof(avistdindex_entry)); + memcpy( (char *)cx->stdidx[j].aIndex,bp.data(),bp.size()); for (k=0;k<cx->stdidx[j].nEntriesInUse; k++) le2me_avistdindex_entry(&cx->stdidx[j].aIndex[k]); Modified: mplayerxp/libmpdemux/demux_bmp.cpp =================================================================== --- mplayerxp/libmpdemux/demux_bmp.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_bmp.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -272,8 +272,8 @@ sh_video->bih->biClrUsed = demuxer->stream->read_dword_le(); sh_video->bih->biClrImportant = demuxer->stream->read_dword_le(); // fetch the palette - demuxer->stream->read( (unsigned char *)(sh_video->bih) + 40, - sh_video->bih->biClrUsed * 4); + binary_packet bp=demuxer->stream->read(sh_video->bih->biClrUsed * 4); + memcpy((unsigned char *)(sh_video->bih) + 40,bp.data(),bp.size()); // load the data bmp_image = new(zeromem) bmp_image_t; Modified: mplayerxp/libmpdemux/demux_dca.cpp =================================================================== --- mplayerxp/libmpdemux/demux_dca.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_dca.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -318,7 +318,8 @@ demuxer->movi_end = s->end_pos(); memcpy(b,hdr,4); s->seek(pos+4); - s->read(&b[4],8); + binary_packet bp=s->read(8); + memcpy(&b[4],bp.data(),bp.size()); for(n = 0; n < 5 ; n++) { MSG_DBG2("read_ddca_tags\n"); pos = ddca_decode_header(b,bitrate,samplerate,channels); @@ -327,7 +328,8 @@ s->skip(pos-12); if(s->eof()) return 0; - s->read(hdr,12); + bp=s->read(12); + memcpy(hdr,bp.data(),bp.size()); if(s->eof()) return 0; } @@ -336,18 +338,16 @@ static int dca_get_raw_id(Demuxer *demuxer,off_t fptr,unsigned *brate,unsigned *samplerate,unsigned *channels) { - uint32_t fcc,fcc1; - uint8_t *p,b[32]; + uint32_t fcc; Stream *s; *brate=*samplerate=*channels=0; s = demuxer->stream; s->seek(fptr); - fcc=fcc1=s->read_dword(); - fcc1=me2be_32(fcc1); - p = (uint8_t *)&fcc1; + fcc=s->read_dword(); + fcc=me2be_32(fcc); s->seek(fptr); - s->read(b,sizeof(b)); - if(ddca_decode_header(b,samplerate,brate,channels)>0) return 1; + binary_packet bp=s->read(32); + if(ddca_decode_header((const uint8_t*)bp.data(),samplerate,brate,channels)>0) return 1; s->seek(fptr); return 0; } @@ -356,11 +356,9 @@ { uint32_t fcc1,fcc2; Stream *s; - uint8_t *p; s = demuxer->stream; fcc1=s->read_dword(); fcc1=me2be_32(fcc1); - p = (uint8_t *)&fcc1; if(dca_get_raw_id(demuxer,0,&fcc1,&fcc2,&fcc2)) return MPXP_Ok; return MPXP_False; } @@ -383,13 +381,15 @@ s = demuxer->stream; s->reset(); s->seek(s->start_pos()); + binary_packet bp(1); while(n < 5 && !s->eof()) { st_pos = s->tell(); step = 1; if(pos < HDR_SIZE) { - s->read(&hdr[pos],HDR_SIZE-pos); + bp=s->read(HDR_SIZE-pos); + memcpy(&hdr[pos],bp.data(),bp.size()); pos = HDR_SIZE; } @@ -400,7 +400,8 @@ uint8_t b[21]; MSG_DBG2("initial mp3_header: 0x%08X at %lu\n",*(uint32_t *)hdr,st_pos); memcpy(b,hdr,HDR_SIZE); - s->read(&b[HDR_SIZE],12-HDR_SIZE); + bp=s->read(12-HDR_SIZE); + memcpy(&b[HDR_SIZE],bp.data(),bp.size()); if((n = ddca_decode_header(b,&fmt,&fmt,&fmt)) > 0) { demuxer->movi_start = st_pos; @@ -469,13 +470,12 @@ } return 0; } - + binary_packet bp(1); while(!s->eof() || (demux->movi_end && s->tell() >= demux->movi_end) ) { - uint8_t hdr[16]; int len; unsigned dummy; - s->read(hdr,16); - len = ddca_decode_header(hdr,&dummy,&dummy,&dummy); + bp=s->read(16); + len = ddca_decode_header((const uint8_t*)bp.data(),&dummy,&dummy,&dummy); MSG_DBG2("dca_fillbuffer %u bytes\n",len); if(s->eof()) return 0; /* workaround for dead-lock (skip(-7)) below */ if(len < 0) { @@ -487,8 +487,10 @@ { Demuxer_Packet* dp = new(zeromem) Demuxer_Packet(len); dp->resize(len+16); - memcpy(dp->buffer(),hdr,16); - len=s->read(dp->buffer()+16,len-16); + memcpy(dp->buffer(),bp.data(),16); + bp=s->read(len-16); + len=bp.size(); + memcpy(dp->buffer()+16,bp.data(),len); priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + len/(float)sh_audio->i_bps; dp->pts = priv->last_pts - (demux->audio->tell_pts()-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; dp->flags=DP_NONKEYFRAME; @@ -502,7 +504,6 @@ } static void high_res_ddca_seek(Demuxer *demuxer,float _time) { - uint8_t hdr[12]; int len,nf; unsigned tmp; dca_priv_t* priv = static_cast<dca_priv_t*>(demuxer->priv); @@ -510,9 +511,9 @@ nf = _time*sh->rate/1152; while(nf > 0) { - demuxer->stream->read(hdr,12); + binary_packet bp=demuxer->stream->read(12); MSG_DBG2("high_res_ddca_seek\n"); - len = ddca_decode_header(hdr,&tmp,&tmp,&tmp); + len = ddca_decode_header((const uint8_t*)bp.data(),&tmp,&tmp,&tmp); if(len < 0) { demuxer->stream->skip(-11); continue; Modified: mplayerxp/libmpdemux/demux_film.cpp =================================================================== --- mplayerxp/libmpdemux/demux_film.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_film.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -116,12 +116,14 @@ // load the chunks manually (instead of using ds_read_packet()), since // they require some adjustment // (all ones in syncinfo1 indicates an audio chunk) + binary_packet bp(1); if (film_chunk.syncinfo1 == 0xFFFFFFFF) { if(demuxer->audio->id>=-1){ // audio not disabled dp = new(zeromem) Demuxer_Packet(film_chunk.chunk_size); - if (demuxer->stream->read( dp->buffer(), film_chunk.chunk_size) != - film_chunk.chunk_size) return 0; + bp=demuxer->stream->read(film_chunk.chunk_size); + if(bp.size() != size_t(film_chunk.chunk_size)) return 0; + memcpy(dp->buffer(),bp.data(),bp.size()); dp->pts = film_chunk.pts; dp->pos = film_chunk.chunk_offset; dp->flags = DP_NONKEYFRAME; @@ -158,14 +160,14 @@ dp = new(zeromem) Demuxer_Packet(film_chunk.chunk_size - length_fix_bytes); // these CVID data chunks have a few extra bytes; skip them - if (demuxer->stream->read( dp->buffer(), 10) != 10) - return 0; + bp=demuxer->stream->read(10); + if (bp.size() != 10) return 0; + memcpy(dp->buffer(),bp.data(),bp.size()); demuxer->stream->skip( length_fix_bytes); - if (demuxer->stream->read( dp->buffer() + 10, - film_chunk.chunk_size - (10 + length_fix_bytes)) != - (film_chunk.chunk_size - (10 + length_fix_bytes))) - return 0; + bp=demuxer->stream->read(film_chunk.chunk_size - (10 + length_fix_bytes)); + if(bp.size()!=size_t(film_chunk.chunk_size - (10 + length_fix_bytes))) return 0; + memcpy(dp->buffer(),bp.data(),bp.size()); dp->pts = film_chunk.pts; dp->pos = film_chunk.chunk_offset; @@ -309,7 +311,7 @@ demuxer->audio->sh = sh_audio; sh_audio->ds = demuxer->audio; - sh_audio->wf = (WAVEFORMATEX *)mp_malloc(sizeof(WAVEFORMATEX)); + sh_audio->wf = new WAVEFORMATEX; // uncompressed PCM format sh_audio->wf->wFormatTag = 1; @@ -340,7 +342,7 @@ demuxer->audio->sh = sh_audio; sh_audio->ds = demuxer->audio; - sh_audio->wf = (WAVEFORMATEX *)mp_malloc(sizeof(WAVEFORMATEX)); + sh_audio->wf = new WAVEFORMATEX; // uncompressed PCM format sh_audio->wf->wFormatTag = 1; @@ -374,8 +376,7 @@ " STAB chunk contains %d chunks\n", film_data->total_chunks); // allocate enough entries for the chunk - film_data->chunks = - (film_chunk_t *)mp_malloc(film_data->total_chunks * sizeof(film_chunk_t)); + film_data->chunks =new film_chunk_t[film_data->total_chunks]; // build the chunk index counting_chunks = 1; Modified: mplayerxp/libmpdemux/demux_flac.cpp =================================================================== --- mplayerxp/libmpdemux/demux_flac.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_flac.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -45,17 +45,20 @@ static int flac_get_raw_id(Demuxer *demuxer,off_t fptr,unsigned *brate,unsigned *samplerate,unsigned *channels) { - uint32_t fcc,fcc1; - uint8_t *p,b[32]; + uint32_t fcc1; Stream *s; *brate=*samplerate=*channels=0; s = demuxer->stream; s->seek(fptr); - fcc=fcc1=s->read_dword(); + fcc1=s->read_dword(); fcc1=me2be_32(fcc1); - p = (uint8_t *)&fcc1; s->seek(fptr); - s->read(b,sizeof(b)); + binary_packet bp=s->read(32); +/* + s->samplerate = get_bits_long(&gb, 20); + s->channels = get_bits(&gb, 3) + 1; + s->bps = get_bits(&gb, 5) + 1; +*/ if(fcc1 == mmioFOURCC('f','L','a','C')) return 1; s->seek(fptr); return 0; @@ -92,13 +95,15 @@ s = demuxer->stream; s->reset(); s->seek(s->start_pos()); + binary_packet bp(1); while(n < 5 && !s->eof()) { st_pos = s->tell(); step = 1; if(pos < HDR_SIZE) { - s->read(&hdr[pos],HDR_SIZE-pos); + bp=s->read(HDR_SIZE-pos); + memcpy(&hdr[pos],bp.data(),bp.size()); pos = HDR_SIZE; } @@ -130,7 +135,9 @@ /* loop through the metadata blocks; use a do-while construct since there * will always be 1 metadata block */ do { - if(s->read(chunk,4)!=4) return NULL; + bp=s->read(4); + if(bp.size()!=4) return NULL; + memcpy(chunk,bp.data(),bp.size()); block_size=(chunk[1]<<16)|(chunk[2]<<8)|chunk[3]; switch (chunk[0] & 0x7F) { /* STREAMINFO */ @@ -139,13 +146,15 @@ char sinfo[block_size]; WAVEFORMATEX* w; unsigned long long int total_samples; - sh_audio->wf = w = (WAVEFORMATEX*)mp_mallocz(sizeof(WAVEFORMATEX)); + sh_audio->wf = w = new WAVEFORMATEX; MSG_V("STREAMINFO metadata\n"); if (block_size != 34) { MSG_V("expected STREAMINFO chunk of %d bytes\n",block_size); return 0; } - if(s->read(sinfo,block_size)!=(int)block_size) return NULL; + bp=s->read(block_size); + if(bp.size()!=(int)block_size) return NULL; + memcpy(sinfo,bp.data(),bp.size()); sh_audio->rate=be2me_32(*(uint32_t *)&sinfo[10]); sh_audio->nch=w->nChannels=((sh_audio->rate>>9)&0x07)+1; w->wBitsPerSample=((sh_audio->rate>>4)&0x1F)+1; @@ -229,7 +238,9 @@ } int l = sh_audio->wf->nAvgBytesPerSec; Demuxer_Packet* dp =new(zeromem) Demuxer_Packet(l); - l=s->read(dp->buffer(),l); + binary_packet bp = s->read(l); + l=bp.size(); + memcpy(dp->buffer(),bp.data(),bp.size()); dp->resize(l); priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + l/(float)sh_audio->i_bps; dp->pts = priv->last_pts - (demux->audio->tell_pts()-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; Modified: mplayerxp/libmpdemux/demux_fli.cpp =================================================================== --- mplayerxp/libmpdemux/demux_fli.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_fli.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -98,7 +98,8 @@ demuxer->stream->seek( 0); header = new unsigned char[sizeof(BITMAPINFOHEADER) + 128]; - demuxer->stream->read( header + sizeof(BITMAPINFOHEADER), 128); + binary_packet bp=demuxer->stream->read(128); + memcpy(header + sizeof(BITMAPINFOHEADER),bp.data(),bp.size()); demuxer->stream->seek( 0); demuxer->movi_start = 128; @@ -120,7 +121,7 @@ frames->current_frame = 0; // allocate enough entries for the indices - frames->filepos = (off_t *)mp_malloc(frames->num_frames * sizeof(off_t)); + frames->filepos = new off_t[frames->num_frames]; frames->frame_size = new unsigned int [frames->num_frames]; // create a new video stream header Modified: mplayerxp/libmpdemux/demux_lavf.cpp =================================================================== --- mplayerxp/libmpdemux/demux_lavf.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_lavf.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -133,10 +133,11 @@ if(stream->eof()) //needed? return -1; - ret=stream->read(buf, size); + binary_packet bp=stream->read(size); + memcpy(buf,bp.data(),bp.size()); - MSG_DBG2("%d=mp_read(%p, %p, %d), eof:%d\n", ret, stream, buf, size, stream->eof()); - return ret; + MSG_DBG2("%d=mp_read(%p, %p, %d), eof:%d\n", bp.size(), stream, buf, size, stream->eof()); + return bp.size(); } static int64_t mpxp_seek(any_t*opaque, int64_t pos, int whence){ @@ -193,10 +194,12 @@ else if(mp_conf.verbose) av_log_set_level(AV_LOG_VERBOSE); else av_log_set_level(AV_LOG_INFO); - if(demuxer->stream->read( buf, PROBE_BUF_SIZE)!=PROBE_BUF_SIZE) { + binary_packet bp=demuxer->stream->read(PROBE_BUF_SIZE); + if(bp.size()!=PROBE_BUF_SIZE) { delete demuxer->priv; return MPXP_False; } + memcpy(buf,bp.data(),bp.size()); avpd.filename= "xxx"; avpd.buf= buf; avpd.buf_size= PROBE_BUF_SIZE; Modified: mplayerxp/libmpdemux/demux_mkv.cpp =================================================================== --- mplayerxp/libmpdemux/demux_mkv.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_mkv.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -60,11 +60,11 @@ static const char* MKV_A_AAC_2MAIN ="A_AAC/MPEG2/MAIN"; static const char* MKV_A_AAC_2LC ="A_AAC/MPEG2/LC"; -static const char* MKV_A_AAC_2SBR ="A_AAC/MPEG2/LC/SBR"; +//static const char* MKV_A_AAC_2SBR ="A_AAC/MPEG2/LC/SBR"; static const char* MKV_A_AAC_2SSR ="A_AAC/MPEG2/SSR"; static const char* MKV_A_AAC_4MAIN ="A_AAC/MPEG4/MAIN"; static const char* MKV_A_AAC_4LC ="A_AAC/MPEG4/LC"; -static const char* MKV_A_AAC_4SBR ="A_AAC/MPEG4/LC/SBR"; +//static const char* MKV_A_AAC_4SBR ="A_AAC/MPEG4/LC/SBR"; static const char* MKV_A_AAC_4SSR ="A_AAC/MPEG4/SSR"; static const char* MKV_A_AAC_4LTP ="A_AAC/MPEG4/LTP"; static const char* MKV_A_AAC ="A_AAC"; @@ -91,11 +91,11 @@ static const char* MKV_V_REALV20 ="V_REAL/RV20"; static const char* MKV_V_REALV30 ="V_REAL/RV30"; static const char* MKV_V_REALV40 ="V_REAL/RV40"; -static const char* MKV_V_SORENSONV1 ="V_SORENSON/V1"; -static const char* MKV_V_SORENSONV2 ="V_SORENSON/V2"; -static const char* MKV_V_SORENSONV3 ="V_SORENSON/V3"; -static const char* MKV_V_CINEPAK ="V_CINEPAK"; -static const char* MKV_V_QUICKTIME ="V_QUICKTIME"; +//static const char* MKV_V_SORENSONV1 ="V_SORENSON/V1"; +//static const char* MKV_V_SORENSONV2 ="V_SORENSON/V2"; +//static const char* MKV_V_SORENSONV3 ="V_SORENSON/V3"; +//static const char* MKV_V_CINEPAK ="V_CINEPAK"; +//static const char* MKV_V_QUICKTIME ="V_QUICKTIME"; static const char* MKV_V_MPEG1 ="V_MPEG1"; static const char* MKV_V_MPEG2 ="V_MPEG2"; static const char* MKV_V_MPEG4_SP ="V_MPEG4/ISO/SP"; @@ -286,8 +286,9 @@ case 10: { union {uint8_t data[10]; long double ld;} u; - if (s->read( u.data, 10) != 10) - return EBML_FLOAT_INVALID; + binary_packet bp=s->read(10); + if(bp.size()!=10) return EBML_FLOAT_INVALID; + memcpy(u.data, bp.data(),bp.size()); value = be2me_ldbl(u.ld); break; } @@ -318,12 +319,10 @@ if (length) *length = len + l; - str = (char *) mp_malloc (len+1); - if (s->read( str, len) != (int) len) - { - delete str; - return NULL; - } + binary_packet bp = s->read(len); + if(bp.size()!=len) return NULL; + str = new char[len+1]; + memcpy(str,bp.data(),bp.size()); str[len] = '\0'; return str; @@ -695,7 +694,8 @@ static mkv_track_t * demux_mkv_find_track_by_num (mkv_demuxer_t *d, int n, int type) { - int i, id; + int id; + unsigned i; for (i=0, id=0; i < d->num_tracks; i++) if (d->tracks[i] != NULL && d->tracks[i]->type == type) @@ -708,7 +708,8 @@ static mkv_track_t * demux_mkv_find_track_by_language (mkv_demuxer_t *d,const char *language, int type) { - int i, len; + int len; + unsigned i; language += strspn(language,","); while((len = strcspn(language,",")) > 0) @@ -890,12 +891,12 @@ void mkv_demuxer_t::free_cached_dps () { mkv_track_t *track; - int i, k; + unsigned i, k; for (k = 0; k < num_tracks; k++) { track = tracks[k]; - for (i = 0; i < track->num_cached_dps; i++) delete track->cached_dps[i]; + for (i = 0; i < unsigned(track->num_cached_dps); i++) delete track->cached_dps[i]; delete track->cached_dps; track->cached_dps = NULL; track->num_cached_dps = 0; @@ -1118,6 +1119,7 @@ mkv_content_encoding_t *ce, e; uint64_t len, length, l; int il, n; + binary_packet bp(1); ce = new mkv_content_encoding_t; n = 0; @@ -1130,7 +1132,6 @@ { case MATROSKA_ID_CONTENTENCODING: { - uint64_t len; int i; memset (&e, 0, sizeof (e)); @@ -1191,7 +1192,8 @@ case MATROSKA_ID_CONTENTCOMPSETTINGS: l = ebml_read_length (s, &i); e.comp_settings = new uint8_t[l]; - s->read( e.comp_settings, l); + bp=s->read(l); + memcpy(e.comp_settings,bp.data(),bp.size()); e.comp_settings_len = l; l += i; break; @@ -1408,6 +1410,7 @@ mkv_track_t *track; uint64_t len, length, l; int il; + binary_packet bp(1); track = new mkv_track_t; /* set default values */ @@ -1515,8 +1518,9 @@ if (num > std::numeric_limits<size_t>::max() - 1000) return 0; l = x + num; track->private_data = mp_malloc (num + LZO_INPUT_PADDING); - if (s->read( track->private_data, num) != (int) num) - goto err_out; + bp=s->read(num); + if (bp.size() != num) goto err_out; + memcpy(track->private_data,bp.data(),bp.size()); track->private_size = num; MSG_V( "[mkv] | + CodecPrivate, length " "%u\n", track->private_size); @@ -1943,11 +1947,12 @@ l = x + num; delete data; data = new char [num]; - if (s->read( data, num) != (int) num) - { + binary_packet bp=s->read(num); + if(bp.size() != num) { delete data; return 0; } + memcpy(data,bp.data(),bp.size()); data_size = num; MSG_V( "[mkv] | + FileData, length " "%u\n", data_size); @@ -2128,7 +2133,8 @@ display_create_tracks (Demuxer *demuxer) { mkv_demuxer_t *mkv_d = static_cast<mkv_demuxer_t*>(demuxer->priv); - int i, vid=0, aid=0, sid=0; + int vid=0, aid=0, sid=0; + unsigned i; for (i=0; i<mkv_d->num_tracks; i++) { @@ -2259,7 +2265,8 @@ // copy type1 and type2 info from rv properties memcpy(dst, &type1, 4); memcpy(dst+4, &type2, 4); - demuxer->stream->read( dst+8, cnt); + binary_packet bp=demuxer->stream->read(cnt); + memcpy(dst+8,bp.data(),bp.size()); track->realmedia = 1; #ifdef USE_QTX_CODECS @@ -2672,7 +2679,7 @@ { mkv_demuxer_t *mkv_d = static_cast<mkv_demuxer_t*>(demuxer->priv); mkv_track_t *track; - int i, m; + unsigned i, m; unsigned size; uint8_t *buffer; @@ -2774,7 +2781,8 @@ */ static int demux_mkv_reverse_id(mkv_demuxer_t *d, int num, int type) { - int i, id; + int id; + unsigned i; for (i=0, id=0; i < d->num_tracks; i++) if (d->tracks[i] != NULL && d->tracks[i]->type == type) { @@ -2806,7 +2814,8 @@ Stream *s = demuxer->stream; mkv_demuxer_t *mkv_d; mkv_track_t *track; - int i, version, cont = 0; + int version, cont = 0; + unsigned i; char *str; s->seek( s->start_pos()); @@ -3031,7 +3040,7 @@ if (mkv_d->chapters) { - for (i=0; i < (int)mkv_d->num_chapters; i++) + for (i=0; i < mkv_d->num_chapters; i++) { mkv_d->chapters[i].start -= mkv_d->first_tc; mkv_d->chapters[i].end -= mkv_d->first_tc; @@ -3674,6 +3683,7 @@ Stream *s = demuxer->stream; uint64_t l; int il, tmp; + binary_packet bp(1); while (1) { @@ -3704,11 +3714,12 @@ if (block_length > std::numeric_limits<size_t>::max()- LZO_INPUT_PADDING) return 0; block = new uint8_t[block_length + LZO_INPUT_PADDING]; demuxer->filepos = s->tell(); - if (s->read(block,block_length) != (int) block_length) - { + bp=s->read(block_length); + if (bp.size() != block_length) { delete block; return 0; } + memcpy(block,bp.data(),bp.size()); l = tmp + block_length; break; @@ -3778,11 +3789,12 @@ block_length = ebml_read_length (s, &tmp); block = new uint8_t[block_length]; demuxer->filepos = s->tell(); - if (s->read(block,block_length) != (int) block_length) - { + bp=s->read(block_length); + if (bp.size() != block_length) { delete block; return 0; } + memcpy(block,bp.data(),bp.size()); l = tmp + block_length; res = handle_block (demuxer, block, block_length, block_duration, block_bref, block_fref, 1); Modified: mplayerxp/libmpdemux/demux_mov.cpp =================================================================== --- mplayerxp/libmpdemux/demux_mov.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_mov.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -599,6 +599,7 @@ off_t pos, off_t len, mov_track_t* trak); static void lschunks(Demuxer* demuxer,int level,off_t endpos,mov_track_t* trak){ + binary_packet bp(1); mov_priv_t* priv=static_cast<mov_priv_t*>(demuxer->priv); while(1){ off_t pos; @@ -907,7 +908,7 @@ if(!is_vorbis) { sh->codecdata_len = esds.decoderConfigLen; - sh->codecdata = (unsigned char *)mp_malloc(sh->codecdata_len); + sh->codecdata = new uint8_t[sh->codecdata_len]; memcpy(sh->codecdata, esds.decoderConfig, sh->codecdata_len); } } @@ -920,7 +921,7 @@ if(atom_len > 8) { // copy all the atom (not only payload) for lavc alac decoder sh->codecdata_len = atom_len; - sh->codecdata = (unsigned char *)mp_malloc(sh->codecdata_len); + sh->codecdata = new uint8_t[sh->codecdata_len]; memcpy(sh->codecdata, &trak->stdata[28], sh->codecdata_len); } } break; @@ -1086,7 +1087,7 @@ // dump away the codec specific configuration for the AAC decoder trak->stream_header_len = esds.decoderConfigLen; - trak->stream_header = (unsigned char *)mp_malloc(trak->stream_header_len); + trak->stream_header = new uint8_t[trak->stream_header_len]; memcpy(trak->stream_header, esds.decoderConfig, trak->stream_header_len); } mp4_free_esds(&esds); // freeup esds mem @@ -1122,7 +1123,7 @@ // Copy avcC for the AVC decoder // This data will be put in extradata below, where BITMAPINFOHEADER is created trak->stream_header_len = atom_len-8; - trak->stream_header = (unsigned char *)mp_malloc(trak->stream_header_len); + trak->stream_header = new uint8_t[trak->stream_header_len]; memcpy(trak->stream_header, trak->stdata+pos+8, trak->stream_header_len); } break; @@ -1336,7 +1337,8 @@ } MSG_V( "Compressed header size: %d / %d\n",cmov_sz,moov_sz); - demuxer->stream->read(cmov_buf,cmov_sz); + bp=demuxer->stream->read(cmov_sz); + memcpy(cmov_buf,bp.data(),bp.size()); zstrm.zalloc = (alloc_func)0; zstrm.zfree = (free_func)0; @@ -1406,7 +1408,8 @@ { off_t text_len = demuxer->stream->read_word(); char text[text_len+2+1]; - demuxer->stream->read( (char *)&text, text_len+2); + bp=demuxer->stream->read(text_len+2); + memcpy(&text,bp.data(),bp.size()); text[text_len+2] = 0x0; switch(udta_id) { @@ -1472,7 +1475,8 @@ udta_len=udta_size; { char dump[udta_len-4]; - demuxer->stream->read( (char *)&dump, udta_len-4-4); + bp=demuxer->stream->read( udta_len-4-4); + memcpy(&dump,bp.data(),bp.size()); udta_size -= udta_len; } } @@ -1495,6 +1499,7 @@ static int lschunks_intrak(Demuxer* demuxer, int level, unsigned int id, off_t pos, off_t len, mov_track_t* trak) { + binary_packet bp(1); switch(id) { case MOV_FOURCC('m','d','a','t'): { MSG_WARN("Hmm, strange MOV, parsing mdat in lschunks?\n"); @@ -1509,7 +1514,8 @@ // read codec data trak->tkdata_len = len; trak->tkdata = new unsigned char [trak->tkdata_len]; - demuxer->stream->read( trak->tkdata, trak->tkdata_len); + bp=demuxer->stream->read(trak->tkdata_len); + memcpy(trak->tkdata,bp.data(),bp.size()); /* 0 1 Version 1 3 Flags @@ -1557,7 +1563,8 @@ /*unsigned int comp_mask =*/ demuxer->stream->read_dword(); unsigned _len = demuxer->stream->read_char(); char* str = new char [_len + 1]; - demuxer->stream->read( str, _len); + bp=demuxer->stream->read(_len); + memcpy(str,bp.data(),bp.size()); str[_len] = 0; MSG_V( "MOV: %*sHandler header: %.4s/%.4s (%.4s) %s\n", level, "", &type, &subtype, &manufact, str); @@ -1623,7 +1630,8 @@ // NOTE: trak type is not yet known at this point :((( trak->stdata_len = _len - 8; trak->stdata = new unsigned char [trak->stdata_len]; - demuxer->stream->read( trak->stdata, trak->stdata_len); + bp=demuxer->stream->read(trak->stdata_len); + memcpy(trak->stdata,bp.data(),bp.size()); } if (!demuxer->stream->seek( _pos + _len)) break; @@ -1880,7 +1888,8 @@ char buf2[newlen]; len-=4; - demuxer->stream->read( buf, len); + bp=demuxer->stream->read(len); + memcpy(buf,bp.data().bp.size()); zstrm.zalloc = (alloc_func)0; zstrm.zfree = (free_func)0; @@ -1903,7 +1912,8 @@ } { #endif - demuxer->stream->read( buf, len); + bp=demuxer->stream->read(len); + memcpy(buf,bp.data(),bp.size()); write(fd, buf, len); } close(fd); @@ -2010,7 +2020,8 @@ memcpy(dp->buffer(),trak->stream_header,trak->stream_header_len); dp->pos=demuxer->stream->tell()-trak->stream_header_len; dp->resize(x+trak->stream_header_len); - x=demuxer->stream->read(dp->buffer()+trak->stream_header_len,x); + binary_packet bp=demuxer->stream->read(x); + memcpy(dp->buffer()+trak->stream_header_len,bp.data(),bp.size()); delete trak->stream_header; trak->stream_header = NULL; trak->stream_header_len = 0; Modified: mplayerxp/libmpdemux/demux_mp3.cpp =================================================================== --- mplayerxp/libmpdemux/demux_mp3.cpp 2013-06-04 17:51:34 UTC (rev 648) +++ mplayerxp/libmpdemux/demux_mp3.cpp 2013-06-08 14:04:10 UTC (rev 649) @@ -56,7 +56,7 @@ off_t spos; while(!demuxer->stream->eof()) { spos=demuxer->stream->tell(); - demuxer->stream->read(hdr,4); + binary_packet bp=demuxer->stream->read(4); memcpy(hdr,bp.data(),bp.size()); len = mp_decode_mp3_header(hdr,NULL,NULL,NULL,NULL); if(len < 0) { demuxer->stream->skip(-3); @@ -72,6 +72,7 @@ { unsigned n; Stream *s=demuxer->stream; + binary_packet bp(1); for(n = 0; n < 5 ; n++) { MSG_DBG2("read_mp3v1_tags\n"); pos = mp_decode_mp3_header(hdr,NULL,NULL,NULL,NULL); @@ -80,14 +81,14 @@ s->skip(pos-4); if(s->eof()) return 0; - s->read(hdr,4); + bp=s->read(4); memcpy(hdr,bp.data(),bp.size()); if(s->eof()) return 0; } if(s->end_pos()) { char tag[4]; s->seek(s->end_pos()-128); - s->read(tag,3); + bp=s->read(3); memcpy(tag,bp.data(),bp.size()); tag[3] = '\0'; if(strcmp(tag,"TAG")) demuxer->movi_end = s->end_pos(); @@ -95,19 +96,19 @@ char buf[31]; uint8_t g; demuxer->movi_end = s->tell()-3; - s->read(buf,30); + bp=s->read(30); memcpy(buf,bp.data(),bp.size()); buf[30] = '\0'; demuxer->info().add(INFOT_NAME,buf); - s->read(buf,30); + bp=s->read(30); memcpy(buf,bp.data(),bp.size()); buf[30] = '\0'; demuxer->info().add(INFOT_AUTHOR,buf); - s->read(buf,30); + bp=s->read(30); memcpy(buf,bp.data(),bp.size()); buf[30] = '\0'; demuxer->info().add(INFOT_ALBUM,buf); - s->read(buf,4); + bp=s->read(4); memcpy(buf,bp.data(),bp.size()); buf[4] = '\0'; demuxer->info().add(INFOT_DATE,buf); - s->read(buf,30); + bp=s->read(30); memcpy(buf,bp.data(),bp.size()); buf[30] = '\0'; demuxer->info().add(INFOT_COMMENTS,buf); if(buf[28] == 0 && buf[29] != 0) { @@ -143,6 +144,7 @@ { off_t pos,epos; Stream *s=demuxer->stream; + binary_packet bp(1); if( flags==ID3V22_ZERO_FLAG || flags==ID3V22_UNSYNCH_FLAG || flags==ID3V22_COMPRESS_FLAG) return 0; @@ -154,10 +156,12 @@ unsigned len; unsigned char buf[ID3V22_FRAME_HEADER_SIZE]; char data[4096]; - s->read(buf,ID3V22_FRAME_HEADER_SIZE); + bp=s->read(ID3V22_FRAME_HEADER_SIZE); + memcpy(buf,bp.data(),bp.size()); id=(buf[2] << 16) + (buf[1] << 8) + buf[0]; len=(buf[3] << 14) + (buf[4] << 7) + buf[5]; - s->read(data,std::min(len,unsigned(4096))); + bp=s->read(std::min(len,unsigned(4096))); + memcpy(data,bp.data(),bp.size()); data[std::min(len,unsigned(4096))]=0; switch(id) { @@ -212,13 +216,15 @@ { off_t pos,epos; Stream *s=demuxer->stream; + binary_packet bp(1); if( flags==ID3V23_ZERO_FLAG || flags==ID3V23_UNSYNCH_FLAG) return 0; if( flags==ID3V23_EXT_HEADER_FLAG ) { char buf[4]; unsigned ehsize; - demuxer->stream->read(buf,4); + bp=demuxer->stream->read(4); + memcpy(buf,bp.data(),bp.size()); ehsize=(buf[0] << 21) + (buf[1] << 14) + (buf[2] << 7) + buf[3]; demuxer->stream->skip(ehsize); } @@ -230,10 +236,12 @@ unsigned len; unsigned char buf[ID3V23_FRAME_HEADER_SIZE]; char data[4096]; - s->read(buf,ID3V23_FRAME_HEADER_SIZE); + bp=s->read(ID3V23_FRAME_HEADER_SIZE); + memcpy(buf,bp.data(),bp.size()); id=*((uint32_t *)buf); len=(buf[4] << 21) + (buf[5] << 14) + (buf[6] << 7) + buf[7]; - s->read(data,std::min(len,unsigned(4096))); + bp=s->read(std::min(len,unsigned(4096))); + memcpy(data,bp.data(),bp.size()); data[std::min(len,unsigned(4096))]=0; MSG_V("ID3: %4s len %u\n",buf,len); switch(id) @@ -292,13 +300,16 @@ { off_t pos,epos; Stream *s=demuxer->stream; + binary_packet bp(1); + if( flags==ID3V24_ZERO_FLAG || flags==ID3V24_UNSYNCH_FLAG) return 0; if( flags==ID3V24_EXT_HEADER_FLAG ) { char buf[4]; unsigned ehsize; - demuxer->stream->read(buf,4); + bp=demuxer->stream->read(4); + memcpy(buf,bp.data(),bp.size()); ehsize=(buf[0] << 21) + (buf[1] << 14) + (buf[2] << 7) + buf[3]; demuxer->stream->skip(ehsize); } @@ -310,10 +321,13 @@ unsigned len; unsigned char buf[ID3V23_FRAME_HEADER_SIZE]; char data[4096]; - s->read(buf,ID3V23_FRAME_HEADER_SIZE); + binary_packet bp(1); + bp=s->read(ID3V23_FRAME_HEADER_SIZE); + memcpy(buf,bp.data(),bp.size()); id=*((uint32_t *)buf); len=(buf[4] << 21) + (buf[5] << 14) + (buf[6] << 7) + buf[7]; - s->read(data,std::min(len,unsigned(4096))); + bp=s->read(std::min(len,unsigned(4096))); + memcpy(data,bp.data(),bp.size()); data[std::min(len,unsigned(4096))]=0; MSG_V("ID3: %4s len %u\n",buf,len); switch(id) @@ -352,7 +366,8 @@ vers=s->read_char(); rev=s->read_char(); flags=s->read_char(); - s->read(buf,4); + binary_packet bp=s->read(4); + memcpy(buf,bp.data(),bp.size()); hsize=(buf[0] << 21) + (buf[1] << 14) + (buf[2] << 7) + buf[3]; MSG_V("Found ID3v2.%d.%d flags %d size %d\n",vers,rev,flags,hsize); if(vers==2) return read_id3v22_tags(demuxer,flags,hsize); @@ -368,7 +383,7 @@ { int retval=0; uint32_t fcc,fcc1,fmt; - uint8_t *p,b[32]; + uint8_t *p; Stream *s; *brate=*samplerate=*channels=0; s = demuxer->stream; @@ -377,7 +392,7 @@ fcc1=me2be_32(fcc1); p = (uint8_t *)&fcc1; s->seek(fptr); - s->read(b,sizeof(b)); + binary_packet bp=s->read(32); if(mp_check_mp3_header(fcc1,&fmt,brate,samplerate,channels)) { if(fmt==1) retval = RAW_MP1; else... [truncated message content] |
From: <nic...@us...> - 2013-06-04 17:51:38
|
Revision: 648 http://sourceforge.net/p/mplayerxp/code/648 Author: nickols_k Date: 2013-06-04 17:51:34 +0000 (Tue, 04 Jun 2013) Log Message: ----------- sync with beye Modified Paths: -------------- TODO functions lavc/doc/examples/pc-uninstalled/libavcodec.pc lavc/doc/examples/pc-uninstalled/libavformat.pc mplayerxp/osdep/mp_malloc.cpp Modified: TODO =================================================================== --- TODO 2013-05-26 12:22:56 UTC (rev 647) +++ TODO 2013-06-04 17:51:34 UTC (rev 648) @@ -1,5 +1,6 @@ TODO for mplayerxp: + - remove m_config_t from libplaytree: implement config independed container - Implement libmpdemux3: class Demuxer_Driver { Modified: functions =================================================================== --- functions 2013-05-26 12:22:56 UTC (rev 647) +++ functions 2013-06-04 17:51:34 UTC (rev 648) @@ -978,9 +978,6 @@ ( check_cmd $cc $CFLAGS $inc_extra $ld_static $ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1 TMP="$?" echo >> "$TMPLOG" - echo "ldd $TMPO" >> "$TMPLOG" - ( ldd "$TMPO" ) >> "$TMPLOG" 2>&1 - echo >> "$TMPLOG" return "$TMP" } @@ -991,9 +988,6 @@ ( check_cmd $cxx $CXXFLAGS $inc_extra $ld_static $ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1 TMP="$?" echo >> "$TMPLOG" - echo "ldd $TMPO" >> "$TMPLOG" - ( ldd "$TMPO" ) >> "$TMPLOG" 2>&1 - echo >> "$TMPLOG" return "$TMP" } Modified: lavc/doc/examples/pc-uninstalled/libavcodec.pc =================================================================== --- lavc/doc/examples/pc-uninstalled/libavcodec.pc 2013-05-26 12:22:56 UTC (rev 647) +++ lavc/doc/examples/pc-uninstalled/libavcodec.pc 2013-06-04 17:51:34 UTC (rev 648) @@ -8,5 +8,5 @@ Version: 54.59.100 Requires: libavutil = 51.73.101 Conflicts: -Libs: -L${libdir} -lavcodec64 -ljack -lasound -Wl,-rpath,/usr/X11/lib64 -L/usr/X11/lib64 -lSDL -lpthread -lm -pthread -lbz2 -lz -lrt +Libs: -L${libdir} -lavcodec64 -lasound -lm -pthread -lbz2 -lz Cflags: -I${includedir} Modified: lavc/doc/examples/pc-uninstalled/libavformat.pc =================================================================== --- lavc/doc/examples/pc-uninstalled/libavformat.pc 2013-05-26 12:22:56 UTC (rev 647) +++ lavc/doc/examples/pc-uninstalled/libavformat.pc 2013-06-04 17:51:34 UTC (rev 648) @@ -8,5 +8,5 @@ Version: 54.29.104 Requires: libavcodec = 54.59.100 Conflicts: -Libs: -L${libdir} -lavformat64 -ljack -lasound -Wl,-rpath,/usr/X11/lib64 -L/usr/X11/lib64 -lSDL -lpthread -lm -pthread -lbz2 -lz -lrt +Libs: -L${libdir} -lavformat64 -lasound -lm -pthread -lbz2 -lz Cflags: -I${includedir} Modified: mplayerxp/osdep/mp_malloc.cpp =================================================================== --- mplayerxp/osdep/mp_malloc.cpp 2013-05-26 12:22:56 UTC (rev 647) +++ mplayerxp/osdep/mp_malloc.cpp 2013-06-04 17:51:34 UTC (rev 648) @@ -573,19 +573,19 @@ any_t* operator new(size_t size) throw(std::bad_alloc) { any_t* rc; rc=SECURE_NAME0(_mp_malloc)(size); - if(!rc) throw std::runtime_error("Memory allocation failed"); + if(!rc) { std::bad_alloc ba; throw ba; } return rc; } any_t* operator new(size_t size,const zeromemory_t&) { any_t* rc; rc=SECURE_NAME1(_mp_mallocz)(size); - if(!rc) throw std::runtime_error("Memory allocation failed"); + if(!rc) { std::bad_alloc ba; throw ba; } return rc; } any_t* operator new(size_t size,const alignedmemory_t&,size_t boundary) { any_t* rc; rc=SECURE_NAME2(_mp_memalign)(boundary,size); - if(!rc) throw std::runtime_error("Memory allocation failed"); + if(!rc) { std::bad_alloc ba; throw ba; } return rc; } any_t* operator new(size_t size,const std::nothrow_t&) { return mp_malloc(size); } @@ -593,19 +593,19 @@ any_t* operator new[](size_t size) throw(std::bad_alloc) { any_t* rc; rc=SECURE_NAME0(_mp_malloc)(size); - if(!rc) throw std::runtime_error("Memory allocation failed"); + if(!rc) { std::bad_alloc ba; throw ba; } return rc; } any_t* operator new[](size_t size,const zeromemory_t&) { any_t* rc; rc=SECURE_NAME1(_mp_mallocz)(size); - if(!rc) throw std::runtime_error("Memory allocation failed"); + if(!rc) { std::bad_alloc ba; throw ba; } return rc; } any_t* operator new[](size_t size,const alignedmemory_t&,size_t boundary) { any_t* rc; rc=SECURE_NAME2(_mp_memalign)(boundary,size); - if(!rc) throw std::runtime_error("Memory allocation failed"); + if(!rc) { std::bad_alloc ba; throw ba; } return rc; } any_t* operator new[](size_t size,const std::nothrow_t&) { return mp_malloc(size); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-26 12:23:00
|
Revision: 647 http://sourceforge.net/p/mplayerxp/code/647 Author: nickols_k Date: 2013-05-26 12:22:56 +0000 (Sun, 26 May 2013) Log Message: ----------- use throw technique Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/libmpcodecs/ad_twin.cpp mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libmpstream2/librtsp/rtsp.cpp mplayerxp/libmpstream2/realrtsp/sdpplin.cpp mplayerxp/libvo2/vidix_system.cpp mplayerxp/libvo2/vo_fbdev.cpp mplayerxp/libvo2/vo_sdl.cpp mplayerxp/libvo2/vo_vesa.cpp mplayerxp/libvo2/vo_x11.cpp mplayerxp/libvo2/vo_xv.cpp mplayerxp/libvo2/x11_system.cpp mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/osdep/cpudetect.cpp mplayerxp/osdep/cpudetect.h mplayerxp/osdep/mp_malloc.cpp mplayerxp/postproc/libmenu/menu_console.cpp mplayerxp/postproc/postprocess.cpp mplayerxp/postproc/vf.cpp mplayerxp/xmpcore/xmp_vdecoder.cpp Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/dump.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -6,6 +6,7 @@ */ #include <iostream> #include <fstream> +#include <stdexcept> #include <stdio.h> #include <stdlib.h> @@ -60,7 +61,7 @@ f.open(name,std::ios_base::out|std::ios_base::binary); if(!f.is_open()){ MSG_FATAL(MSGTR_CantOpenDumpfile); - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } MSG_INFO("Dumping stream to %s\n",name); while(!stream->eof()){ @@ -69,7 +70,7 @@ } f.close(); mpxp_info<<MSGTR_StreamDumped<<std::endl; - exit_player(MSGTR_Exit_eof); + throw std::runtime_error(MSGTR_Exit_eof); } enum { @@ -140,17 +141,17 @@ else if(strcmp(media,"raw") == 0) strcat(stream_dump_name,"dump.raw"); else { MSG_FATAL("Unsupported muxer format %s found\n",media); - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } priv->mux_file.open(stream_dump_name,std::ios_base::out|std::ios_base::binary); MSG_DBG2("Preparing stream dumping: %s\n",stream_dump_name); if(!priv->mux_file.is_open()){ MSG_FATAL(MSGTR_CantOpenDumpfile); - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } if(!(priv->muxer=muxer_new_muxer(media,port,priv->mux_file))) { MSG_FATAL("Can't initialize muxer\n"); - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } if(sha && (priv->mux_type&MUX_HAVE_AUDIO)) { priv->m_audio=muxer_new_stream(priv->muxer,MUXER_TYPE_AUDIO); Modified: mplayerxp/libmpcodecs/ad_twin.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_twin.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libmpcodecs/ad_twin.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -1,6 +1,8 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <stdexcept> + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -426,11 +428,8 @@ char tmpbit[BITS_INT]; int retval; - if ( nbits > BITS_INT ){ - MSG_ERR( "get_bstm(): %d: %d Error.\n", - nbits, BITS_INT); - exit(1); - } + if ( nbits > BITS_INT ) throw std::runtime_error("get_bstm(): falied"); + retval = bread(tmpbit, sizeof(*tmpbit), nbits, priv, pts ); for (ibit=retval; ibit<nbits; ibit++){ tmpbit[ibit] = 0; Modified: mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -3120,22 +3120,16 @@ void RTjpeg_init_mcompress(void) { - unsigned long tmp; + unsigned long tmp; - if(!RTjpeg_old) - { - RTjpeg_old=(__s16*)mp_malloc((4*RTjpeg_width*RTjpeg_height)+32); - tmp=(unsigned long)RTjpeg_old; - tmp+=32; - tmp=tmp>>5; - RTjpeg_old=(__s16 *)(tmp<<5); - } - if (!RTjpeg_old) - { - fprintf(stderr, "RTjpeg: Could not allocate memory\n"); - exit(-1); - } - bzero(RTjpeg_old, ((4*RTjpeg_width*RTjpeg_height))); + if(!RTjpeg_old) { + RTjpeg_old=new __s16[(4*RTjpeg_width*RTjpeg_height)+32]; + tmp=(unsigned long)RTjpeg_old; + tmp+=32; + tmp=tmp>>5; + RTjpeg_old=(__s16 *)(tmp<<5); + } + bzero(RTjpeg_old, ((4*RTjpeg_width*RTjpeg_height))); } #ifdef MMX Modified: mplayerxp/libmpcodecs/vd_real.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_real.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libmpcodecs/vd_real.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -1,6 +1,8 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <stdexcept> + #include <stdio.h> #include <stdlib.h> #include <inttypes.h> @@ -83,8 +85,7 @@ void __pure_virtual(void) { - MSG_ERR( "I'm outa here!\n"); - exit(1); + throw std::runtime_error( "I'm outa here!\n"); } #endif struct vreal_private_t : public Opaque { Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -12,6 +12,7 @@ #include <limits> #include <iostream> #include <fstream> +#include <stdexcept> #include <stdlib.h> #include <stdio.h> @@ -883,7 +884,7 @@ ::write(conffile_fd, default_config, strlen(default_config)); ::close(conffile_fd); } - if (parse_config_file(conffile) != MPXP_Ok) ::exit(1); + if (parse_config_file(conffile) != MPXP_Ok) throw std::runtime_error("Error in config file"); } } Modified: mplayerxp/libmpstream2/librtsp/rtsp.cpp =================================================================== --- mplayerxp/libmpstream2/librtsp/rtsp.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libmpstream2/librtsp/rtsp.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -31,6 +31,7 @@ * 2006, Benjamin Zores and Vincent Mussard * fixed a lot of RFC compliance issues. */ +#include <stdexcept> #include <unistd.h> #include <stdio.h> @@ -178,10 +179,8 @@ n++; } - if (n>=BUF_SIZE) { - mpxp_fatal<<"librtsp: buffer overflow in rtsp_get"<<std::endl; - exit(1); - } + if (n>=BUF_SIZE) throw std::runtime_error("librtsp: buffer overflow in rtsp_get"); + string=new char [n]; memcpy(string,buffer,n-1); string[n-1]=0; Modified: mplayerxp/libmpstream2/realrtsp/sdpplin.cpp =================================================================== --- mplayerxp/libmpstream2/realrtsp/sdpplin.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libmpstream2/realrtsp/sdpplin.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -76,7 +76,6 @@ if (dtable[c] & 0x80) { mpxp_info<<"Illegal character '"<<c<<"' in input"<<std::endl; -// exit(1); return NULL; } a[i] = (char) c; Modified: mplayerxp/libvo2/vidix_system.cpp =================================================================== --- mplayerxp/libvo2/vidix_system.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/vidix_system.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -13,6 +13,7 @@ * (Partly based on vesa_lvo.c from mplayer's package) */ #include <iomanip> +#include <stdexcept> #include <errno.h> #include <inttypes.h> @@ -51,15 +52,15 @@ mpxp_dbg2<<"vidix_preinit("<<drvname<<") was called"<<std::endl; if(vidix->version() != VIDIX_VERSION) { mpxp_fatal<<"You have wrong version of VIDIX library"<<std::endl; - exit_player("Vidix"); + throw std::runtime_error("Vidix"); } if(vidix->is_error()) { mpxp_fatal<<"Couldn't find working VIDIX driver"<<std::endl; - exit_player("Vidix"); + throw std::runtime_error("Vidix"); } if((err=vidix->get_capabilities()) != 0) { mpxp_fatal<<"Couldn't get capability: "<<strerror(err)<<std::endl; - exit_player("Vidix"); + throw std::runtime_error("Vidix"); } else mpxp_v<<"Driver capability: "<<std::hex<<vidix->cap.flags<<std::endl; mpxp_v<<"Using: "<<vidix->cap.name<<" by "<<vidix->cap.author<<std::endl; @@ -152,9 +153,8 @@ err=vidix->dma_copy_frame(); if(err) { /* We can switch back to DR here but for now exit */ - mpxp_fatal<<"error '"<<strerror(err)<<"' occured during DMA transfer"<<std::endl; mpxp_fatal<<"Please send BUGREPORT to developers!!!"<<std::endl; - exit(EXIT_FAILURE); /* it's OK vidix_term will be called */ + throw std::runtime_error(std::string("error '")+strerror(err)+"' occured during DMA transfer"); } #if 0 mpxp_info<<"frame is DMA copied"<<std::endl; Modified: mplayerxp/libvo2/vo_fbdev.cpp =================================================================== --- mplayerxp/libvo2/vo_fbdev.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/vo_fbdev.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -10,6 +10,7 @@ */ #include <iostream> #include <fstream> +#include <stdexcept> static const char* FBDEV= "fbdev: "; @@ -306,11 +307,11 @@ if(!vidix_name.empty()) { if(!(vidix=new(zeromem) Vidix_System(vidix_name))) { mpxp_err<<"Cannot initialze vidix with '"<<vidix_name<<"' argument"<<std::endl; - exit_player("Vidix error"); + throw std::runtime_error("Vidix error"); } } #endif - if(fb_preinit()!=MPXP_Ok) exit_player("FBDev preinit"); + if(fb_preinit()!=MPXP_Ok) throw std::runtime_error("FBDev preinit"); } int FBDev_VO_Interface::get_token(std::ifstream& fp,int num) Modified: mplayerxp/libvo2/vo_sdl.cpp =================================================================== --- mplayerxp/libvo2/vo_sdl.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/vo_sdl.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -93,6 +93,7 @@ * */ #include <algorithm> +#include <stdexcept> /* define to force software-surface (video surface stored in system memory)*/ #undef SDL_NOHWSURFACE @@ -278,7 +279,7 @@ if(!vidix_name.empty()) { if(!(vidix=new(zeromem) Vidix_System(vidix_name))) { mpxp_err<<"Cannot initialze vidix with '"<<vidix_name<<"' argument"<<std::endl; - exit_player("Vidix error"); + throw std::runtime_error("Vidix error"); } } #endif @@ -343,7 +344,7 @@ if (!SDL_WasInit(SDL_INIT_VIDEO)) { if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE)) { mpxp_err<<"SDL: Initializing of SDL failed: "<<SDL_GetError()<<std::endl; - exit_player("SDL error"); + throw std::runtime_error("SDL error"); } } @@ -389,7 +390,7 @@ sdlflags &= ~SDL_HWSURFACE; if ((!SDL_ListModes (vidInfo->vfmt, sdlflags)) && (!fullmodes)) { mpxp_err<<"SDL: Couldn't get any acceptable SDL Mode for output."<<std::endl; - exit_player("SDL error"); + throw std::runtime_error("SDL error"); } } /* YUV overlays need at least 16-bit color depth, but the @@ -835,7 +836,7 @@ (*vrest->adjust_size)(vrest->vo,windowsize.w,windowsize.h,reinterpret_cast<unsigned*>(&event.resize.w), reinterpret_cast<unsigned*>(&event.resize.h)); if(set_video_mode(event.resize.w, event.resize.h, bpp, sdlflags)!=0) - exit_player("SDL set video mode"); + throw std::runtime_error("SDL set video mode"); /* save video extents, to restore them after going fullscreen */ windowsize.w = surface->w; @@ -884,7 +885,7 @@ /* select next fullscreen mode */ fullmode++; if (fullmode > (findArrayEnd(fullmodes) - 1)) fullmode = 0; - if(set_fullmode(fullmode)!=0) exit_player("SDL set full mode"); + if(set_fullmode(fullmode)!=0) throw std::runtime_error("SDL set full mode"); mpxp_v<<"SDL: Set next available fullscreen mode."<<std::endl; retval = VO_EVENT_RESIZE; } else if ( keypressed == SDLK_n ) { @@ -892,13 +893,13 @@ aspect->calc(dstwidth, dstheight,flags&VOFLAG_FULLSCREEN?Aspect::ZOOM:Aspect::NOZOOM); #endif if (unsigned(surface->w) != dstwidth || unsigned(surface->h) != dstheight) { - if(set_video_mode(dstwidth, dstheight, bpp, sdlflags)!=0) exit_player("SDL set video mode"); + if(set_video_mode(dstwidth, dstheight, bpp, sdlflags)!=0) throw std::runtime_error("SDL set video mode"); windowsize.w = surface->w; windowsize.h = surface->h; mpxp_v<<"SDL: Normal size"<<std::endl; retval |= VO_EVENT_RESIZE; } else if (unsigned(surface->w) != dstwidth * 2 || unsigned(surface->h) != dstheight * 2) { - if(set_video_mode(dstwidth * 2, dstheight * 2, bpp, sdlflags)!=0) exit_player("SDL set video mode"); + if(set_video_mode(dstwidth * 2, dstheight * 2, bpp, sdlflags)!=0) throw std::runtime_error("SDL set video mode"); windowsize.w = surface->w; windowsize.h = surface->h; mpxp_v<<"SDL: Double size"<<std::endl; @@ -1217,11 +1218,11 @@ MPXP_Rc SDL_VO_Interface::toggle_fullscreen() { if (surface->flags & SDL_FULLSCREEN) { - if(set_video_mode(windowsize.w, windowsize.h, bpp, sdlflags)!=0) exit_player("SDL set fullscreen"); + if(set_video_mode(windowsize.w, windowsize.h, bpp, sdlflags)!=0) throw std::runtime_error("SDL set fullscreen"); SDL_ShowCursor(1); mpxp_v<<"SDL: Windowed mode"<<std::endl; } else if (fullmodes) { - if(set_fullmode(fullmode)!=0) exit_player("SDL set fullmode"); + if(set_fullmode(fullmode)!=0) throw std::runtime_error("SDL set fullmode"); mpxp_v<<"SDL: Set fullscreen mode"<<std::endl; } return MPXP_True; Modified: mplayerxp/libvo2/vo_vesa.cpp =================================================================== --- mplayerxp/libvo2/vo_vesa.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/vo_vesa.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -20,6 +20,7 @@ */ #include <algorithm> #include <iomanip> +#include <stdexcept> #include <stdio.h> #include <stdlib.h> @@ -175,7 +176,7 @@ if(!vidix_name.empty()) { if(!(vidix=new(zeromem) Vidix_System(vidix_name))) { mpxp_err<<"Cannot initialze vidix with '"<<vidix_name<<"' argument"<<std::endl; - exit_player("Vidix error"); + throw std::runtime_error("Vidix error"); } } #endif @@ -184,7 +185,7 @@ if(vbeInit()!=VBE_OK) { pre_init_err=MPXP_False; PRINT_VBE_ERR("vbeInit",pre_init_err); - exit_player("VESA preinit"); + throw std::runtime_error("VESA preinit"); } } @@ -214,7 +215,7 @@ vesa_term(); PRINT_VBE_ERR("vbeSetWindow",err); mpxp_fatal<<"vo_vesa: Fatal error occured! Can't continue"<<std::endl; - exit_player("VESA error"); + throw std::runtime_error("VESA error"); } win.low = new_offset * gran; win.high = win.low + vmode_info.WinSize*1024; @@ -301,7 +302,7 @@ vesa_term(); PRINT_VBE_ERR("vbeSetDisplayStart",err); mpxp_fatal<<"vo_vesa: Fatal error occured! Can't continue"<<std::endl; - exit_player("VESA error"); + throw std::runtime_error("VESA error"); } win.ptr = dga_buffer = video_base + multi_buff[(idx+1)%multi_size]; } Modified: mplayerxp/libvo2/vo_x11.cpp =================================================================== --- mplayerxp/libvo2/vo_x11.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/vo_x11.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -17,6 +17,7 @@ * runtime fullscreen switching by alex * */ +#include <stdexcept> #include <limits.h> #include <stdio.h> @@ -144,7 +145,7 @@ mpxp_info<<"args="<<arg<<" vidix_name="<<vidix_name<<std::endl; if(!(vidix=new(zeromem) Vidix_System(vidix_name))) { mpxp_err<<"Cannot initialze vidix with '"<<vidix_name<<"' argument"<<std::endl; - exit_player("Vidix error"); + throw std::runtime_error("Vidix error"); } } #endif @@ -176,9 +177,9 @@ { mpxp_fatal<<"Can't initialize VIDIX: "<<strerror(errno)<<std::endl; delete vidix; - exit_player("Vidix init"); /* !!! */ + throw std::runtime_error("Vidix init"); /* !!! */ } - if(vidix->start()!=0) { delete vidix; exit_player("Vidix start"); } + if(vidix->start()!=0) { delete vidix; throw std::runtime_error("Vidix start"); } } #endif Modified: mplayerxp/libvo2/vo_xv.cpp =================================================================== --- mplayerxp/libvo2/vo_xv.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/vo_xv.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -15,6 +15,7 @@ * double buffering support by A'rpi */ #include <algorithm> +#imclude <stdexcept> #include <stdio.h> #include <stdlib.h> @@ -91,7 +92,7 @@ num_buffers=1; if(!arg.empty()) { mpxp_err<<"vo_xv: Unknown subdevice: "<<arg<<std::endl; - exit_player("Xv error"); + throw std::runtime_error("Xv error"); } } Modified: mplayerxp/libvo2/x11_system.cpp =================================================================== --- mplayerxp/libvo2/x11_system.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/libvo2/x11_system.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -2,6 +2,7 @@ #include "osdep/mplib.h" using namespace usr; #include <iomanip> +#include <stdexcept> #include <errno.h> #include <stdio.h> @@ -76,7 +77,7 @@ if(!(mDisplay=::XOpenDisplay(dispName.c_str()))) { mpxp_err<<"X11_System: couldn't open the X11 display: "<<dispName<<std::endl; - exit_player("X11_System error"); + throw std::runtime_error("X11_System error"); } mScreen=DefaultScreen( mDisplay ); mRootWin=RootWindow( mDisplay,mScreen );// Root window ID. @@ -1211,7 +1212,7 @@ ctx=::glXCreateContext(get_display(), vi, NULL, GL_TRUE); if (ctx == NULL) { mpxp_err<<"[GLX_System]: Can't create GLX context"<<std::endl; - exit_player("vo error"); + throw std::runtime_error("vo error"); } theCmap =::XCreateColormap( get_display(),RootWindow( get_display(),vi->screen), Modified: mplayerxp/main.cpp =================================================================== --- mplayerxp/main.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/main.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -483,37 +483,37 @@ #endif -static void init_player(const std::map<std::string,std::string>& envm) +static MPXP_Rc init_player(const std::map<std::string,std::string>& envm) { if(mp_conf.video_driver && strcmp(mp_conf.video_driver,"help")==0) { mpxp_context().video().output->print_help(); mpxp_uninit_structs(); - exit(0); + return MPXP_False; } if(mp_conf.audio_driver && strcmp(mp_conf.audio_driver,"help")==0) { mpxp_context().audio().output->print_help(); mpxp_uninit_structs(); - exit(0); + return MPXP_False; } if(mp_conf.video_family && strcmp(mp_conf.video_family,"help")==0) { vfm_help(); mpxp_uninit_structs(); - exit(0); + return MPXP_False; } if(mp_conf.audio_family && strcmp(mp_conf.audio_family,"help")==0) { afm_help(); mpxp_uninit_structs(); - exit(0); + return MPXP_False; } if(vf_cfg.list && strcmp(vf_cfg.list,"help")==0) { vf_help(); mpxp_uninit_structs(); - exit(0); + return MPXP_False; } if(af_cfg.list && strcmp(af_cfg.list,"help")==0) { af_help(); mpxp_uninit_structs(); - exit(0); + return MPXP_False; } #ifdef ENABLE_WIN32LOADER @@ -522,7 +522,7 @@ if(!parse_codec_cfg(CONFDIR"/win32codecs.conf")) { mpxp_hint<<MSGTR_CopyCodecsConf<<std::endl; mpxp_uninit_structs(); - exit(0); + return MPXP_False; } } #endif @@ -531,15 +531,16 @@ list_codecs(1); #endif mpxp_uninit_structs(); - exit(0); + return MPXP_False; } if(mp_conf.video_codec && strcmp(mp_conf.video_codec,"help")==0) { #ifdef ENABLE_WIN32LOADER list_codecs(0); #endif mpxp_uninit_structs(); - exit(0); + return MPXP_False; } + return MPXP_Ok; } void show_help(void) { @@ -824,7 +825,7 @@ if(vo_inited==MPXP_False){ mpxp_fatal<<MSGTR_InvalidVOdriver<<": "<<(mp_conf.video_driver?mp_conf.video_driver:"?")<<std::endl; - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } // check audio_out driver name: @@ -1079,7 +1080,7 @@ ao_inited=mpxp_context().audio().output->_register(mp_conf.audio_driver?mp_conf.audio_driver:"",0); if (ao_inited!=MPXP_Ok){ mpxp_fatal<<MSGTR_InvalidAOdriver<<": "<<mp_conf.audio_driver<<std::endl; - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } } } @@ -1211,12 +1212,12 @@ mpxp_fatal<<"Not enough buffers for DECODING AHEAD!"<<std::endl; mpxp_fatal<<"Need 3 buffers but exist only " <<mpxp_context().engine().xp_core->num_v_buffs<<std::endl; - exit_player("Try other '-vo' driver.\n"); + throw std::runtime_error("Try other '-vo' driver."); } if(xmp_init_engine(sh_video,sh_audio)!=0) - exit_player("Can't initialize decoding ahead!\n"); + throw std::runtime_error("Can't initialize decoding ahead!"); if(xmp_run_decoders()!=0) - exit_player("Can't run decoding ahead!\n"); + throw std::runtime_error("Can't run decoding ahead!"); if(sh_video) mpxp_ok<<"Using DECODING AHEAD mplayer's core with "<<mpxp_context().engine().xp_core->num_v_buffs<<" video buffers"<<std::endl; else @@ -1598,17 +1599,16 @@ m_config.parse_cfgfiles(envm); if(m_config.parse_command_line(argv,envm)!=MPXP_Ok) - exit_player("Error parse command line"); // error parsing cmdline + throw std::runtime_error("Error parse command line"); // error parsing cmdline if(!mp_conf.xp) { - mpxp_err<<"Error: detected option: -core.xp=0"<<std::endl; mpxp_err<<"Note! Single-thread mode is not longer supported by MPlayerXP"<<std::endl; - exit_player(MSGTR_Exit_quit); + throw std::runtime_error("Error: detected option: -core.xp=0"); } if(mp_conf.test_av) { int verb=1; if(mpxp_test_antiviral_protection(&verb)==MPXP_Virus) - exit_player("Bad test of antiviral protection"); + throw std::runtime_error("Bad test of antiviral protection"); } MPXPSys.xp_num_cpu=get_number_cpu(); @@ -1632,7 +1632,7 @@ mpxp_context().engine().xp_core->num_a_buffs = vo_conf.xp_buffs; - init_player(envm); + if(init_player(envm)!=MPXP_Ok) return EXIT_SUCCESS; if(filename.empty()){ show_help(); @@ -1686,7 +1686,7 @@ if(mp_conf.stream_dump) if((stream_dump_type=dump_parse(mp_conf.stream_dump))==0) { mpxp_err<<"Wrong dump parameters! Unable to continue"<<std::endl; - exit_player(MSGTR_Fatal_error); + throw std::runtime_error(MSGTR_Fatal_error); } if(stream_dump_type) mp_conf.s_cache_size=0; @@ -1866,7 +1866,7 @@ if(MPXPSys.vo_inited) MPXPSys.uninit_player(INITED_VO); } - if(!sh_audio && !sh_video) exit_player("Nothing to do"); + if(!sh_audio && !sh_video) throw std::runtime_error("Nothing to do"); if(mp_conf.force_fps && sh_video) { sh_video->fps=mp_conf.force_fps; @@ -1903,7 +1903,7 @@ // TODO: rewrite test backtrace in .asm // mpxp_test_backtrace(); - if(xmp_run_players()!=0) exit_player("Can't run xp players!\n"); + if(xmp_run_players()!=0) throw std::runtime_error("Can't run xp players!"); mpxp_ok<<"Using the next "<<mpxp_context().engine().xp_core->num_threads<<" threads:"<<std::endl; unsigned idx; for(idx=0;idx<mpxp_context().engine().xp_core->num_threads;idx++) Modified: mplayerxp/mplayerxp.h =================================================================== --- mplayerxp/mplayerxp.h 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/mplayerxp.h 2013-05-26 12:22:56 UTC (rev 647) @@ -1,6 +1,6 @@ #ifndef __MPLAYERXP_MAIN #define __MPLAYERXP_MAIN 1 - +#include <stdexcept> #include <string> #include <map> @@ -212,7 +212,7 @@ inline void escape_player(const std::string& why,unsigned num_calls) { show_backtrace(why,num_calls); - exit_player(why); + throw std::runtime_error(why); } inline MPXP_Rc check_pin(const std::string& module,unsigned pin1,unsigned pin2) { Modified: mplayerxp/osdep/cpudetect.cpp =================================================================== --- mplayerxp/osdep/cpudetect.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/osdep/cpudetect.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -92,14 +92,13 @@ } do_cpuid(0x00000000, regs); // get _max_ cpuid level and vendor name if (regs[0]>=0x00000001) { - char *tmpstr; + std::string tmpstr; unsigned cl_size; do_cpuid(0x00000001, regs2); tmpstr=GetCpuFriendlyName(regs, regs2); mpxp_v<<"CPU: "<<tmpstr<<std::endl; - delete tmpstr; caps->cpuType=(regs2[0] >> 8)&0xf; if(caps->cpuType==0xf){ @@ -163,16 +162,14 @@ #define CPUID_MODEL ((regs2[0] >> 4)&0x0F) /* 07..04 */ #define CPUID_STEPPING ((regs2[0] >> 0)&0x0F) /* 03..00 */ -char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){ +std::string GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){ #include "cputable.h" /* get cpuname and cpuvendors */ char vendor[17]; char *retname; int i; + std::string rc; - if (NULL==(retname=(char*)mp_malloc(256))) { - mpxp_err<<MSGTR_OutOfMemory<<std::endl; - ::exit(1); - } + retname=new char[256]; sprintf(vendor,"%.4s%.4s%.4s",(char*)(regs+1),(char*)(regs+3),(char*)(regs+2)); @@ -194,8 +191,9 @@ } } - //printf("Detected CPU: %s\n", retname); - return retname; + rc=retname; + delete retname; + return rc; } #undef CPUID_EXTFAMILY Modified: mplayerxp/osdep/cpudetect.h =================================================================== --- mplayerxp/osdep/cpudetect.h 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/osdep/cpudetect.h 2013-05-26 12:22:56 UTC (rev 647) @@ -62,7 +62,7 @@ void GetCpuCaps(CpuCaps *caps); /* returned value is mp_malloc()'ed so mp_free() it after use */ - char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]); + std::string GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]); } // namespace usr #endif /* !CPUDETECT_H */ Modified: mplayerxp/osdep/mp_malloc.cpp =================================================================== --- mplayerxp/osdep/mp_malloc.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/osdep/mp_malloc.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -570,13 +570,45 @@ mp_free(ptr); } -any_t* operator new(size_t size) throw(std::bad_alloc) { return SECURE_NAME0(_mp_malloc)(size); } -any_t* operator new(size_t size,const zeromemory_t&) { return SECURE_NAME1(_mp_mallocz)(size); } -any_t* operator new(size_t size,const alignedmemory_t&,size_t boundary) { return SECURE_NAME2(_mp_memalign)(boundary,size); } +any_t* operator new(size_t size) throw(std::bad_alloc) { + any_t* rc; + rc=SECURE_NAME0(_mp_malloc)(size); + if(!rc) throw std::runtime_error("Memory allocation failed"); + return rc; +} +any_t* operator new(size_t size,const zeromemory_t&) { + any_t* rc; + rc=SECURE_NAME1(_mp_mallocz)(size); + if(!rc) throw std::runtime_error("Memory allocation failed"); + return rc; +} +any_t* operator new(size_t size,const alignedmemory_t&,size_t boundary) { + any_t* rc; + rc=SECURE_NAME2(_mp_memalign)(boundary,size); + if(!rc) throw std::runtime_error("Memory allocation failed"); + return rc; +} any_t* operator new(size_t size,const std::nothrow_t&) { return mp_malloc(size); } -any_t* operator new[](size_t size) throw(std::bad_alloc) { return SECURE_NAME0(_mp_malloc)(size); } -any_t* operator new[](size_t size,const zeromemory_t&) { return SECURE_NAME1(_mp_mallocz)(size); } -any_t* operator new[](size_t size,const alignedmemory_t&,size_t boundary) { return SECURE_NAME2(_mp_memalign)(boundary,size); } + +any_t* operator new[](size_t size) throw(std::bad_alloc) { + any_t* rc; + rc=SECURE_NAME0(_mp_malloc)(size); + if(!rc) throw std::runtime_error("Memory allocation failed"); + return rc; +} +any_t* operator new[](size_t size,const zeromemory_t&) { + any_t* rc; + rc=SECURE_NAME1(_mp_mallocz)(size); + if(!rc) throw std::runtime_error("Memory allocation failed"); + return rc; +} +any_t* operator new[](size_t size,const alignedmemory_t&,size_t boundary) { + any_t* rc; + rc=SECURE_NAME2(_mp_memalign)(boundary,size); + if(!rc) throw std::runtime_error("Memory allocation failed"); + return rc; +} any_t* operator new[](size_t size,const std::nothrow_t&) { return mp_malloc(size); } + void operator delete(any_t* p) throw() { SECURE_NAME3(_mp_free)(p); } void operator delete[](any_t* p) throw() { SECURE_NAME3(_mp_free)(p); } Modified: mplayerxp/postproc/libmenu/menu_console.cpp =================================================================== --- mplayerxp/postproc/libmenu/menu_console.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/postproc/libmenu/menu_console.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -1,6 +1,7 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <stdexcept> #include "mpxp_help.h" @@ -294,6 +295,7 @@ #define close_pipe(pipe) close(pipe[0]); close(pipe[1]) +#if 0 static int run_shell_cmd(menu_t* menu, char* cmd) { #ifndef __MINGW32__ int in[2],out[2],err[2]; @@ -317,15 +319,12 @@ return 0; } if(!mpriv->child) { // Chlid process - int err_fd = dup(2); - FILE* errf = fdopen(err_fd,"w"); // Bind the std fd to our pipes dup2(in[0],0); dup2(out[1],1); dup2(err[1],2); execl("/bin/sh","sh","-c",cmd,(any_t*)NULL); - fprintf(errf,"exec failed : %s\n",strerror(errno)); - exit(1); + throw std::runtime_error(std::string("exec failed : ")+strerror(errno)); } // MPlayer mpriv->child_fd[0] = in[1]; @@ -336,6 +335,7 @@ #endif return 1; } +#endif static void enter_cmd(menu_t* menu) { history_t* h; Modified: mplayerxp/postproc/postprocess.cpp =================================================================== --- mplayerxp/postproc/postprocess.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/postproc/postprocess.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -12,6 +12,7 @@ #include "postprocess.h" #include "libmpcodecs/codecs_ld.h" #include "osdep/cpudetect.h" +#include "mpxp_help.h" #include "pp_msg.h" pp_context *pp2_get_context(int width, int height, int flags) @@ -29,7 +30,7 @@ { if(strcmp(mp_conf.npp_options,"help")==0) { MSG_INFO(pp_help); - exit_player(""); + exit_player(MSGTR_Exit_quit); } return 1; } Modified: mplayerxp/postproc/vf.cpp =================================================================== --- mplayerxp/postproc/vf.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/postproc/vf.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -1,6 +1,8 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <stdexcept> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -678,7 +680,7 @@ vf_stream_t* vf_init(libinput_t& libinput,const vf_conf_t* conf) { if(!sws_init()) { MSG_ERR("MPlayerXP requires working copy of libswscaler\n"); - exit_player(MSGTR_Exit_quit); + throw std::runtime_error("libswscaler"); } vf_stream_t* s = new(zeromem) vf_stream_t(libinput); vf_instance_t* first; Modified: mplayerxp/xmpcore/xmp_vdecoder.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vdecoder.cpp 2013-05-26 08:28:07 UTC (rev 646) +++ mplayerxp/xmpcore/xmp_vdecoder.cpp 2013-05-26 12:22:56 UTC (rev 647) @@ -1,6 +1,8 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <stdexcept> + #include <stdio.h> #include <math.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-26 08:28:10
|
Revision: 646 http://sourceforge.net/p/mplayerxp/code/646 Author: nickols_k Date: 2013-05-26 08:28:07 +0000 (Sun, 26 May 2013) Log Message: ----------- about illegal-patch ==================== This part of memory dump which was maden by gdb and disassembler by biew: ----------------------- 8< -------------------- 8< ----------------------------- ; ;Disassembler dump of 'mplayerxp.dump.0x400000' ;Range : 6E1A97H- 6E1B97H ;Written by Binary Viewer v 6.1.0-x86_64.Linux64 Build: Feb 6 2012 ;Dumped : Sun May 26 09:13:33 2013 ;Format : ELF (Executable and Linking Format) L006E1A97: jne L006E1AA5 ; 750C L006E1A99: mov r9d,[rbp+00000E78] ; 448B8D780E0000 L006E1AA0: test r9d,r9d ; 4585C9 L006E1AA3: jne L006E1AD3 ; 752E L006E1AA5: lea rdx,[rbp+000012A0] ; 488D95A0120000 L006E1AAC: lea r8,[rsp+00002350] ; 4C8D842450230000 L006E1AB4: xor r9d,r9d ; 4531C9 L006E1AB7: xor ecx,ecx ; 31C9 L006E1AB9: mov esi,00CE75CD ; ->"PAUSE" ; BECD75CE00 L006E1ABE: mov rdi,r14 ; 4C89F7 L006E1AC1: calln L006DFC30 ; E86AE1FFFF L006E1AC6: cmp [rsp+00002354],000000C8 ; 81BC2454230000C8000000 L006E1AD1: jne L006E1A7C ; 75A9 L006E1AD3: cmp (d) [rbx+00000248],+01 ; 83BB4802000001 L006E1ADA: mov (d) [rbp+20],00000002 ; C7452002000000 L006E1AE1: jne L006E19E4 ; 0F85FDFEFFFF L006E1AE7: lea rdx,[rbx+000012A0] ; 488D93A0120000 L006E1AEE: lea r8,[rsp+00002350] ; 4C8D842450230000 L006E1AF6: xor r9d,r9d ; 4531C9 L006E1AF9: xor ecx,ecx ; 31C9 L006E1AFB: mov esi,00B3C219 ; ->"TEARDOWN" ; BE19C2B300 L006E1B00: mov rdi,r14 ; 4C89F7 L006E1B03: calln L006DFC30 ; E828E1FFFF L006E1B08: jmpn L006E19E4 ; E9D7FEFFFF L006E1B0D: nop eax,[rax] ; 0F1F00 L006E1B10: lea rax,[rbx+000012A0] ; 488D83A0120000 L006E1B17: lea rbp,[rbx+00000E90] ; 488DAB900E0000 L006E1B1E: mov [rsp+40],rax ; 4889442440 L006E1B23: lea rax,[rsp+60] ; 488D442460 L006E1B28: mov [rsp+38],rax ; 4889442438 L006E1B2D: lea rax,[rsp+00000860] ; 488D842460080000 L006E1B35: mov [rsp+48],rax ; 4889442448 L006E1B3A: mov rsi,rdi ; 4889FE L006E1B3D: mov rdi,[rbx+00000E80] ; 488BBB800E0000 L006E1B44: mov edx,ecx ; 89CA L006E1B46: shl (q) rdx,02 ; 48C1E202 L006E1B4A: calln L00008820 ; E8D16C92FF L006E1B4F: mov rax,[rsp+38] ; 488B442438 L006E1B54: mov rsi,6269726373627553 ; "Subscrib" ; 48BE5375627363726962 L006E1B5E: mov (b) [rbx+00000E90],00 ; C683900E000000 L006E1B65: mov [rax],rsi ; 488930 L006E1B68: mov (d) [rax+08],00203A65 ; "e: " ; C74008653A2000 L006E1B6F: mov eax,[rbx+10] ; 8B4310 L006E1B72: test eax,eax ; 85C0 L006E1B74: jle L006E1BFF ; 0F8E85000000 L006E1B7A: mov edx,[r14+2C] ; 418B562C L006E1B7E: xor r15d,r15d ; 4531FF L006E1B81: mov ecx,00000001 ; B901000000 L006E1B86: nop ax,[cs:rax+rax+00000000] ; 662E0F1F840000000000 L006E1B90: test edx,edx ; 85D2 L006E1B92: je L006E1BF6 ; 7462 L006E1B94: xor r12d,r12d ; 4531E4 ----------------------- 8< -------------------- 8< ----------------------------- This dump shows that the string 'Subscrib' implemented as register-constantr but not as memory string. But, such word as 'TEARDOWN' could be fit into 64-bit register too. But hacked-gcc generated memory offset for that word. It means that hacked-gcc knows the nam 'Subscrib'. Most probably, 'Subscrib' is one of nams of malefactor which modified this copy of hacked-gcc which behave itself worse than gcc-2.96 by Red-Hat. Also, i've found out that copy of this dump, which i did several days ago, was mdified even on my flash media-storage most probably for that nam. There were cleaned almost all entries of nam 'Subscrib' same as many other subscripts of malefactors. Revision Links: -------------- http://sourceforge.net/p/mplayerxp/code/8 http://sourceforge.net/p/mplayerxp/code/14 http://sourceforge.net/p/mplayerxp/code/8 http://sourceforge.net/p/mplayerxp/code/14 http://sourceforge.net/p/mplayerxp/code/14 Modified Paths: -------------- mplayerxp/dump.h Modified: mplayerxp/dump.h =================================================================== --- mplayerxp/dump.h 2013-05-22 16:15:00 UTC (rev 645) +++ mplayerxp/dump.h 2013-05-26 08:28:07 UTC (rev 646) @@ -1,6 +1,4 @@ -/* - dump.h - stream dumper interface -*/ +/* dump.h - stream dumper interface */ #ifndef DUMP_H_INCLUDED #define DUMP_H_INCLUDED 1 #include "libmpdemux/demuxer_r.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-22 16:15:04
|
Revision: 645 http://sourceforge.net/p/mplayerxp/code/645 Author: nickols_k Date: 2013-05-22 16:15:00 +0000 (Wed, 22 May 2013) Log Message: ----------- about illegal-patch ==================== here printed full listing of additional program's parameters: ----------------------- 8< --------------------- 8< ------------------------------ GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /mnt/Storage/Sf.net/MPlayerXP/mplayerxp/mplayerxp/mplayerxp...done. (gdb) break main.cpp:2087 Breakpoint 1 at 0x447cc8: file main.cpp, line 2087. (gdb) run Starting program: /mnt/Storage/Sf.net/MPlayerXP/mplayerxp/mplayerxp/mplayerxp [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, main (argc=1, args=0x7fffffffebc8, envp=0x7fffffffebd8) at main.cpp:2087 2087 args[argc] = (char*)make_false_pointer((any_t*)antiviral_hole1); (gdb) print args[argc] $1 = 0x0 (gdb) print args[argc+1] $2 = 0x7fffffffee17 "XDG_VTNR=2" (gdb) print args[argc+2] $3 = 0x7fffffffee22 "XDG_SESSION_ID=2" (gdb) print args[argc+3] $4 = 0x7fffffffee33 "TERM=linux" (gdb) print args[argc+4] $5 = 0x7fffffffee3e "SHELL=/bin/bash" (gdb) print args[argc+5] $6 = 0x7fffffffee4e "USER=kas" (gdb) print args[argc+6] $7 = 0x7fffffffee57 "COLUMNS=174" (gdb) print args[argc+7] $8 = 0x7fffffffee63 "MC_TMPDIR=/tmp/mc-kas" (gdb) print args[argc+8] $9 = 0x7fffffffee79 "MAIL=/var/spool/mail/kas" (gdb) print args[argc+9] $10 = 0x7fffffffee92 "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl" (gdb) print args[argc+10] $11 = 0x7fffffffeee7 "_=/usr/bin/gdb" (gdb) print args[argc+11] $12 = 0x7fffffffeef6 "PWD=/mnt/Storage/Sf.net/MPlayerXP/mplayerxp/mplayerxp" (gdb) print args[argc+12] $13 = 0x7fffffffef2c "LANG=ru_RU.UTF-8" (gdb) print args[argc+13] $14 = 0x7fffffffef3d "LINES=54" (gdb) print args[argc+14] $15 = 0x7fffffffef46 "HISTCONTROL=ignorespace" (gdb) print args[argc+15] $16 = 0x7fffffffef5e "SHLVL=2" (gdb) print args[argc+16] $17 = 0x7fffffffef66 "XDG_SEAT=seat0" (gdb) print args[argc+17] $18 = 0x7fffffffef75 "HOME=/home/kas" (gdb) print args[argc+18] $19 = 0x7fffffffef84 "MC_SID=12256" (gdb) print args[argc+19] $20 = 0x7fffffffef91 "LOGNAME=kas" (gdb) print args[argc+20] $21 = 0x7fffffffef9d "XDG_RUNTIME_DIR=/run/user/1000" (gdb) print args[argc+21] $22 = 0x0 (gdb) print args[argc+22] $23 = 0x21 <Address 0x21 out of bounds> (gdb) print argc $24 = 1 (gdb) q A debugging session is active. Inferior 1 [process 12726] will be killed. Quit anyway? (y or n) ----------------------- 8< --------------------- 8< ------------------------------ here printed full listing of environment additional parameters ----------------------- 8< --------------------- 8< ------------------------------ GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /path/mplayerxp...done. (gdb) break main.cpp:2098 Breakpoint 1 at 0x447f98: file main.cpp, line 2098. (gdb) run Starting program: /path/mplayerxp [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, main (argc=<optimized out>, args=<optimized out>, envp=0x7fffffffebd8) at main.cpp:2098 2098 envp[j+1] = NULL; (gdb) print envp[j] $1 = 0x0 (gdb) print envp[j+1] $2 = 0x21 <Address 0x21 out of bounds> (gdb) print envp[j+2] $3 = 0x7ffff7ffa000 "\177ELF\002\001\001" (gdb) print envp[j+3] $4 = 0x10 <Address 0x10 out of bounds> (gdb) print envp[j+4] $5 = 0x178bfbff <Address 0x178bfbff out of bounds> (gdb) print envp[j+5] $6 = 0x6 <Address 0x6 out of bounds> (gdb) print envp[j+6] $7 = 0x1000 <Address 0x1000 out of bounds> (gdb) print envp[j+7] $8 = 0x11 <Address 0x11 out of bounds> (gdb) print envp[j+8] $9 = 0x64 <Address 0x64 out of bounds> (gdb) print envp[j+9] $10 = 0x3 <Address 0x3 out of bounds> (gdb) print envp[j+10] $11 = 0x400040 "\006" (gdb) print envp[j+11] $12 = 0x4 <Address 0x4 out of bounds> (gdb) print envp[j+12] $13 = 0x38 <Address 0x38 out of bounds> (gdb) print envp[j+13] $14 = 0x5 <Address 0x5 out of bounds> (gdb) print envp[j+14] $15 = 0x8 <Address 0x8 out of bounds> (gdb) print envp[j+15] $16 = 0x7 <Address 0x7 out of bounds> (gdb) print envp[j+16] $17 = 0x7ffff7ddb000 "\177ELF\002\001\001" (gdb) dump memory .envp[j+16] envp[j+16] envp[j+16]+135168 (gdb) print envp[j+17] $18 = 0x8 <Address 0x8 out of bounds> (gdb) print envp[j+18] $19 = 0x0 (gdb) print envp[j+19] $20 = 0x9 <Address 0x9 out of bounds> (gdb) print envp[j+20] $21 = 0x45f228 <_start> "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\360", <incomplete sequence \362\262> (gdb) print envp[j+21] $22 = 0xb <Address 0xb out of bounds> (gdb) print envp[j+22] $23 = 0x3e8 <Address 0x3e8 out of bounds> (gdb) print envp[j+23] $24 = 0xc <Address 0xc out of bounds> (gdb) print envp[j+24] $25 = 0x3e8 <Address 0x3e8 out of bounds> (gdb) print envp[j+25] $26 = 0xd <Address 0xd out of bounds> (gdb) print envp[j+26] $27 = 0x3e8 <Address 0x3e8 out of bounds> (gdb) print envp[j+27] $28 = 0xe <Address 0xe out of bounds> (gdb) print envp[j+28] $29 = 0x3e8 <Address 0x3e8 out of bounds> (gdb) print envp[j+29] $30 = 0x17 <Address 0x17 out of bounds> (gdb) print envp[j+30] $31 = 0x45f228 <_start> "1\355I\211\321^H\211\342H\203\344\360PTI\307\300\360", <incomplete sequence \362\262> (gdb) print envp[j+31] $33 = 0x19 <Address 0x19 out of bounds> (gdb) print envp[j+32] $34 = 0x7fffffffedb9 "\240\376\360\257\220r?\213?\168\271\025O\337\313#t\253x86_64" (gdb) dump memory .envp[j+32] envp[j+32] envp[j+32]+583 (gdb) print envp[j+33] $35 = 0x1f <Address 0x1f out of bounds> (gdb) print envp[j+34] $36 = 0x7fffffffefbc "/path/mplayerxp" (gdb) q A debugging session is active. Inferior 1 [process 12607] will be killed. Quit anyway? (y or n) ----------------------- 8< --------------------- 8< ------------------------------ $ objedump .envp[j+16] file truncated $ gexdump -C .envp[j+16] ----------------------- 8< --------------------- 8< ------------------------------ 00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............| 00000010 03 00 3e 00 01 00 00 00 b0 14 00 00 00 00 00 00 |..>.............| 00000020 40 00 00 00 00 00 00 00 b0 30 02 00 00 00 00 00 |@........0......| 00000030 00 00 00 00 40 00 38 00 07 00 40 00 19 00 16 00 |....@.8...@.....| 00000040 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000060 e8 0d 02 00 00 00 00 00 e8 0d 02 00 00 00 00 00 |................| 00000070 00 00 20 00 00 00 00 00 01 00 00 00 06 00 00 00 |.. .............| 00000080 68 1b 02 00 00 00 00 00 68 1b 22 00 00 00 00 00 |h.......h.".....| 00000090 68 1b 22 00 00 00 00 00 58 14 00 00 00 00 00 00 |h.".....X.......| 000000a0 28 16 00 00 00 00 00 00 00 00 20 00 00 00 00 00 |(......... .....| 000000b0 02 00 00 00 06 00 00 00 f0 1d 02 00 00 00 00 00 |................| 000000c0 f0 1d 22 00 00 00 00 00 f0 1d 22 00 00 00 00 00 |..".......".....| 000000d0 b0 01 00 00 00 00 00 00 b0 01 00 00 00 00 00 00 |................| 000000e0 08 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 |................| 000000f0 c8 01 00 00 00 00 00 00 c8 01 00 00 00 00 00 00 |................| 00000100 c8 01 00 00 00 00 00 00 24 00 00 00 00 00 00 00 |........$.......| 00000110 24 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 |$...............| 00000120 50 e5 74 64 04 00 00 00 60 e2 01 00 00 00 00 00 |P.td....`.......| 00000130 60 e2 01 00 00 00 00 00 60 e2 01 00 00 00 00 00 |`.......`.......| 00000140 8c 06 00 00 00 00 00 00 8c 06 00 00 00 00 00 00 |................| 00000150 04 00 00 00 00 00 00 00 51 e5 74 64 06 00 00 00 |........Q.td....| 00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000180 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 |................| 00000190 52 e5 74 64 04 00 00 00 68 1b 02 00 00 00 00 00 |R.td....h.......| 000001a0 68 1b 22 00 00 00 00 00 68 1b 22 00 00 00 00 00 |h.".....h.".....| 000001b0 98 04 00 00 00 00 00 00 98 04 00 00 00 00 00 00 |................| 000001c0 01 00 00 00 00 00 00 00 04 00 00 00 14 00 00 00 |................| 000001d0 03 00 00 00 47 4e 55 00 2c 4a f2 8e dc da 25 be |....GNU.,J....%.| 000001e0 5d c2 a5 ce fc b6 5b 16 03 4c 04 9d 00 00 00 00 |].....[..L......| 000001f0 2a 00 00 00 1b 00 00 00 1a 00 00 00 0a 00 00 00 |*...............| 00000200 0c 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 |................| 00000210 00 00 00 00 12 00 00 00 0e 00 00 00 00 00 00 00 |................| 00000220 00 00 00 00 0f 00 00 00 10 00 00 00 13 00 00 00 |................| 00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000240 06 00 00 00 00 00 00 00 14 00 00 00 0b 00 00 00 |................| 00000250 00 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00 |................| 00000260 00 00 00 00 17 00 00 00 00 00 00 00 00 00 00 00 |................| 00000270 07 00 00 00 05 00 00 00 00 00 00 00 03 00 00 00 |................| 00000280 18 00 00 00 19 00 00 00 00 00 00 00 02 00 00 00 |................| 00000290 00 00 00 00 00 00 00 00 11 00 00 00 09 00 00 00 |................| 000002a0 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 |................| 000002b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000002c0 00 00 00 00 0d 00 00 00 16 00 00 00 00 00 00 00 |................| 000002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000310 2e 00 00 00 02 00 00 00 04 00 00 00 08 00 00 00 |................| 00000320 20 04 41 00 18 20 00 34 89 02 00 40 05 05 80 04 | .A.. .4...@....| 00000330 80 00 7a 00 40 0a 01 04 82 40 c4 23 00 84 08 22 |..z.@....@.#..."| 00000340 00 00 00 00 02 00 00 00 03 00 00 00 00 00 00 00 |................| 00000350 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 |................| 00000360 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000370 06 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 |................| 00000380 08 00 00 00 09 00 00 00 0a 00 00 00 00 00 00 00 |................| 00000390 00 00 00 00 00 00 00 00 00 00 00 00 0b 00 00 00 |................| 000003a0 00 00 00 00 00 00 00 00 0c 00 00 00 00 00 00 00 |................| 000003b0 00 00 00 00 00 00 00 00 0d 00 00 00 0e 00 00 00 |................| 000003c0 0f 00 00 00 10 00 00 00 13 00 00 00 14 00 00 00 |................| 000003d0 00 00 00 00 15 00 00 00 16 00 00 00 17 00 00 00 |................| 000003e0 18 00 00 00 19 00 00 00 00 00 00 00 00 00 00 00 |................| 000003f0 1a 00 00 00 00 00 00 00 f3 16 e6 f5 3d 10 75 54 |............=.uT| 00000400 a9 94 14 f0 eb 01 46 88 97 6b df b1 23 64 bc 3c |......F..k..#d.<| 00000410 3b 85 eb 1c c7 0e e0 3d 0b d6 bb 24 d7 6a fa a1 |;......=...$.j..| 00000420 69 37 4a b5 bb 15 73 42 ef d2 8a 7c d9 3d 6c f6 |i7J...sB...|.=l.| 00000430 d8 3d 6c f6 48 de 58 78 87 f0 96 7c 61 a2 92 06 |.=l.H.Xx...|a...| 00000440 dd b9 d7 9f 47 3a 6d 86 6b 43 28 9f 93 d1 70 ed |....G:m.kC(...p.| 00000450 6b 80 3c b2 3d ad 39 0d a7 47 43 91 00 00 00 00 |k.<.=.9..GC.....| 00000460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000470 00 00 00 00 00 00 00 00 00 00 00 00 03 00 0b 00 |................| 00000480 a0 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000490 9f 00 00 00 22 00 0b 00 c0 58 01 00 00 00 00 00 |...."....X......| 000004a0 31 00 00 00 00 00 00 00 2b 01 00 00 11 00 14 00 |1.......+.......| 000004b0 60 31 22 00 00 00 00 00 28 00 00 00 00 00 00 00 |`1".....(.......| 000004c0 63 00 00 00 11 00 10 00 e8 1d 22 00 00 00 00 00 |c.........".....| 000004d0 04 00 00 00 00 00 00 00 fb 00 00 00 12 00 0b 00 |................| 000004e0 60 8a 00 00 00 00 00 00 ff 01 00 00 00 00 00 00 |`...............| 000004f0 ed 00 00 00 12 00 0b 00 d0 12 01 00 00 00 00 00 |................| 00000500 a5 00 00 00 00 00 00 00 b6 00 00 00 11 00 10 00 |................| 00000510 78 1d 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |x.".............| 00000520 a6 00 00 00 12 00 0b 00 a0 f2 00 00 00 00 00 00 |................| 00000530 02 00 00 00 00 00 00 00 e5 00 00 00 22 00 0b 00 |............"...| 00000540 70 5a 01 00 00 00 00 00 8d 00 00 00 00 00 00 00 |pZ..............| 00000550 1a 01 00 00 12 00 0b 00 00 17 01 00 00 00 00 00 |................| 00000560 31 00 00 00 00 00 00 00 87 00 00 00 12 00 0b 00 |1...............| 00000570 80 13 01 00 00 00 00 00 15 00 00 00 00 00 00 00 |................| 00000580 28 00 00 00 11 00 10 00 e0 1d 22 00 00 00 00 00 |(.........".....| 00000590 08 00 00 00 00 00 00 00 4e 01 00 00 11 00 f1 ff |........N.......| 000005a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000005b0 78 00 00 00 12 00 0b 00 20 1b 01 00 00 00 00 00 |x....... .......| 000005c0 37 00 00 00 00 00 00 00 5a 01 00 00 11 00 f1 ff |7.......Z.......| 000005d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000005e0 64 01 00 00 11 00 f1 ff 00 00 00 00 00 00 00 00 |d...............| 000005f0 00 00 00 00 00 00 00 00 0f 01 00 00 12 00 0b 00 |................| 00000600 10 0c 01 00 00 00 00 00 4e 02 00 00 00 00 00 00 |........N.......| 00000610 34 01 00 00 22 00 0b 00 00 59 01 00 00 00 00 00 |4..."....Y......| 00000620 2a 00 00 00 00 00 00 00 6e 01 00 00 11 00 f1 ff |*.......n.......| 00000630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000640 bf 00 00 00 12 00 0b 00 e0 14 01 00 00 00 00 00 |................| 00000650 1d 02 00 00 00 00 00 00 0e 00 00 00 12 00 0b 00 |................| 00000660 e0 1e 01 00 00 00 00 00 75 00 00 00 00 00 00 00 |........u.......| 00000670 d5 00 00 00 11 00 10 00 40 1c 22 00 00 00 00 00 |........@.".....| 00000680 28 01 00 00 00 00 00 00 50 00 00 00 12 00 0b 00 |(.......P.......| 00000690 40 17 01 00 00 00 00 00 8c 00 00 00 00 00 00 00 |@...............| 000006a0 01 00 00 00 11 00 13 00 00 20 22 00 00 00 00 00 |......... ".....| 000006b0 78 0f 00 00 00 00 00 00 49 00 00 00 22 00 0b 00 |x.......I..."...| 000006c0 b0 58 01 00 00 00 00 00 0d 00 00 00 00 00 00 00 |.X..............| 000006d0 39 00 00 00 22 00 0b 00 a0 57 01 00 00 00 00 00 |9..."....W......| 000006e0 0c 01 00 00 00 00 00 00 00 5f 72 74 6c 64 5f 67 |........._rtld_g| 000006f0 6c 6f 62 61 6c 00 5f 64 6c 5f 6d 61 6b 65 5f 73 |lobal._dl_make_s| 00000700 74 61 63 6b 5f 65 78 65 63 75 74 61 62 6c 65 00 |tack_executable.| 00000710 5f 5f 6c 69 62 63 5f 73 74 61 63 6b 5f 65 6e 64 |__libc_stack_end| 00000720 00 5f 5f 6c 69 62 63 5f 6d 65 6d 61 6c 69 67 6e |.__libc_memalign| 00000730 00 6d 61 6c 6c 6f 63 00 5f 64 6c 5f 64 65 61 6c |.malloc._dl_deal| 00000740 6c 6f 63 61 74 65 5f 74 6c 73 00 5f 5f 6c 69 62 |locate_tls.__lib| 00000750 63 5f 65 6e 61 62 6c 65 5f 73 65 63 75 72 65 00 |c_enable_secure.| 00000760 5f 5f 74 6c 73 5f 67 65 74 5f 61 64 64 72 00 5f |__tls_get_addr._| 00000770 64 6c 5f 67 65 74 5f 74 6c 73 5f 73 74 61 74 69 |dl_get_tls_stati| 00000780 63 5f 69 6e 66 6f 00 63 61 6c 6c 6f 63 00 5f 64 |c_info.calloc._d| 00000790 6c 5f 64 65 62 75 67 5f 73 74 61 74 65 00 5f 64 |l_debug_state._d| 000007a0 6c 5f 61 72 67 76 00 5f 64 6c 5f 61 6c 6c 6f 63 |l_argv._dl_alloc| 000007b0 61 74 65 5f 74 6c 73 5f 69 6e 69 74 00 5f 72 74 |ate_tls_init._rt| 000007c0 6c 64 5f 67 6c 6f 62 61 6c 5f 72 6f 00 72 65 61 |ld_global_ro.rea| 000007d0 6c 6c 6f 63 00 5f 64 6c 5f 74 6c 73 5f 73 65 74 |lloc._dl_tls_set| 000007e0 75 70 00 5f 64 6c 5f 72 74 6c 64 5f 64 69 5f 73 |up._dl_rtld_di_s| 000007f0 65 72 69 6e 66 6f 00 5f 64 6c 5f 6d 63 6f 75 6e |erinfo._dl_mcoun| 00000800 74 00 5f 64 6c 5f 61 6c 6c 6f 63 61 74 65 5f 74 |t._dl_allocate_t| 00000810 6c 73 00 5f 72 5f 64 65 62 75 67 00 66 72 65 65 |ls._r_debug.free| 00000820 00 6c 64 2d 6c 69 6e 75 78 2d 78 38 36 2d 36 34 |.ld-linux-x86-64| 00000830 2e 73 6f 2e 32 00 47 4c 49 42 43 5f 32 2e 32 2e |.so.2.GLIBC_2.2.| 00000840 35 00 47 4c 49 42 43 5f 32 2e 33 00 47 4c 49 42 |5.GLIBC_2.3.GLIB| 00000850 43 5f 32 2e 34 00 47 4c 49 42 43 5f 50 52 49 56 |C_2.4.GLIBC_PRIV| 00000860 41 54 45 00 00 00 00 00 02 00 02 00 05 00 05 00 |ATE.............| 00000870 05 00 05 00 05 00 02 00 05 00 05 00 02 00 02 00 |................| 00000880 03 00 03 00 04 00 02 00 02 00 05 00 05 00 05 00 |................| 00000890 05 00 05 00 05 00 02 00 02 00 00 00 00 00 00 00 |................| 000008a0 01 00 01 00 01 00 01 00 f2 3b 7d 07 14 00 00 00 |.........;}.....| 000008b0 1c 00 00 00 39 01 00 00 00 00 00 00 01 00 00 00 |....9...........| 000008c0 02 00 01 00 75 1a 69 09 14 00 00 00 1c 00 00 00 |....u.i.........| 000008d0 4e 01 00 00 00 00 00 00 01 00 00 00 03 00 02 00 |N...............| 000008e0 13 69 69 0d 14 00 00 00 24 00 00 00 5a 01 00 00 |.ii.....$...Z...| 000008f0 08 00 00 00 4e 01 00 00 00 00 00 00 01 00 00 00 |....N...........| 00000900 04 00 02 00 14 69 69 0d 14 00 00 00 24 00 00 00 |.....ii.....$...| 00000910 64 01 00 00 08 00 00 00 5a 01 00 00 00 00 00 00 |d.......Z.......| 00000920 01 00 00 00 05 00 02 00 85 cf 63 09 14 00 00 00 |..........c.....| 00000930 00 00 00 00 6e 01 00 00 08 00 00 00 64 01 00 00 |....n.......d...| 00000940 00 00 00 00 00 00 00 00 68 1b 22 00 00 00 00 00 |........h.".....| 00000950 08 00 00 00 00 00 00 00 50 12 00 00 00 00 00 00 |........P.......| 00000960 08 1d 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |..".............| 00000970 70 f9 00 00 00 00 00 00 10 1d 22 00 00 00 00 00 |p.........".....| 00000980 08 00 00 00 00 00 00 00 b0 e8 00 00 00 00 00 00 |................| 00000990 18 1d 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |..".............| 000009a0 a0 e6 00 00 00 00 00 00 20 1d 22 00 00 00 00 00 |........ .".....| 000009b0 08 00 00 00 00 00 00 00 10 0c 01 00 00 00 00 00 |................| 000009c0 28 1d 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |(.".............| 000009d0 30 97 00 00 00 00 00 00 30 1d 22 00 00 00 00 00 |0.......0.".....| 000009e0 08 00 00 00 00 00 00 00 60 1f 01 00 00 00 00 00 |........`.......| 000009f0 38 1d 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |8.".............| 00000a00 a0 23 01 00 00 00 00 00 40 1d 22 00 00 00 00 00 |.#......@.".....| 00000a10 08 00 00 00 00 00 00 00 50 42 01 00 00 00 00 00 |........PB......| 00000a20 48 1d 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |H.".............| 00000a30 60 1b 01 00 00 00 00 00 50 1d 22 00 00 00 00 00 |`.......P.".....| 00000a40 08 00 00 00 00 00 00 00 00 55 01 00 00 00 00 00 |.........U......| 00000a50 e8 1f 22 00 00 00 00 00 08 00 00 00 00 00 00 00 |..".............| 00000a60 00 31 22 00 00 00 00 00 f0 1f 22 00 00 00 00 00 |.1".......".....| 00000a70 06 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 |................| 00000a80 f8 1f 22 00 00 00 00 00 06 00 00 00 12 00 00 00 |..".............| 00000a90 00 00 00 00 00 00 00 00 b8 1f 22 00 00 00 00 00 |..........".....| 00000aa0 07 00 00 00 1a 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ab0 c0 1f 22 00 00 00 00 00 07 00 00 00 19 00 00 00 |..".............| 00000ac0 00 00 00 00 00 00 00 00 c8 1f 22 00 00 00 00 00 |..........".....| 00000ad0 07 00 00 00 0e 00 00 00 00 00 00 00 00 00 00 00 |................| 00000ae0 d0 1f 22 00 00 00 00 00 07 00 00 00 02 00 00 00 |..".............| 00000af0 00 00 00 00 00 00 00 00 d8 1f 22 00 00 00 00 00 |..........".....| 00000b00 07 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b10 e0 1f 22 00 00 00 00 00 07 00 00 00 12 00 00 00 |..".............| 00000b20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000b30 ff 35 72 14 22 00 ff 25 74 14 22 00 0f 1f 40 00 |.5r."..%t."...@.| 00000b40 ff 25 72 14 22 00 68 00 00 00 00 e9 e0 ff ff ff |.%r.".h.........| 00000b50 ff 25 6a 14 22 00 68 01 00 00 00 e9 d0 ff ff ff |.%j.".h.........| 00000b60 ff 25 62 14 22 00 68 02 00 00 00 e9 c0 ff ff ff |.%b.".h.........| 00000b70 ff 25 5a 14 22 00 68 03 00 00 00 e9 b0 ff ff ff |.%Z.".h.........| 00000b80 ff 25 52 14 22 00 68 04 00 00 00 e9 a0 ff ff ff |.%R.".h.........| 00000b90 ff 25 4a 14 22 00 68 05 00 00 00 e9 90 ff ff ff |.%J.".h.........| [snip]...[/snip] ----------------------- 8< --------------------- 8< ------------------------------ $ hexdump -C .envp[j+32] ----------------------- 8< --------------------- 8< ------------------------------ 00000000 a0 fe f0 af 90 72 d5 a8 b9 15 4f df cb 23 74 ab |.....r....O..#t.| 00000010 78 38 36 5f 36 34 00 00 00 00 00 00 00 00 00 00 |x86_64..........| 00000020 00 00 2f 6d 6e 74 2f 53 74 6f 72 61 67 65 2f 53 |../mnt/Storage/S| 00000030 66 2e 6e 65 74 2f 4d 50 6c 61 79 65 72 58 50 2f |f.net/MPlayerXP/| 00000040 6d 70 6c 61 79 65 72 78 70 2f 6d 70 6c 61 79 65 |mplayerxp/mplaye| 00000050 72 78 70 2f 6d 70 6c 61 79 65 72 78 70 00 58 44 |rxp/mplayerxp.XD| 00000060 47 5f 56 54 4e 52 3d 32 00 58 44 47 5f 53 45 53 |G_VTNR=2.XDG_SES| 00000070 53 49 4f 4e 5f 49 44 3d 32 00 54 45 52 4d 3d 6c |SION_ID=2.TERM=l| 00000080 69 6e 75 78 00 53 48 45 4c 4c 3d 2f 62 69 6e 2f |inux.SHELL=/bin/| 00000090 62 61 73 68 00 55 53 45 52 3d 6b 61 73 00 43 4f |bash.USER=kas.CO| 000000a0 4c 55 4d 4e 53 3d 31 37 34 00 4d 43 5f 54 4d 50 |LUMNS=174.MC_TMP| 000000b0 44 49 52 3d 2f 74 6d 70 2f 6d 63 2d 6b 61 73 00 |DIR=/tmp/mc-kas.| 000000c0 4d 41 49 4c 3d 2f 76 61 72 2f 73 70 6f 6f 6c 2f |MAIL=/var/spool/| 000000d0 6d 61 69 6c 2f 6b 61 73 00 50 41 54 48 3d 2f 75 |mail/kas.PATH=/u| 000000e0 73 72 2f 6c 6f 63 61 6c 2f 62 69 6e 3a 2f 75 73 |sr/local/bin:/us| 000000f0 72 2f 62 69 6e 3a 2f 62 69 6e 3a 2f 75 73 72 2f |r/bin:/bin:/usr/| 00000100 6c 6f 63 61 6c 2f 73 62 69 6e 3a 2f 75 73 72 2f |local/sbin:/usr/| 00000110 73 62 69 6e 3a 2f 73 62 69 6e 3a 2f 75 73 72 2f |sbin:/sbin:/usr/| 00000120 62 69 6e 2f 63 6f 72 65 5f 70 65 72 6c 00 5f 3d |bin/core_perl._=| 00000130 2f 75 73 72 2f 62 69 6e 2f 67 64 62 00 50 57 44 |/usr/bin/gdb.PWD| 00000140 3d 2f 6d 6e 74 2f 53 74 6f 72 61 67 65 2f 53 66 |=/mnt/Storage/Sf| 00000150 2e 6e 65 74 2f 4d 50 6c 61 79 65 72 58 50 2f 6d |.net/MPlayerXP/m| 00000160 70 6c 61 79 65 72 78 70 2f 6d 70 6c 61 79 65 72 |playerxp/mplayer| 00000170 78 70 00 4c 41 4e 47 3d 72 75 5f 52 55 2e 55 54 |xp.LANG=ru_RU.UT| 00000180 46 2d 38 00 4c 49 4e 45 53 3d 35 34 00 48 49 53 |F-8.LINES=54.HIS| 00000190 54 43 4f 4e 54 52 4f 4c 3d 69 67 6e 6f 72 65 73 |TCONTROL=ignores| 000001a0 70 61 63 65 00 53 48 4c 56 4c 3d 32 00 58 44 47 |pace.SHLVL=2.XDG| 000001b0 5f 53 45 41 54 3d 73 65 61 74 30 00 48 4f 4d 45 |_SEAT=seat0.HOME| 000001c0 3d 2f 68 6f 6d 65 2f 6b 61 73 00 4d 43 5f 53 49 |=/home/kas.MC_SI| 000001d0 44 3d 31 32 32 35 36 00 4c 4f 47 4e 41 4d 45 3d |D=12256.LOGNAME=| 000001e0 6b 61 73 00 58 44 47 5f 52 55 4e 54 49 4d 45 5f |kas.XDG_RUNTIME_| 000001f0 44 49 52 3d 2f 72 75 6e 2f 75 73 65 72 2f 31 30 |DIR=/run/user/10| 00000200 30 30 00 2f 6d 6e 74 2f 53 74 6f 72 61 67 65 2f |00./mnt/Storage/| 00000210 53 66 2e 6e 65 74 2f 4d 50 6c 61 79 65 72 58 50 |Sf.net/MPlayerXP| 00000220 2f 6d 70 6c 61 79 65 72 78 70 2f 6d 70 6c 61 79 |/mplayerxp/mplay| 00000230 65 72 78 70 2f 6d 70 6c 61 79 65 72 78 70 00 00 |erxp/mplayerxp..| 00000240 00 00 00 00 00 00 00 |.......| 00000247 ----------------------- 8< --------------------- 8< ------------------------------ Modified Paths: -------------- mplayerxp/dump.cpp Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-05-22 09:02:51 UTC (rev 644) +++ mplayerxp/dump.cpp 2013-05-22 16:15:00 UTC (rev 645) @@ -298,12 +298,10 @@ priv->my_use_pts=use_pts; /* test stream property */ MSG_INFO("%s using PTS method\n",use_pts?"":"not"); - if(priv->m_video) - { + if(priv->m_video) { if(!shv) { MSG_ERR("Video not found!!!Skip this stream\n"); return; } if(!shv->bih) { MSG_ERR("Video property not found!!!Skip this stream\n"); return; } - if(memcmp(shv->bih,priv->m_video->bih,sizeof(BITMAPINFOHEADER))!=0) - { + if(memcmp(shv->bih,priv->m_video->bih,sizeof(BITMAPINFOHEADER))!=0) { MSG_ERR("Found different video properties(%X-%ix%i)!=(%X-%ix%i)!!!\nSkip this stream\n", shv->bih->biCompression,shv->bih->biWidth,shv->bih->biHeight, priv->m_video->bih->biCompression,priv->m_video->bih->biWidth, @@ -312,12 +310,10 @@ } priv->m_video->source=shv; } - if(priv->m_audio) - { + if(priv->m_audio) { if(!sha) { MSG_ERR("Audio not found!!!Skip this stream\n"); return; } if(!sha->wf) { MSG_ERR("Audio property not found!!!Skip this stream\n"); return; } - if(memcmp(sha->wf,priv->m_audio->wf,sizeof(WAVEFORMATEX))!=0) - { + if(memcmp(sha->wf,priv->m_audio->wf,sizeof(WAVEFORMATEX))!=0) { MSG_ERR("Found different audio properties(%X-%ix%ix%i)!=(%X-%ix%ix%i)X!!!\nSkip this stream\n", sha->wf->wFormatTag,sha->wf->nSamplesPerSec,sha->wf->wBitsPerSample,sha->wf->nChannels, priv->m_audio->wf->wFormatTag,priv->m_audio->wf->nSamplesPerSec, @@ -347,13 +343,11 @@ veof=shv?0:1; if(shv) priv->vtimer=0; if(sha) sha->timer=0; - while(!(aeof && veof)){ + while(!(aeof && veof)) { in_size=0; - if(sha && !aeof) - { + if(sha && !aeof) { float a_pts; - while(sha->timer < (shv?priv->vtimer:HUGE) || !shv || veof) /* autolimitation of audio reading */ - { + while(sha->timer < (shv?priv->vtimer:HUGE) || !shv || veof) { /* autolimitation of audio reading */ /* we should try to keep structure of audio packets here and don't generate badly interlaved stream. The ideal case is: type=read_packet(ANY_TYPE); put_packet(type); @@ -364,8 +358,7 @@ else a_duration=(float)in_size/(float)(sha->i_bps); if(mpeg_atimer==HUGE) mpeg_atimer=a_pts; - else - { + else { if( mpeg_atimer-a_duration<a_pts) mpeg_atimer=a_pts; else mpeg_atimer+=a_duration; } @@ -375,11 +368,9 @@ aeof=sha->ds->eof; priv->a_frameno++; if(aeof) break; - if(priv->m_audio) - { + if(priv->m_audio) { priv->m_audio->buffer=start; - if(in_size>0) - { + if(in_size>0) { MSG_V("put audio: %f %f %u\n",a_pts,sha->timer+priv->timer_corr,in_size); if(priv->m_audio) muxer_write_chunk(priv->m_audio,in_size,priv->m_video?0:AVIIF_KEYFRAME,sha->timer+priv->timer_corr); @@ -390,16 +381,14 @@ priv->asize += in_size; } } - if(shv && !veof) - { + if(shv && !veof) { float v_pts; in_size=shv->read_frame(&frame_time,&v_pts,&start,0); cmd = check_cmd(priv); if(cmd == -1) goto done; else if(mpeg_vtimer==HUGE) mpeg_vtimer=v_pts; - else - { + else { if( mpeg_vtimer-frame_time<v_pts ) mpeg_vtimer=v_pts; else mpeg_vtimer+=frame_time; } @@ -409,8 +398,7 @@ veof=shv->ds->eof; MSG_V("Got video frame %f %i\n",v_pts,(!veof)?priv->decoded_frameno:-1); if(priv->m_video) priv->m_video->buffer=start; - if(in_size>0) - { + if(in_size>0) { MSG_V("put video: %f %f %u flg=%u\n",v_pts,priv->vtimer+priv->timer_corr,in_size,shv->ds->flags); if(priv->m_video) muxer_write_chunk(priv->m_video,in_size,(shv->ds->flags&1)?AVIIF_KEYFRAME:0,priv->vtimer+priv->timer_corr); priv->vsize += in_size; @@ -418,11 +406,9 @@ if(!(priv->decoded_frameno%100)) MSG_STATUS("Done %u frames\r",priv->decoded_frameno); } - if(demuxer->sub->sh) - { + if(demuxer->sub->sh) { float s_pts=0; - while(s_pts < (shv?priv->vtimer:HUGE) || !shv || veof) /* autolimitation of sub reading */ - { + while(s_pts < (shv?priv->vtimer:HUGE) || !shv || veof) { /* autolimitation of sub reading */ in_size=ds_get_packet_r(*demuxer->sub,&start,s_pts); seof=demuxer->sub->eof; if(seof) break; @@ -430,11 +416,9 @@ if(cmd == -1) goto done; else MSG_V("Got sub frame: %f\n",s_pts); - if(priv->m_subs) - { + if(priv->m_subs) { priv->m_subs->buffer=start; - if(in_size>0) - { + if(in_size>0) { MSG_V("put subs: %f %u\n",s_pts,in_size); if(priv->m_subs) muxer_write_chunk(priv->m_subs,in_size,priv->m_video?0:AVIIF_KEYFRAME,s_pts); @@ -446,8 +430,7 @@ } done: if(shv) priv->timer_corr+=priv->vtimer+frame_time; - else - { + else { if(sha) priv->timer_corr+=d_audio->pts; if(priv->m_audio->wf->nAvgBytesPerSec) priv->timer_corr+=((float)d_audio->tell_pts())/((float)priv->m_audio->wf->nAvgBytesPerSec); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-22 09:02:57
|
Revision: 644 http://sourceforge.net/p/mplayerxp/code/644 Author: nickols_k Date: 2013-05-22 09:02:51 +0000 (Wed, 22 May 2013) Log Message: ----------- move xp_num_cpu into context of class about illegal-patch =================== I've studied pointer no strange argument envp[j+2] which point on real ELF -------------------- 8< -------------------- 8< ------------------------------------------- GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /mnt/Storage/Sf.net/MPlayerXP/mplayerxp/mplayerxp/mplayerxp...done. (gdb) break main.cpp:2101 (gdb) Breakpoint 1 at 0x447f9d: file main.cpp, line 2101. (gdb) run (gdb) Starting program: /mnt/Storage/Sf.net/MPlayerXP/mplayerxp/mplayerxp/mplayerxp -vo null -ao null -core.dump @stream:file /mnt/Storage/Data/MP3/track09.wav [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, main (argc=<optimized out>, args=<optimized out>, envp=0x7fffffffeba0) at main.cpp:2101 2101 rc=mp_mprotect((any_t*)antiviral_hole1,sizeof(antiviral_hole1),MP_DENY_ALL); (gdb) print envp[j+2] (gdb) $1 = 0x7ffff7ffa000 "\177ELF\002\001\001" (gdb) print envp[j+1] (gdb) $2 = 0x21 <Address 0x21 out of bounds> -------------------- 8< -------------------- 8< ------------------------------------------- i was able to dump 20480 bytes only:( but i've found out that this is working code: -------------------- 8< -------------------- 8< ------------------------------------------- Program header: type fileoffs virtaddr physaddr filesize memsize flg align Loadable 00000000 FFFFFFFFFF700000 FFFFFFFFFF700000 00000D6D 00000D6D X R 00001000 Dynalinking 000004D0 FFFFFFFFFF7004D0 FFFFFFFFFF7004D0 000000F0 000000F0 R 00000008 Auxiliary 00000318 FFFFFFFFFF700318 FFFFFFFFFF700318 0000003C 0000003C R 00000004 Unknown 00000354 FFFFFFFFFF700354 FFFFFFFFFF700354 0000003C 0000003C R 00000004 Sections header: name type flg virtaddr fileoffs size link info algn esiz NULL 00000000 00000000 00000000 0000 0000 0000 0000 .hash HSHTAB A FFFFFFFFFF700120 00000120 00000040 0002 0000 0008 0004 .dynsym DYNSYM A FFFFFFFFFF700160 00000160 00000108 0003 0002 0008 0018 .dynstr STRTAB A FFFFFFFFFF700268 00000268 0000005E 0000 0000 0001 0000 .gnu.version SYMVER A FFFFFFFFFF7002C6 000002C6 00000016 0002 0000 0002 0002 .gnu.version_d VERDEF A FFFFFFFFFF7002E0 000002E0 00000038 0003 0002 0008 0000 .note NOTES A FFFFFFFFFF700318 00000318 0000003C 0000 0000 0004 0000 .eh_frame_hdr PRGBTS A FFFFFFFFFF700354 00000354 0000003C 0000 0000 0004 0000 .eh_frame PRGBTS A FFFFFFFFFF700390 00000390 00000140 0000 0000 0008 0000 .dynamic DYNLNK WA FFFFFFFFFF7004D0 000004D0 000000F0 0003 0000 0008 0010 .rodata PRGBTS A FFFFFFFFFF7005C0 000005C0 00000020 0000 0000 0008 0001 __bug_table PRGBTS A FFFFFFFFFF7005E0 000005E0 0000000C 0000 0000 0001 0000 .discard PRGBTS WA FFFFFFFFFF7005EC 000005EC 00000006 0000 0000 0001 0000 .altinstructions PRGBTS A FFFFFFFFFF7005F2 000005F2 00000048 0000 0000 0001 0000 .altinstr_replacement PRGBTS AX FFFFFFFFFF70063A 0000063A 00000012 0000 0000 0001 0000 .text PRGBTS AX FFFFFFFFFF700700 00000700 0000066D 0000 0000 0010 0000 .comment PRGBTS 00000000 00000D6D 00000027 0000 0000 0001 0001 .shstrtab STRTAB 00000000 00000D94 000000B7 0000 0000 0001 0000 Dynamic linking information: Interpreter : SO name: linux-vdso.so.1 Dynamic section: vma=0000000000000000H vma=FFFFFFFFFF700354H clock_gettime vma=FFFFFFFFFF700880H LINUX_2.6 vma=0000000000000000H __vdso_gettimeofday vma=FFFFFFFFFF700B80H __vdso_getcpu vma=FFFFFFFFFF700D30H gettimeofday vma=FFFFFFFFFF700B80H time vma=FFFFFFFFFF700D10H getcpu vma=FFFFFFFFFF700D30H __vdso_clock_gettime vma=FFFFFFFFFF700880H __vdso_time vma=FFFFFFFFFF700D10H -------------------- 8< -------------------- 8< ------------------------------------------- ; ;Disassembler dump of 'file' ;Range : 700H- 5000H ;Written by Binary EYE v svn.104-x86_64-unknown-linux-gnu Build: May 9 2013 ;Dumped : Wed May 22 09:23:19 2013 ;Format : ELF (Executable and Linking Format) SEGMENT .altinstr_replacement BYTE PUBLIC USE64 'CODE' ; size: 18 bytes L0000063A: mfence ; 0FAEF0 L0000063D: lfence ; 0FAEE8 L00000640: mfence ; 0FAEF0 L00000643: lfence ; 0FAEE8 L00000646: mfence ; 0FAEF0 L00000649: lfence ; 0FAEE8 SEGMENT Unknown0 BYTE PUBLIC USE64 'NoObject' ; size: 180 bytes ; L000000000000064cH-L0000000000000700H - no object resb b4H SEGMENT .text BYTE PUBLIC USE64 'CODE' ; size: 1645 bytes public !: ; ... L00000700: push rbp ; 55 L00000701: mov rbp,rsp ; 4889E5 L00000704: mfence ; 0FAEF0 L00000707: nop ; 666690 L0000070A: rdtsc ; 0F31 L0000070C: shl (q) rdx,20 ; ' ' ; 48C1E220 L00000710: mov eax,eax ; 89C0 L00000712: or rdx,rax ; 4809C2 L00000715: mov rax,[-00A00F70] ; 488B042590F05FFF L0000071D: cmp rax,rdx ; 4839D0 L00000720: ja L00000727 ; LEAVE ; 7705 L00000722: mov rax,rdx ; 4889D0 L00000725: pop rbp ; 5D L00000726: retn ; C3 L00000727: pop rbp ; 5D L00000728: retn ; C3 L00000729: nop eax,[rax+00000000] ; 0F1F8000000000 L00000730: push rbp ; 55 L00000731: mov r10d,0000007B ; 41BA7B000000 L00000737: lsl r10d,r10d ; 450F03D2 L0000073B: mov rbp,rsp ; 4889E5 L0000073E: push r15 ; 4157 L00000740: push r14 ; 4156 L00000742: push r13 ; 4155 L00000744: push r12 ; 4154 L00000746: push rbx ; 53 L00000747: mov r13d,[-00A00FF0] ; 448B2C2510F05FFF L0000074F: mov ebx,r10d ; 4489D3 L00000752: cmp (d) r13d,+01 ; 4183FD01 L00000756: mov ecx,r10d ; 4489D1 L00000759: je L00000850 ; 0F84F1000000 L0000075F: mov r9d,ecx ; 4189C9 L00000762: and (d) ecx,+3F ; '?' ; 83E13F L00000765: and r9d,00000FFF ; 4181E1FF0F0000 L0000076C: movsxd rsi,rcx ; 4863F1 L0000076F: test (d) r9d,00000FC0 ; 41F7C1C00F0000 L00000776: jne L00000875 ; 0F85F9000000 L0000077C: shl (q) rsi,06 ; 48C1E606 L00000780: mov r12d,[rsi-00A02FE0] ; 448BA620D05FFF L00000787: mov r11d,[rsi-00A03000] ; 448B9E00D05FFF L0000078E: mfence ; 0FAEF0 L00000791: nop ; 666690 L00000794: rdtsc ; 0F31 L00000796: shl (q) rdx,20 ; ' ' ; 48C1E220 L0000079A: mov eax,eax ; 89C0 L0000079C: movsx ecx,[rsi-00A02FE4] ; 0FBE8E1CD05FFF L000007A3: or rdx,rax ; 4809C2 L000007A6: sub rdx,[rsi-00A02FF8] ; 482B9608D05FFF L000007AD: mov eax,[rsi-00A02FE8] ; 8B8618D05FFF L000007B3: mov r8,rdx ; 4989D0 L000007B6: shl (q) r8,cl ; 49D3E0 L000007B9: test ecx,ecx ; 85C9 L000007BB: js L00000868 ; 0F88A7000000 L000007C1: mov edx,eax ; 89C2 L000007C3: mov r14,[rsi-00A02FF0] ; 4C8BB610D05FFF L000007CA: mov rax,r8 ; 4C89C0 L000007CD: movzx r15d,[rsi-00A02FE3] ; 440FB6BE1DD05FFF L000007D5: mul (q) rdx ; 48F7E2 L000007D8: shrd rax,rdx,20 ; 480FACD020 L000007DD: mov r8,rax ; 4989C0 L000007E0: mfence ; 0FAEF0 L000007E3: nop ; 666690 L000007E6: mov r13d,[-00A00FF0] ; 448B2C2510F05FFF L000007EE: mov ecx,ebx ; 89D9 L000007F0: cmp (d) r13d,+01 ; 4183FD01 L000007F4: je L00000860 ; 746A L000007F6: and ecx,00000FFF ; 81E1FF0F0000 L000007FC: cmp r9d,ecx ; 4139C9 L000007FF: jne L00000752 ; 0F854DFFFFFF L00000805: mov eax,[rsi-00A03000] ; 8B8600D05FFF L0000080B: test al,01 ; A801 L0000080D: jne L00000752 ; 0F853FFFFFFF L00000813: cmp eax,r11d ; 4439D8 L00000816: jne L00000752 ; 0F8536FFFFFF L0000081C: cmp r12d,[rsi-00A02FE0] ; 443BA620D05FFF L00000823: jne L00000752 ; 0F8529FFFFFF L00000829: and (d) r15d,+01 ; 4183E701 L0000082D: je L00000877 ; 7448 L0000082F: pop rbx ; 5B L00000830: pop r12 ; 415C L00000832: mov rax,[-00A00F70] ; 488B042590F05FFF L0000083A: add r8,r14 ; 4D01F0 L0000083D: pop r13 ; 415D L0000083F: pop r14 ; 415E L00000841: cmp r8,rax ; 4939C0 L00000844: pop r15 ; 415F L00000846: cmovnc rax,r8 ; 490F43C0 L0000084A: pop rbp ; 5D L0000084B: retn ; C3 L0000084C: nop eax,[rax+00] ; 0F1F4000 L00000850: invlpg ecx ; 0F01F9 L00000853: jmpn L0000075F ; E907FFFFFF L00000858: nop eax,[rax+rax+00000000] ; 0F1F840000000000 L00000860: invlpg ecx ; 0F01F9 L00000863: jmps L000007F6 ; EB91 L00000865: nop eax,[rax] ; 0F1F00 L00000868: neg (d) ecx ; F7D9 L0000086A: shr (q) rdx,cl ; 48D3EA L0000086D: mov r8,rdx ; 4989D0 L00000870: jmpn L000007C1 ; E94CFFFFFF L00000875: ud ; 0F0B L00000877: mov (d) [rdi],00000000 ; C70700000000 L0000087D: jmps L0000082F ; EBB0 L0000087F: nop ; 90 public !: public !: L00000880: push rbp ; 55 L00000881: mov rbp,rsp ; 4889E5 L00000884: push r14 ; 4156 L00000886: push r13 ; 4155 L00000888: push r12 ; 4154 L0000088A: push rbx ; 53 L0000088B: mov ebx,edi ; 89FB L0000088D: sub (q) rsp,+10 ; 4883EC10 L00000891: cmp (d) edi,+01 ; 83FF01 L00000894: je L00000A00 ; 0F8466010000 L0000089A: jle L00000950 ; 0F8EB0000000 L000008A0: cmp (d) edi,+05 ; 83FF05 L000008A3: je L000008F0 ; 744B L000008A5: cmp (d) edi,+06 ; 83FF06 L000008A8: jne L00000939 ; 0F858B000000 L000008AE: mov eax,[-00A00F80] ; 8B042580F05FFF L000008B5: test al,01 ; A801 L000008B7: jne L00000B61 ; 0F85A4020000 L000008BD: mov rdx,[-00A00F20] ; 488B1425E0F05FFF L000008C5: mov [rsi],rdx ; 488916 L000008C8: mov rdx,[-00A00F18] ; 488B1425E8F05FFF L000008D0: mov [rsi+08],rdx ; 48895608 L000008D4: cmp eax,[-00A00F80] ; 3B042580F05FFF L000008DB: jne L000008AE ; 75D1 L000008DD: add (q) rsp,+10 ; 4883C410 L000008E1: xor eax,eax ; 31C0 L000008E3: pop rbx ; 5B L000008E4: pop r12 ; 415C L000008E6: pop r13 ; 415D L000008E8: pop r14 ; 415E L000008EA: pop rbp ; 5D L000008EB: retn ; C3 L000008EC: pause ; F390 L000008EE: nop ; 6690 L000008F0: mov eax,[-00A00F80] ; 8B042580F05FFF L000008F7: test al,01 ; A801 L000008F9: jne L000008EC ; 75F1 L000008FB: mov rdx,[-00A00F30] ; 488B1425D0F05FFF L00000903: mov [rsi],rdx ; 488916 L00000906: mov rdx,[-00A00F28] ; 488B1425D8F05FFF L0000090E: mov [rsi+08],rdx ; 48895608 L00000912: cmp eax,[-00A00F80] ; 3B042580F05FFF L00000919: je L000008DD ; 74C2 L0000091B: jmps L000008F0 ; EBD3 L0000091D: nop eax,[rax] ; 0F1F00 L00000920: xor edx,edx ; 31D2 L00000922: nop ax,[rax+rax+00] ; 660F1F440000 L00000928: add rdi,rdx ; 4801D7 L0000092B: mov [rsi+08],rax ; 48894608 L0000092F: mov [rsi],rdi ; 48893E L00000932: mov eax,[rbp-24] ; 8B45DC L00000935: test eax,eax ; 85C0 L00000937: jne L000008DD ; 75A4 L00000939: movsxd rdi,rbx ; 4863FB L0000093C: mov eax,000000E4 ; B8E4000000 ;; __NR_clock_gettime L00000941: syscall ; 0F05 L00000943: add (q) rsp,+10 ; 4883C410 L00000947: pop rbx ; 5B L00000948: pop r12 ; 415C L0000094A: pop r13 ; 415D L0000094C: pop r14 ; 415E L0000094E: pop rbp ; 5D L0000094F: retn ; C3 L00000950: test edi,edi ; 85FF L00000952: jne L00000939 ; 75E5 L00000954: lea r14,[rbp-24] ; 4C8D75DC L00000958: mov (q) [rsi+08],00000000 ; 48C7460800000000 L00000960: mov r12d,[-00A00F80] ; 448B242580F05FFF L00000968: test (b) r12b,01 ; 41F6C401 L0000096C: jne L00000B68 ; 0F85F6010000 L00000972: mov eax,[-00A00F78] ; 8B042588F05FFF L00000979: mov [rbp-24],eax ; 8945DC L0000097C: mov rax,[-00A00F58] ; 488B0425A8F05FFF L00000984: mov [rsi],rax ; 488906 L00000987: mov edx,[-00A00F78] ; 8B142588F05FFF L0000098E: mov r13,[-00A00F50] ; 4C8B2C25B0F05FFF L00000996: cmp (d) edx,+01 ; 83FA01 L00000999: je L00000AE0 ; 0F8441010000 L0000099F: cmp (d) edx,+02 ; 83FA02 L000009A2: je L00000B20 ; 0F8478010000 L000009A8: xor eax,eax ; 31C0 L000009AA: cmp (d) edx,+03 ; 83FA03 L000009AD: je L00000B48 ; 0F8495010000 L000009B3: mov ecx,[-00A00F5C] ; 8B0C25A4F05FFF L000009BA: cmp r12d,[-00A00F80] ; 443B242580F05FFF L000009C2: jne L00000960 ; 759C L000009C4: add rax,r13 ; 4C01E8 L000009C7: mov rdi,[rsi] ; 488B3E L000009CA: shr (q) rax,cl ; 48D3E8 L000009CD: add rax,[rsi+08] ; 48034608 L000009D1: cmp rax,3B9AC9FF ; 483DFFC99A3B L000009D7: jna L00000920 ; 0F8643FFFFFF L000009DD: xor edx,edx ; 31D2 L000009DF: nop ; 90 L000009E0: sub rax,3B9ACA00 ; 482D00CA9A3B L000009E6: add (d) edx,+01 ; 83C201 L000009E9: cmp rax,3B9AC9FF ; 483DFFC99A3B L000009EF: ja L000009E0 ; 77EF L000009F1: jmpn L00000928 ; E932FFFFFF L000009F6: nop ax,[cs:rax+rax+00000000] ; 662E0F1F840000000000 L00000A00: lea r14,[rbp-24] ; 4C8D75DC L00000A04: mov (q) [rsi+08],00000000 ; 48C7460800000000 L00000A0C: mov r12d,[-00A00F80] ; 448B242580F05FFF L00000A14: test (b) r12b,01 ; 41F6C401 L00000A18: jne L00000B5A ; 0F853C010000 L00000A1E: mov eax,[-00A00F78] ; 8B042588F05FFF L00000A25: mov [rbp-24],eax ; 8945DC L00000A28: mov rax,[-00A00F40] ; 488B0425C0F05FFF L00000A30: mov [rsi],rax ; 488906 L00000A33: mov edx,[-00A00F78] ; 8B142588F05FFF L00000A3A: mov r13,[-00A00F48] ; 4C8B2C25B8F05FFF L00000A42: cmp (d) edx,+01 ; 83FA01 L00000A45: je L00000AB0 ; 7469 L00000A47: cmp (d) edx,+02 ; 83FA02 L00000A4A: je L00000B10 ; 0F84C0000000 L00000A50: xor eax,eax ; 31C0 L00000A52: cmp (d) edx,+03 ; 83FA03 L00000A55: je L00000B30 ; 0F84D5000000 L00000A5B: mov ecx,[-00A00F5C] ; 8B0C25A4F05FFF L00000A62: cmp r12d,[-00A00F80] ; 443B242580F05FFF L00000A6A: jne L00000A0C ; 75A0 L00000A6C: add rax,r13 ; 4C01E8 L00000A6F: mov rdi,[rsi] ; 488B3E L00000A72: shr (q) rax,cl ; 48D3E8 L00000A75: add rax,[rsi+08] ; 48034608 L00000A79: cmp rax,3B9AC9FF ; 483DFFC99A3B L00000A7F: jna L00000920 ; 0F869BFEFFFF L00000A85: xor edx,edx ; 31D2 L00000A87: nop ax,[rax+rax+00000000] ; 660F1F840000000000 L00000A90: sub rax,3B9ACA00 ; 482D00CA9A3B L00000A96: add (d) edx,+01 ; 83C201 L00000A99: cmp rax,3B9AC9FF ; 483DFFC99A3B L00000A9F: ja L00000A90 ; 77EF L00000AA1: jmpn L00000928 ; E982FEFFFF L00000AA6: nop ax,[cs:rax+rax+00000000] ; 662E0F1F840000000000 L00000AB0: mov [rbp-30],rsi ; 488975D0 L00000AB4: calln L00000700 ; E847FCFFFF L00000AB9: mov rsi,[rbp-30] ; 488B75D0 L00000ABD: sub rax,[-00A00F70] ; 482B042590F05FFF L00000AC5: mov edx,[-00A00F60] ; 8B1425A0F05FFF L00000ACC: and rax,[-00A00F68] ; 4823042598F05FFF L00000AD4: imul rax,rdx ; 480FAFC2 L00000AD8: jmps L00000A5B ; EB81 L00000ADA: nop ax,[rax+rax+00] ; 660F1F440000 L00000AE0: mov [rbp-30],rsi ; 488975D0 L00000AE4: calln L00000700 ; E817FCFFFF L00000AE9: mov rsi,[rbp-30] ; 488B75D0 L00000AED: sub rax,[-00A00F70] ; 482B042590F05FFF L00000AF5: mov edx,[-00A00F60] ; 8B1425A0F05FFF L00000AFC: and rax,[-00A00F68] ; 4823042598F05FFF L00000B04: imul rax,rdx ; 480FAFC2 L00000B08: jmpn L000009B3 ; E9A6FEFFFF L00000B0D: nop eax,[rax] ; 0F1F00 L00000B10: mov eax,[-00A01F10] ; 8B0425F0E05FFF L00000B17: mov eax,eax ; 89C0 L00000B19: jmps L00000ABD ; EBA2 L00000B1B: nop eax,[rax+rax+00] ; 0F1F440000 L00000B20: mov eax,[-00A01F10] ; 8B0425F0E05FFF L00000B27: mov eax,eax ; 89C0 L00000B29: jmps L00000AED ; EBC2 L00000B2B: nop eax,[rax+rax+00] ; 0F1F440000 L00000B30: mov rdi,r14 ; 4C89F7 L00000B33: mov [rbp-30],rsi ; 488975D0 L00000B37: calln L00000730 ; E8F4FBFFFF L00000B3C: mov rsi,[rbp-30] ; 488B75D0 L00000B40: jmpn L00000ABD ; E978FFFFFF L00000B45: nop eax,[rax] ; 0F1F00 L00000B48: mov rdi,r14 ; 4C89F7 L00000B4B: mov [rbp-30],rsi ; 488975D0 L00000B4F: calln L00000730 ; E8DCFBFFFF L00000B54: mov rsi,[rbp-30] ; 488B75D0 L00000B58: jmps L00000AED ; EB93 L00000B5A: pause ; F390 L00000B5C: jmpn L00000A0C ; E9ABFEFFFF L00000B61: pause ; F390 L00000B63: jmpn L000008AE ; E946FDFFFF L00000B68: pause ; F390 L00000B6A: nop ax,[rax+rax+00] ; 660F1F440000 L00000B70: jmpn L00000960 ; E9EBFDFFFF L00000B75: nop eax,[cs:rax+rax+00000000] ; 66662E0F1F840000000000 public !: public !: L00000B80: push rbp ; 55 L00000B81: mov rbp,rsp ; 4889E5 L00000B84: push r14 ; 4156 L00000B86: push r13 ; 4155 L00000B88: push r12 ; 4154 L00000B8A: push rbx ; 53 L00000B8B: mov rbx,rdi ; 4889FB L00000B8E: sub (q) rsp,+10 ; 4883EC10 L00000B92: test rdi,rdi ; 4885FF L00000B95: je L00000D08 ; 0F846D010000 L00000B9B: lea r14,[rbp-24] ; 4C8D75DC L00000B9F: mov (q) [rdi+08],00000000 ; 48C7470800000000 L00000BA7: mov r12d,[-00A00F80] ; 448B242580F05FFF L00000BAF: test (b) r12b,01 ; 41F6C401 L00000BB3: jne L00000D01 ; 0F8548010000 L00000BB9: mov eax,[-00A00F78] ; 8B042588F05FFF L00000BC0: mov [rbp-24],eax ; 8945DC L00000BC3: mov rax,[-00A00F58] ; 488B0425A8F05FFF L00000BCB: mov [rbx],rax ; 488903 L00000BCE: mov edx,[-00A00F78] ; 8B142588F05FFF L00000BD5: mov r13,[-00A00F50] ; 4C8B2C25B0F05FFF L00000BDD: cmp (d) edx,+01 ; 83FA01 L00000BE0: je L00000C90 ; 0F84AA000000 L00000BE6: cmp (d) edx,+02 ; 83FA02 L00000BE9: je L00000CC0 ; 0F84D1000000 L00000BEF: xor eax,eax ; 31C0 L00000BF1: cmp (d) edx,+03 ; 83FA03 L00000BF4: je L00000CD0 ; 0F84D6000000 L00000BFA: mov ecx,[-00A00F5C] ; 8B0C25A4F05FFF L00000C01: cmp r12d,[-00A00F80] ; 443B242580F05FFF L00000C09: jne L00000BA7 ; 759C L00000C0B: lea r8,[rax+r13+00] ; 4D8D440500 L00000C10: mov rdi,[rbx] ; 488B3B L00000C13: shr (q) r8,cl ; 49D3E8 L00000C16: add r8,[rbx+08] ; 4C034308 L00000C1A: cmp r8,3B9AC9FF ; 4981F8FFC99A3B L00000C21: jna L00000CE2 ; 0F86BB000000 L00000C27: xor edx,edx ; 31D2 L00000C29: nop eax,[rax+00000000] ; 0F1F8000000000 L00000C30: mov rax,r8 ; 4C89C0 L00000C33: add (d) edx,+01 ; 83C201 L00000C36: lea r8,[rax-3B9ACA00] ; 4C8D80003665C4 L00000C3D: cmp r8,3B9AC9FF ; 4981F8FFC99A3B L00000C44: ja L00000C30 ; 77EA L00000C46: add rdi,rdx ; 4801D7 L00000C49: mov rax,r8 ; 4C89C0 L00000C4C: mov rdx,20C49BA5E353F7CF ; 48BACFF753E3A59BC420 L00000C56: imul (q) rdx ; 48F7EA L00000C59: movsxd rcx,[rbp-24] ; 48634DDC L00000C5D: sar (q) r8,3F ; '?' ; 49C1F83F L00000C61: mov [rbx],rdi ; 48893B L00000C64: sar (q) rdx,07 ; 48C1FA07 L00000C68: sub rdx,r8 ; 4C29C2 L00000C6B: mov [rbx+08],rdx ; 48895308 L00000C6F: test rsi,rsi ; 4885F6 L00000C72: jne L00000CE9 ; 7575 L00000C74: xor eax,eax ; 31C0 L00000C76: test rcx,rcx ; 4885C9 L00000C79: jne L00000C82 ; 7507 L00000C7B: mov al,60 ; '`' ; B060 ;; __NR_gettimeofday L00000C7D: mov rdi,rbx ; 4889DF L00000C80: syscall ; 0F05 L00000C82: add (q) rsp,+10 ; 4883C410 L00000C86: pop rbx ; 5B L00000C87: pop r12 ; 415C L00000C89: pop r13 ; 415D L00000C8B: pop r14 ; 415E L00000C8D: pop rbp ; 5D L00000C8E: retn ; C3 L00000C8F: nop ; 90 L00000C90: mov [rbp-30],rsi ; 488975D0 L00000C94: calln L00000700 ; E867FAFFFF L00000C99: mov rsi,[rbp-30] ; 488B75D0 L00000C9D: sub rax,[-00A00F70] ; 482B042590F05FFF L00000CA5: mov edx,[-00A00F60] ; 8B1425A0F05FFF L00000CAC: and rax,[-00A00F68] ; 4823042598F05FFF L00000CB4: imul rax,rdx ; 480FAFC2 L00000CB8: jmpn L00000BFA ; E93DFFFFFF L00000CBD: nop eax,[rax] ; 0F1F00 L00000CC0: mov eax,[-00A01F10] ; 8B0425F0E05FFF L00000CC7: mov eax,eax ; 89C0 L00000CC9: jmps L00000C9D ; EBD2 L00000CCB: nop eax,[rax+rax+00] ; 0F1F440000 L00000CD0: mov rdi,r14 ; 4C89F7 L00000CD3: mov [rbp-30],rsi ; 488975D0 L00000CD7: calln L00000730 ; E854FAFFFF L00000CDC: mov rsi,[rbp-30] ; 488B75D0 L00000CE0: jmps L00000C9D ; EBBB L00000CE2: xor edx,edx ; 31D2 L00000CE4: jmpn L00000C46 ; E95DFFFFFF L00000CE9: mov eax,[-00A00F38] ; 8B0425C8F05FFF L00000CF0: mov [rsi],eax ; 8906 L00000CF2: mov eax,[-00A00F34] ; 8B0425CCF05FFF L00000CF9: mov [rsi+04],eax ; 894604 L00000CFC: jmpn L00000C74 ; E973FFFFFF L00000D01: pause ; F390 L00000D03: jmpn L00000BA7 ; E99FFEFFFF L00000D08: xor ecx,ecx ; 31C9 L00000D0A: jmpn L00000C6F ; E960FFFFFF L00000D0F: nop ; 90 public !: L00000D10: push rbp ; 55 L00000D11: test rdi,rdi ; 4885FF L00000D14: mov rax,[-00A00F58] ; 488B0425A8F05FFF L00000D1C: mov rbp,rsp ; 4889E5 L00000D1F: je L00000D24 ; LEAVE ; 7403 L00000D21: mov [rdi],rax ; 488907 L00000D24: pop rbp ; 5D L00000D25: retn ; C3 L00000D26: nop ; 90 L00000D27: nop ; 90 L00000D28: nop ; 90 L00000D29: nop ; 90 L00000D2A: nop ; 90 L00000D2B: nop ; 90 L00000D2C: nop ; 90 L00000D2D: nop ; 90 L00000D2E: nop ; 90 L00000D2F: nop ; 90 public !: public !: L00000D30: push rbp ; 55 L00000D31: cmp (d) [-00A00FF0],+01 ; 833C2510F05FFF01 L00000D39: mov rbp,rsp ; 4889E5 L00000D3C: je L00000D68 ; 742A L00000D3E: mov ecx,0000007B ; B97B000000 L00000D43: lsl ecx,ecx ; 0F03C9 L00000D46: test rdi,rdi ; 4885FF L00000D49: je L00000D54 ; 7409 L00000D4B: mov eax,ecx ; 89C8 L00000D4D: and eax,00000FFF ; 25FF0F0000 L00000D52: mov [rdi],eax ; 8907 L00000D54: test rsi,rsi ; 4885F6 L00000D57: je L00000D5E ; 7405 L00000D59: shr (d) ecx,0C ; C1E90C L00000D5C: mov [rsi],ecx ; 890E L00000D5E: xor eax,eax ; 31C0 L00000D60: pop rbp ; 5D L00000D61: retn ; C3 L00000D62: nop ax,[rax+rax+00] ; 660F1F440000 L00000D68: invlpg ecx ; 0F01F9 L00000D6B: jmps L00000D46 ; EBD9 SEGMENT Unknown0 BYTE PUBLIC USE64 'NoObject' ; size: 17043 bytes ; L0000000000000D6DH-L0000000000005000H - no object resb 4293H -------------------- 8< -------------------- 8< ------------------------------------------- dumphex -C dump: -------------------- 8< -------------------- 8< ------------------------------------------- 00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............| 00000010 03 00 3e 00 01 00 00 00 00 07 70 ff ff ff ff ff |..>.......p.....| 00000020 40 00 00 00 00 00 00 00 50 0e 00 00 00 00 00 00 |@.......P.......| 00000030 00 00 00 00 40 00 38 00 04 00 40 00 12 00 11 00 |....@.8...@.....| 00000040 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 70 ff ff ff ff ff 00 00 70 ff ff ff ff ff |..p.......p.....| 00000060 6d 0d 00 00 00 00 00 00 6d 0d 00 00 00 00 00 00 |m.......m.......| 00000070 00 10 00 00 00 00 00 00 02 00 00 00 04 00 00 00 |................| 00000080 d0 04 00 00 00 00 00 00 d0 04 70 ff ff ff ff ff |..........p.....| 00000090 d0 04 70 ff ff ff ff ff f0 00 00 00 00 00 00 00 |..p.............| 000000a0 f0 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 |................| 000000b0 04 00 00 00 04 00 00 00 18 03 00 00 00 00 00 00 |................| 000000c0 18 03 70 ff ff ff ff ff 18 03 70 ff ff ff ff ff |..p.......p.....| 000000d0 3c 00 00 00 00 00 00 00 3c 00 00 00 00 00 00 00 |<.......<.......| 000000e0 04 00 00 00 00 00 00 00 50 e5 74 64 04 00 00 00 |........P.td....| 000000f0 54 03 00 00 00 00 00 00 54 03 70 ff ff ff ff ff |T.......T.p.....| 00000100 54 03 70 ff ff ff ff ff 3c 00 00 00 00 00 00 00 |T.p.....<.......| 00000110 3c 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 |<...............| 00000120 03 00 00 00 0b 00 00 00 0a 00 00 00 06 00 00 00 |................| 00000130 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000140 00 00 00 00 03 00 00 00 04 00 00 00 00 00 00 00 |................| 00000150 02 00 00 00 05 00 00 00 07 00 00 00 08 00 00 00 |................| 00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000170 00 00 00 00 00 00 00 00 00 00 00 00 03 00 07 00 |................| 00000180 54 03 70 ff ff ff ff ff 00 00 00 00 00 00 00 00 |T.p.............| 00000190 08 00 00 00 22 00 0f 00 80 08 70 ff ff ff ff ff |....".....p.....| 000001a0 f5 02 00 00 00 00 00 00 54 00 00 00 11 00 f1 ff |........T.......| 000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000001c0 16 00 00 00 12 00 0f 00 80 0b 70 ff ff ff ff ff |..........p.....| 000001d0 8f 01 00 00 00 00 00 00 36 00 00 00 12 00 0f 00 |........6.......| 000001e0 30 0d 70 ff ff ff ff ff 3d 00 00 00 00 00 00 00 |0.p.....=.......| 000001f0 1d 00 00 00 22 00 0f 00 80 0b 70 ff ff ff ff ff |....".....p.....| 00000200 8f 01 00 00 00 00 00 00 31 00 00 00 22 00 0f 00 |........1..."...| 00000210 10 0d 70 ff ff ff ff ff 16 00 00 00 00 00 00 00 |..p.............| 00000220 3d 00 00 00 22 00 0f 00 30 0d 70 ff ff ff ff ff |=..."...0.p.....| 00000230 3d 00 00 00 00 00 00 00 01 00 00 00 12 00 0f 00 |=...............| 00000240 80 08 70 ff ff ff ff ff f5 02 00 00 00 00 00 00 |..p.............| 00000250 2a 00 00 00 12 00 0f 00 10 0d 70 ff ff ff ff ff |*.........p.....| 00000260 16 00 00 00 00 00 00 00 00 5f 5f 76 64 73 6f 5f |.........__vdso_| 00000270 63 6c 6f 63 6b 5f 67 65 74 74 69 6d 65 00 5f 5f |clock_gettime.__| 00000280 76 64 73 6f 5f 67 65 74 74 69 6d 65 6f 66 64 61 |vdso_gettimeofda| 00000290 79 00 5f 5f 76 64 73 6f 5f 74 69 6d 65 00 5f 5f |y.__vdso_time.__| 000002a0 76 64 73 6f 5f 67 65 74 63 70 75 00 6c 69 6e 75 |vdso_getcpu.linu| 000002b0 78 2d 76 64 73 6f 2e 73 6f 2e 31 00 4c 49 4e 55 |x-vdso.so.1.LINU| 000002c0 58 5f 32 2e 36 00 00 00 00 00 02 00 02 00 02 00 |X_2.6...........| 000002d0 02 00 02 00 02 00 02 00 02 00 02 00 00 00 00 00 |................| 000002e0 01 00 01 00 01 00 01 00 a1 bf ee 0d 14 00 00 00 |................| 000002f0 1c 00 00 00 44 00 00 00 00 00 00 00 01 00 00 00 |....D...........| 00000300 02 00 01 00 f6 75 ae 03 14 00 00 00 00 00 00 00 |.....u..........| 00000310 54 00 00 00 00 00 00 00 06 00 00 00 04 00 00 00 |T...............| 00000320 00 00 00 00 4c 69 6e 75 78 00 00 00 02 09 03 00 |....Linux.......| 00000330 04 00 00 00 14 00 00 00 03 00 00 00 47 4e 55 00 |............GNU.| 00000340 83 52 ba df 0e b4 f5 55 c7 4d 8e f7 72 30 8c 3b |.R.....U.M..r0.;| 00000350 ed 1b ee a2 01 1b 03 3b 38 00 00 00 06 00 00 00 |.......;8.......| 00000360 ac 03 00 00 54 00 00 00 dc 03 00 00 7c 00 00 00 |....T.......|...| 00000370 2c 05 00 00 b4 00 00 00 2c 08 00 00 fc 00 00 00 |,.......,.......| 00000380 bc 09 00 00 34 01 00 00 dc 09 00 00 54 01 00 00 |....4.......T...| 00000390 14 00 00 00 00 00 00 00 01 7a 52 00 01 78 10 01 |.........zR..x..| 000003a0 1b 0c 07 08 90 01 00 00 24 00 00 00 1c 00 00 00 |........$.......| 000003b0 50 03 00 00 29 00 00 00 00 41 0e 10 86 02 43 0d |P...)....A....C.| 000003c0 06 62 0a c6 0c 07 08 41 0b 41 c6 0c 07 08 00 00 |.b.....A.A......| 000003d0 34 00 00 00 44 00 00 00 58 03 00 00 4f 01 00 00 |4...D...X...O...| 000003e0 00 41 0e 10 86 02 4d 0d 06 49 8f 03 8e 04 8d 05 |.A....M..I......| 000003f0 8c 06 83 07 02 e9 0a c3 42 cc 4d cd 42 ce 45 cf |........B.M.B.E.| 00000400 45 c6 0c 07 08 45 0b 00 44 00 00 00 7c 00 00 00 |E....E..D...|...| 00000410 70 04 00 00 f5 02 00 00 00 41 0e 10 86 02 43 0d |p........A....C.| 00000420 06 47 8e 03 8d 04 8c 05 83 06 02 59 0a c3 42 cc |.G.........Y..B.| 00000430 42 cd 42 ce 41 c6 0c 07 08 41 0b 02 5c 0a c3 42 |B.B.A....A..\..B| 00000440 cc 42 cd 42 ce 41 c6 0c 07 08 41 0b 00 00 00 00 |.B.B.A....A.....| 00000450 34 00 00 00 c4 00 00 00 28 07 00 00 8f 01 00 00 |4.......(.......| 00000460 00 41 0e 10 86 02 43 0d 06 47 8e 03 8d 04 8c 05 |.A....C..G......| 00000470 83 06 02 fc 0a c3 42 cc 42 cd 42 ce 41 c6 0c 07 |......B.B.B.A...| 00000480 08 42 0b 00 00 00 00 00 1c 00 00 00 fc 00 00 00 |.B..............| 00000490 80 08 00 00 16 00 00 00 00 41 0e 10 86 02 4e 0d |.........A....N.| 000004a0 06 46 c6 0c 07 08 00 00 24 00 00 00 1c 01 00 00 |.F......$.......| 000004b0 80 08 00 00 3d 00 00 00 00 41 0e 10 86 02 4b 0d |....=....A....K.| 000004c0 06 65 0a c6 0c 07 08 47 0b 00 00 00 00 00 00 00 |.e.....G........| 000004d0 0e 00 00 00 00 00 00 00 44 00 00 00 00 00 00 00 |........D.......| 000004e0 04 00 00 00 00 00 00 00 20 01 70 ff ff ff ff ff |........ .p.....| 000004f0 05 00 00 00 00 00 00 00 68 02 70 ff ff ff ff ff |........h.p.....| 00000500 06 00 00 00 00 00 00 00 60 01 70 ff ff ff ff ff |........`.p.....| 00000510 0a 00 00 00 00 00 00 00 5e 00 00 00 00 00 00 00 |........^.......| 00000520 0b 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 |................| 00000530 fc ff ff 6f 00 00 00 00 e0 02 70 ff ff ff ff ff |...o......p.....| 00000540 fd ff ff 6f 00 00 00 00 02 00 00 00 00 00 00 00 |...o............| 00000550 f0 ff ff 6f 00 00 00 00 c6 02 70 ff ff ff ff ff |...o......p.....| 00000560 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000005c0 61 72 63 68 2f 78 38 36 2f 76 64 73 6f 2f 76 63 |arch/x86/vdso/vc| 000005d0 6c 6f 63 6b 5f 67 65 74 74 69 6d 65 2e 63 00 00 |lock_gettime.c..| 000005e0 95 02 00 00 e0 ff ff ff 4a 00 00 00 ff ff ff ff |........J.......| 000005f0 ff ff 12 01 00 00 44 00 00 00 71 00 03 03 09 01 |......D...q.....| 00000600 00 00 3b 00 00 00 72 00 03 03 84 01 00 00 32 00 |..;...r.......2.| 00000610 00 00 71 00 03 03 7b 01 00 00 29 00 00 00 72 00 |..q...{...)...r.| 00000620 03 03 be 01 00 00 20 00 00 00 71 00 03 03 b5 01 |...... ...q.....| 00000630 00 00 17 00 00 00 72 00 03 03 0f ae f0 0f ae e8 |......r.........| 00000640 0f ae f0 0f ae e8 0f ae f0 0f ae e8 00 00 00 00 |................| 00000650 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000700 55 48 89 e5 0f ae f0 66 66 90 0f 31 48 c1 e2 20 |UH.....ff..1H.. | 00000710 89 c0 48 09 c2 48 8b 04 25 90 f0 5f ff 48 39 d0 |..H..H..%.._.H9.| 00000720 77 05 48 89 d0 5d c3 5d c3 0f 1f 80 00 00 00 00 |w.H..].]........| 00000730 55 41 ba 7b 00 00 00 45 0f 03 d2 48 89 e5 41 57 |UA.{...E...H..AW| 00000740 41 56 41 55 41 54 53 44 8b 2c 25 10 f0 5f ff 44 |AVAUATSD.,%.._.D| 00000750 89 d3 41 83 fd 01 44 89 d1 0f 84 f1 00 00 00 41 |..A...D........A| 00000760 89 c9 83 e1 3f 41 81 e1 ff 0f 00 00 48 63 f1 41 |....?A......Hc.A| 00000770 f7 c1 c0 0f 00 00 0f 85 f9 00 00 00 48 c1 e6 06 |............H...| 00000780 44 8b a6 20 d0 5f ff 44 8b 9e 00 d0 5f ff 0f ae |D.. ._.D...._...| 00000790 f0 66 66 90 0f 31 48 c1 e2 20 89 c0 0f be 8e 1c |.ff..1H.. ......| 000007a0 d0 5f ff 48 09 c2 48 2b 96 08 d0 5f ff 8b 86 18 |._.H..H+..._....| 000007b0 d0 5f ff 49 89 d0 49 d3 e0 85 c9 0f 88 a7 00 00 |._.I..I.........| 000007c0 00 89 c2 4c 8b b6 10 d0 5f ff 4c 89 c0 44 0f b6 |...L...._.L..D..| 000007d0 be 1d d0 5f ff 48 f7 e2 48 0f ac d0 20 49 89 c0 |..._.H..H... I..| 000007e0 0f ae f0 66 66 90 44 8b 2c 25 10 f0 5f ff 89 d9 |...ff.D.,%.._...| 000007f0 41 83 fd 01 74 6a 81 e1 ff 0f 00 00 41 39 c9 0f |A...tj......A9..| 00000800 85 4d ff ff ff 8b 86 00 d0 5f ff a8 01 0f 85 3f |.M......._.....?| 00000810 ff ff ff 44 39 d8 0f 85 36 ff ff ff 44 3b a6 20 |...D9...6...D;. | 00000820 d0 5f ff 0f 85 29 ff ff ff 41 83 e7 01 74 48 5b |._...)...A...tH[| 00000830 41 5c 48 8b 04 25 90 f0 5f ff 4d 01 f0 41 5d 41 |A\H..%.._.M..A]A| 00000840 5e 49 39 c0 41 5f 49 0f 43 c0 5d c3 0f 1f 40 00 |^I9.A_I.C.]...@.| 00000850 0f 01 f9 e9 07 ff ff ff 0f 1f 84 00 00 00 00 00 |................| 00000860 0f 01 f9 eb 91 0f 1f 00 f7 d9 48 d3 ea 49 89 d0 |..........H..I..| 00000870 e9 4c ff ff ff 0f 0b c7 07 00 00 00 00 eb b0 90 |.L..............| 00000880 55 48 89 e5 41 56 41 55 41 54 53 89 fb 48 83 ec |UH..AVAUATS..H..| 00000890 10 83 ff 01 0f 84 66 01 00 00 0f 8e b0 00 00 00 |......f.........| 000008a0 83 ff 05 74 4b 83 ff 06 0f 85 8b 00 00 00 8b 04 |...tK...........| 000008b0 25 80 f0 5f ff a8 01 0f 85 a4 02 00 00 48 8b 14 |%.._.........H..| 000008c0 25 e0 f0 5f ff 48 89 16 48 8b 14 25 e8 f0 5f ff |%.._.H..H..%.._.| 000008d0 48 89 56 08 3b 04 25 80 f0 5f ff 75 d1 48 83 c4 |H.V.;.%.._.u.H..| 000008e0 10 31 c0 5b 41 5c 41 5d 41 5e 5d c3 f3 90 66 90 |.1.[A\A]A^]...f.| 000008f0 8b 04 25 80 f0 5f ff a8 01 75 f1 48 8b 14 25 d0 |..%.._...u.H..%.| 00000900 f0 5f ff 48 89 16 48 8b 14 25 d8 f0 5f ff 48 89 |._.H..H..%.._.H.| 00000910 56 08 3b 04 25 80 f0 5f ff 74 c2 eb d3 0f 1f 00 |V.;.%.._.t......| 00000920 31 d2 66 0f 1f 44 00 00 48 01 d7 48 89 46 08 48 |1.f..D..H..H.F.H| 00000930 89 3e 8b 45 dc 85 c0 75 a4 48 63 fb b8 e4 00 00 |.>.E...u.Hc.....| 00000940 00 0f 05 48 83 c4 10 5b 41 5c 41 5d 41 5e 5d c3 |...H...[A\A]A^].| 00000950 85 ff 75 e5 4c 8d 75 dc 48 c7 46 08 00 00 00 00 |..u.L.u.H.F.....| 00000960 44 8b 24 25 80 f0 5f ff 41 f6 c4 01 0f 85 f6 01 |D.$%.._.A.......| 00000970 00 00 8b 04 25 88 f0 5f ff 89 45 dc 48 8b 04 25 |....%.._..E.H..%| 00000980 a8 f0 5f ff 48 89 06 8b 14 25 88 f0 5f ff 4c 8b |.._.H....%.._.L.| 00000990 2c 25 b0 f0 5f ff 83 fa 01 0f 84 41 01 00 00 83 |,%.._......A....| 000009a0 fa 02 0f 84 78 01 00 00 31 c0 83 fa 03 0f 84 95 |....x...1.......| 000009b0 01 00 00 8b 0c 25 a4 f0 5f ff 44 3b 24 25 80 f0 |.....%.._.D;$%..| 000009c0 5f ff 75 9c 4c 01 e8 48 8b 3e 48 d3 e8 48 03 46 |_.u.L..H.>H..H.F| 000009d0 08 48 3d ff c9 9a 3b 0f 86 43 ff ff ff 31 d2 90 |.H=...;..C...1..| 000009e0 48 2d 00 ca 9a 3b 83 c2 01 48 3d ff c9 9a 3b 77 |H-...;...H=...;w| 000009f0 ef e9 32 ff ff ff 66 2e 0f 1f 84 00 00 00 00 00 |..2...f.........| 00000a00 4c 8d 75 dc 48 c7 46 08 00 00 00 00 44 8b 24 25 |L.u.H.F.....D.$%| 00000a10 80 f0 5f ff 41 f6 c4 01 0f 85 3c 01 00 00 8b 04 |.._.A.....<.....| 00000a20 25 88 f0 5f ff 89 45 dc 48 8b 04 25 c0 f0 5f ff |%.._..E.H..%.._.| 00000a30 48 89 06 8b 14 25 88 f0 5f ff 4c 8b 2c 25 b8 f0 |H....%.._.L.,%..| 00000a40 5f ff 83 fa 01 74 69 83 fa 02 0f 84 c0 00 00 00 |_....ti.........| 00000a50 31 c0 83 fa 03 0f 84 d5 00 00 00 8b 0c 25 a4 f0 |1............%..| 00000a60 5f ff 44 3b 24 25 80 f0 5f ff 75 a0 4c 01 e8 48 |_.D;$%.._.u.L..H| 00000a70 8b 3e 48 d3 e8 48 03 46 08 48 3d ff c9 9a 3b 0f |.>H..H.F.H=...;.| 00000a80 86 9b fe ff ff 31 d2 66 0f 1f 84 00 00 00 00 00 |.....1.f........| 00000a90 48 2d 00 ca 9a 3b 83 c2 01 48 3d ff c9 9a 3b 77 |H-...;...H=...;w| 00000aa0 ef e9 82 fe ff ff 66 2e 0f 1f 84 00 00 00 00 00 |......f.........| 00000ab0 48 89 75 d0 e8 47 fc ff ff 48 8b 75 d0 48 2b 04 |H.u..G...H.u.H+.| 00000ac0 25 90 f0 5f ff 8b 14 25 a0 f0 5f ff 48 23 04 25 |%.._...%.._.H#.%| 00000ad0 98 f0 5f ff 48 0f af c2 eb 81 66 0f 1f 44 00 00 |.._.H.....f..D..| 00000ae0 48 89 75 d0 e8 17 fc ff ff 48 8b 75 d0 48 2b 04 |H.u......H.u.H+.| 00000af0 25 90 f0 5f ff 8b 14 25 a0 f0 5f ff 48 23 04 25 |%.._...%.._.H#.%| 00000b00 98 f0 5f ff 48 0f af c2 e9 a6 fe ff ff 0f 1f 00 |.._.H...........| 00000b10 8b 04 25 f0 e0 5f ff 89 c0 eb a2 0f 1f 44 00 00 |..%.._.......D..| 00000b20 8b 04 25 f0 e0 5f ff 89 c0 eb c2 0f 1f 44 00 00 |..%.._.......D..| 00000b30 4c 89 f7 48 89 75 d0 e8 f4 fb ff ff 48 8b 75 d0 |L..H.u......H.u.| 00000b40 e9 78 ff ff ff 0f 1f 00 4c 89 f7 48 89 75 d0 e8 |.x......L..H.u..| 00000b50 dc fb ff ff 48 8b 75 d0 eb 93 f3 90 e9 ab fe ff |....H.u.........| 00000b60 ff f3 90 e9 46 fd ff ff f3 90 66 0f 1f 44 00 00 |....F.....f..D..| 00000b70 e9 eb fd ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 |.....ff.........| 00000b80 55 48 89 e5 41 56 41 55 41 54 53 48 89 fb 48 83 |UH..AVAUATSH..H.| 00000b90 ec 10 48 85 ff 0f 84 6d 01 00 00 4c 8d 75 dc 48 |..H....m...L.u.H| 00000ba0 c7 47 08 00 00 00 00 44 8b 24 25 80 f0 5f ff 41 |.G.....D.$%.._.A| 00000bb0 f6 c4 01 0f 85 48 01 00 00 8b 04 25 88 f0 5f ff |.....H.....%.._.| 00000bc0 89 45 dc 48 8b 04 25 a8 f0 5f ff 48 89 03 8b 14 |.E.H..%.._.H....| 00000bd0 25 88 f0 5f ff 4c 8b 2c 25 b0 f0 5f ff 83 fa 01 |%.._.L.,%.._....| 00000be0 0f 84 aa 00 00 00 83 fa 02 0f 84 d1 00 00 00 31 |...............1| 00000bf0 c0 83 fa 03 0f 84 d6 00 00 00 8b 0c 25 a4 f0 5f |............%.._| 00000c00 ff 44 3b 24 25 80 f0 5f ff 75 9c 4d 8d 44 05 00 |.D;$%.._.u.M.D..| 00000c10 48 8b 3b 49 d3 e8 4c 03 43 08 49 81 f8 ff c9 9a |H.;I..L.C.I.....| 00000c20 3b 0f 86 bb 00 00 00 31 d2 0f 1f 80 00 00 00 00 |;......1........| 00000c30 4c 89 c0 83 c2 01 4c 8d 80 00 36 65 c4 49 81 f8 |L.....L...6e.I..| 00000c40 ff c9 9a 3b 77 ea 48 01 d7 4c 89 c0 48 ba cf f7 |...;w.H..L..H...| 00000c50 53 e3 a5 9b c4 20 48 f7 ea 48 63 4d dc 49 c1 f8 |S.... H..HcM.I..| 00000c60 3f 48 89 3b 48 c1 fa 07 4c 29 c2 48 89 53 08 48 |?H.;H...L).H.S.H| 00000c70 85 f6 75 75 31 c0 48 85 c9 75 07 b0 60 48 89 df |..uu1.H..u..`H..| 00000c80 0f 05 48 83 c4 10 5b 41 5c 41 5d 41 5e 5d c3 90 |..H...[A\A]A^]..| 00000c90 48 89 75 d0 e8 67 fa ff ff 48 8b 75 d0 48 2b 04 |H.u..g...H.u.H+.| 00000ca0 25 90 f0 5f ff 8b 14 25 a0 f0 5f ff 48 23 04 25 |%.._...%.._.H#.%| 00000cb0 98 f0 5f ff 48 0f af c2 e9 3d ff ff ff 0f 1f 00 |.._.H....=......| 00000cc0 8b 04 25 f0 e0 5f ff 89 c0 eb d2 0f 1f 44 00 00 |..%.._.......D..| 00000cd0 4c 89 f7 48 89 75 d0 e8 54 fa ff ff 48 8b 75 d0 |L..H.u..T...H.u.| 00000ce0 eb bb 31 d2 e9 5d ff ff ff 8b 04 25 c8 f0 5f ff |..1..].....%.._.| 00000cf0 89 06 8b 04 25 cc f0 5f ff 89 46 04 e9 73 ff ff |....%.._..F..s..| 00000d00 ff f3 90 e9 9f fe ff ff 31 c9 e9 60 ff ff ff 90 |........1..`....| 00000d10 55 48 85 ff 48 8b 04 25 a8 f0 5f ff 48 89 e5 74 |UH..H..%.._.H..t| 00000d20 03 48 89 07 5d c3 90 90 90 90 90 90 90 90 90 90 |.H..]...........| 00000d30 55 83 3c 25 10 f0 5f ff 01 48 89 e5 74 2a b9 7b |U.<%.._..H..t*.{| 00000d40 00 00 00 0f 03 c9 48 85 ff 74 09 89 c8 25 ff 0f |......H..t...%..| 00000d50 00 00 89 07 48 85 f6 74 05 c1 e9 0c 89 0e 31 c0 |....H..t......1.| 00000d60 5d c3 66 0f 1f 44 00 00 0f 01 f9 eb d9 47 43 43 |].f..D.......GCC| 00000d70 3a 20 28 47 4e 55 29 20 34 2e 38 2e 30 20 32 30 |: (GNU) 4.8.0 20| 00000d80 31 33 30 35 30 32 20 28 70 72 65 72 65 6c 65 61 |130502 (prerelea| 00000d90 73 65 29 00 00 2e 73 68 73 74 72 74 61 62 00 2e |se)...shstrtab..| 00000da0 68 61 73 68 00 2e 64 79 6e 73 79 6d 00 2e 64 79 |hash..dynsym..dy| 00000db0 6e 73 74 72 00 2e 67 6e 75 2e 76 65 72 73 69 6f |nstr..gnu.versio| 00000dc0 6e 00 2e 67 6e 75 2e 76 65 72 73 69 6f 6e 5f 64 |n..gnu.version_d| 00000dd0 00 2e 6e 6f 74 65 00 2e 65 68 5f 66 72 61 6d 65 |..note..eh_frame| 00000de0 5f 68 64 72 00 2e 65 68 5f 66 72 61 6d 65 00 2e |_hdr..eh_frame..| 00000df0 64 79 6e 61 6d 69 63 00 2e 72 6f 64 61 74 61 00 |dynamic..rodata.| 00000e00 5f 5f 62 75 67 5f 74 61 62 6c 65 00 2e 64 69 73 |__bug_table..dis| 00000e10 63 61 72 64 00 2e 61 6c 74 69 6e 73 74 72 75 63 |card..altinstruc| 00000e20 74 69 6f 6e 73 00 2e 61 6c 74 69 6e 73 74 72 5f |tions..altinstr_| 00000e30 72 65 70 6c 61 63 65 6d 65 6e 74 00 2e 74 65 78 |replacement..tex| 00000e40 74 00 2e 63 6f 6d 6d 65 6e 74 00 00 00 00 00 00 |t..comment......| 00000e50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000e90 0b 00 00 00 05 00 00 00 02 00 00 00 00 00 00 00 |................| 00000ea0 20 01 70 ff ff ff ff ff 20 01 00 00 00 00 00 00 | .p..... .......| 00000eb0 40 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |@...............| 00000ec0 08 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 |................| 00000ed0 11 00 00 00 0b 00 00 00 02 00 00 00 00 00 00 00 |................| 00000ee0 60 01 70 ff ff ff ff ff 60 01 00 00 00 00 00 00 |`.p.....`.......| 00000ef0 08 01 00 00 00 00 00 00 03 00 00 00 02 00 00 00 |................| 00000f00 08 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 |................| 00000f10 19 00 00 00 03 00 00 00 02 00 00 00 00 00 00 00 |................| 00000f20 68 02 70 ff ff ff ff ff 68 02 00 00 00 00 00 00 |h.p.....h.......| 00000f30 5e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |^...............| 00000f40 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000f50 21 00 00 00 ff ff ff 6f 02 00 00 00 00 00 00 00 |!......o........| 00000f60 c6 02 70 ff ff ff ff ff c6 02 00 00 00 00 00 00 |..p.............| 00000f70 16 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |................| 00000f80 02 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |................| 00000f90 2e 00 00 00 fd ff ff 6f 02 00 00 00 00 00 00 00 |.......o........| 00000fa0 e0 02 70 ff ff ff ff ff e0 02 00 00 00 00 00 00 |..p.............| 00000fb0 38 00 00 00 00 00 00 00 03 00 00 00 02 00 00 00 |8...............| 00000fc0 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000fd0 3d 00 00 00 07 00 00 00 02 00 00 00 00 00 00 00 |=...............| 00000fe0 18 03 70 ff ff ff ff ff 18 03 00 00 00 00 00 00 |..p.............| 00000ff0 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |<...............| 00001000 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001010 43 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 |C...............| 00001020 54 03 70 ff ff ff ff ff 54 03 00 00 00 00 00 00 |T.p.....T.......| 00001030 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |<...............| 00001040 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001050 51 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 |Q...............| 00001060 90 03 70 ff ff ff ff ff 90 03 00 00 00 00 00 00 |..p.............| 00001070 40 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |@...............| 00001080 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001090 5b 00 00 00 06 00 00 00 03 00 00 00 00 00 00 00 |[...............| 000010a0 d0 04 70 ff ff ff ff ff d0 04 00 00 00 00 00 00 |..p.............| 000010b0 f0 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 |................| 000010c0 08 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 |................| 000010d0 64 00 00 00 01 00 00 00 32 00 00 00 00 00 00 00 |d.......2.......| 000010e0 c0 05 70 ff ff ff ff ff c0 05 00 00 00 00 00 00 |..p.............| 000010f0 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ...............| 00001100 08 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................| 00001110 6c 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 |l...............| 00001120 e0 05 70 ff ff ff ff ff e0 05 00 00 00 00 00 00 |..p.............| 00001130 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001140 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001150 78 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00 |x...............| 00001160 ec 05 70 ff ff ff ff ff ec 05 00 00 00 00 00 00 |..p.............| 00001170 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001180 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001190 81 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 |................| 000011a0 f2 05 70 ff ff ff ff ff f2 05 00 00 00 00 00 00 |..p.............| 000011b0 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |H...............| 000011c0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000011d0 92 00 00 00 01 00 00 00 06 00 00 00 00 00 00 00 |................| 000011e0 3a 06 70 ff ff ff ff ff 3a 06 00 00 00 00 00 00 |:.p.....:.......| 000011f0 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001200 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001210 a8 00 00 00 01 00 00 00 06 00 00 00 00 00 00 00 |................| 00001220 00 07 70 ff ff ff ff ff 00 07 00 00 00 00 00 00 |..p.............| 00001230 6d 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |m...............| 00001240 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00001250 ae 00 00 00 01 00 00 00 30 00 00 00 00 00 00 00 |........0.......| 00001260 00 00 00 00 00 00 00 00 6d 0d 00 00 00 00 00 00 |........m.......| 00001270 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |'...............| 00001280 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................| 00001290 01 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 |................| 000012a0 00 00 00 00 00 00 00 00 94 0d 00 00 00 00 00 00 |................| 000012b0 b7 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012c0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000012d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00002b60 00 00 00 00 00 00 00 00 50 c2 dd f7 ff 7f 00 00 |........P.......| 00002b70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002b80 04 00 00 00 00 00 00 00 20 a1 ff f7 ff 7f 00 00 |........ .......| 00002b90 05 00 00 00 00 00 00 00 68 a2 ff f7 ff 7f 00 00 |........h.......| 00002ba0 06 00 00 00 00 00 00 00 60 a1 ff f7 ff 7f 00 00 |........`.......| 00002bb0 f0 ff ff 6f 00 00 00 00 c6 a2 ff f7 ff 7f 00 00 |...o............| 00002bc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00002c10 00 00 00 00 00 00 00 00 22 cb 6d ec 20 03 00 00 |........".m. ...| 00002c20 ae f7 17 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002c30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002c40 00 00 00 00 02 09 03 00 89 ed ff ff ff 7f 00 00 |................| 00002c50 06 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 |................| 00002c60 00 00 00 00 00 00 00 00 60 ec fe f7 ff 7f 00 00 |........`.......| 00002c70 0d 00 00 00 00 00 00 00 64 00 00 00 00 00 00 00 |........d.......| 00002c80 02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 |................| 00002c90 7f 03 00 00 03 03 00 00 ff fb 8b 17 00 00 00 00 |................| 00002ca0 00 00 00 00 00 00 00 00 48 ec ff ff ff 7f 00 00 |........H.......| 00002cb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002cc0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 |................| 00002cd0 c0 4b df f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |.K..............| 00002ce0 00 00 00 00 00 00 00 00 58 ef ff f7 ff 7f 00 00 |........X.......| 00002cf0 74 00 00 00 00 00 00 00 00 a0 ff f7 ff 7f 00 00 |t...............| 00002d00 20 e7 ff f7 ff 7f 00 00 70 a9 de f7 ff 7f 00 00 | .......p.......| 00002d10 b0 98 de f7 ff 7f 00 00 a0 96 de f7 ff 7f 00 00 |................| 00002d20 10 bc de f7 ff 7f 00 00 30 47 de f7 ff 7f 00 00 |........0G......| 00002d30 60 cf de f7 ff 7f 00 00 a0 d3 de f7 ff 7f 00 00 |`...............| 00002d40 50 f2 de f7 ff 7f 00 00 60 cb de f7 ff 7f 00 00 |P.......`.......| 00002d50 00 05 df f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00002d60 00 00 00 00 01 00 00 00 77 28 0c d5 d5 43 7f 2a |........w(...C.*| 00002d70 00 00 00 00 00 00 00 00 58 eb ff ff ff 7f 00 00 |........X.......| 00002d80 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002d90 10 ec ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00002da0 0b 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 |................| 00002db0 c0 eb ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00002dc0 ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 00 |................| 00002dd0 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002de0 50 eb ff ff ff 7f 00 00 00 00 00 00 00 00 00 00 |P...............| 00002df0 0e 00 00 00 00 00 00 00 39 01 00 00 00 00 00 00 |........9.......| 00002e00 19 00 00 00 00 00 00 00 68 1b 22 00 00 00 00 00 |........h.".....| 00002e10 1b 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 |................| 00002e20 04 00 00 00 00 00 00 00 f0 b1 dd f7 ff 7f 00 00 |................| 00002e30 f5 fe ff 6f 00 00 00 00 10 b3 dd f7 ff 7f 00 00 |...o............| 00002e40 05 00 00 00 00 00 00 00 e8 b6 dd f7 ff 7f 00 00 |................| 00002e50 06 00 00 00 00 00 00 00 60 b4 dd f7 ff 7f 00 00 |........`.......| 00002e60 0a 00 00 00 00 00 00 00 7c 01 00 00 00 00 00 00 |........|.......| 00002e70 0b 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 |................| 00002e80 03 00 00 00 00 00 00 00 a0 cf ff f7 ff 7f 00 00 |................| 00002e90 02 00 00 00 00 00 00 00 90 00 00 00 00 00 00 00 |................| 00002ea0 14 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 |................| 00002eb0 17 00 00 00 00 00 00 00 98 ba dd f7 ff 7f 00 00 |................| 00002ec0 07 00 00 00 00 00 00 00 48 b9 dd f7 ff 7f 00 00 |........H.......| 00002ed0 08 00 00 00 00 00 00 00 50 01 00 00 00 00 00 00 |........P.......| 00002ee0 09 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 |................| 00002ef0 fc ff ff 6f 00 00 00 00 a0 08 00 00 00 00 00 00 |...o............| 00002f00 fd ff ff 6f 00 00 00 00 05 00 00 00 00 00 00 00 |...o............| 00002f10 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00002f20 fb ff ff 6f 00 00 00 00 01 00 00 00 00 00 00 00 |...o............| 00002f30 f0 ff ff 6f 00 00 00 00 64 b8 dd f7 ff 7f 00 00 |...o....d.......| 00002f40 f9 ff ff 6f 00 00 00 00 0c 00 00 00 00 00 00 00 |...o............| 00002f50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00002fa0 f0 1d 22 00 00 00 00 00 00 00 00 00 00 00 00 00 |..".............| 00002fb0 00 00 00 00 00 00 00 00 b0 75 54 f6 ff 7f 00 00 |.........uT.....| 00002fc0 70 6e 54 f6 ff 7f 00 00 20 cb de f7 ff 7f 00 00 |pnT..... .......| 00002fd0 30 77 54 f6 ff 7f 00 00 20 73 54 f6 ff 7f 00 00 |0wT..... sT.....| 00002fe0 90 72 54 f6 ff 7f 00 00 00 e1 ff f7 ff 7f 00 00 |.rT.............| 00002ff0 60 e1 ff f7 ff 7f 00 00 90 72 54 f6 ff 7f 00 00 |`........rT.....| 00003000 90 e1 ff f7 ff 7f 00 00 0e 00 00 00 00 00 00 00 |................| 00003010 48 e4 ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |H...............| 00003020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003030 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003040 00 00 00 00 00 00 00 00 00 90 fe f7 ff 7f 00 00 |................| 00003050 7f 00 00 00 00 00 00 00 32 00 00 00 00 00 00 00 |........2.......| 00003060 00 09 df f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00003070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003900 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003910 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................| 00003920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003940 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003950 00 00 00 00 00 00 00 00 0e 00 00 00 00 00 00 00 |................| 00003960 00 00 00 00 00 00 00 00 16 0d 6f ec 20 03 00 00 |..........o. ...| 00003970 00 00 00 00 00 00 00 00 1c 06 00 00 00 00 00 00 |................| 00003980 07 04 00 00 00 00 00 00 58 ef ff f7 ff 7f 00 00 |........X.......| 00003990 10 67 5e f6 ff 7f 00 00 00 b0 dd f7 ff 7f 00 00 |.g^.............| 000039a0 00 02 40 00 00 00 00 00 f0 cd ff f7 ff 7f 00 00 |..@.............| 000039b0 98 e5 fe f7 ff 7f 00 00 00 e0 fe f7 ff 7f 00 00 |................| 000039c0 98 d9 ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 000039d0 20 e0 ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 | ...............| 000039e0 00 00 00 00 00 00 00 00 90 ce ff f7 ff 7f 00 00 |................| 000039f0 80 ce ff f7 ff 7f 00 00 20 ce ff f7 ff 7f 00 00 |........ .......| 00003a00 40 ce ff f7 ff 7f 00 00 50 ce ff f7 ff 7f 00 00 |@.......P.......| 00003a10 c0 ce ff f7 ff 7f 00 00 d0 ce ff f7 ff 7f 00 00 |................| 00003a20 e0 ce ff f7 ff 7f 00 00 60 ce ff f7 ff 7f 00 00 |........`.......| 00003a30 70 ce ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |p...............| 00003a40 00 00 00 00 00 00 00 00 f0 cd ff f7 ff 7f 00 00 |................| 00003a50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003a70 00 00 00 00 00 00 00 00 a0 ce ff f7 ff 7f 00 00 |................| 00003a80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003a90 b0 ce ff f7 ff 7f 00 00 10 cf ff f7 ff 7f 00 00 |................| 00003aa0 00 ce ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00003ab0 10 ce ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00003ac0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003af0 00 00 00 00 00 00 00 00 00 cf ff f7 ff 7f 00 00 |................| 00003b00 f0 ce ff f7 ff 7f 00 00 20 cf ff f7 ff 7f 00 00 |........ .......| 00003b10 00 00 00 00 00 00 00 00 40 cf ff f7 ff 7f 00 00 |........@.......| 00003b20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003b60 30 cf ff f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |0...............| 00003b70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003c30 30 ce ff f7 ff 7f 00 00 40 b0 dd f7 ff 7f 00 00 |0.......@.......| 00003c40 00 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 |................| 00003c50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003c70 00 00 00 00 00 00 00 00 58 c2 fe f7 ff 7f 00 00 |........X.......| 00003c80 06 00 00 00 2e 00 00 00 03 00 00 00 08 00 00 00 |................| 00003c90 20 b3 dd f7 ff 7f 00 00 40 b3 dd f7 ff 7f 00 00 | .......@.......| 00003ca0 f0 b3 dd f7 ff 7f 00 00 00 00 00 00 1d 00 00 00 |................| 00003cb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003cc0 00 00 00 00 00 00 00 00 64 b8 dd f7 ff 7f 00 00 |........d.......| 00003cd0 00 00 00 00 00 00 00 00 00 b0 dd f7 ff 7f 00 00 |................| 00003ce0 90 e1 ff f7 ff 7f 00 00 aa 4b df f7 ff 7f 00 00 |.........K......| 00003cf0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003d60 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 |................| 00003d70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003d90 10 b6 dd f7 ff 7f 00 00 01 00 00 00 00 00 00 00 |................| 00003da0 00 e0 fe f7 ff 7f 00 00 d0 bb 4d f6 ff 7f 00 00 |..........M.....| 00003db0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003de0 00 00 00 00 00 00 00 00 68 1b 22 00 00 00 00 00 |........h.".....| 00003df0 98 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00003f00 a0 0c 5a f7 ff 7f 00 00 20 1e 5a f7 ff 7f 00 00 |..Z..... .Z.....| 00003f10 10 e1 59 f7 ff 7f 00 00 06 00 00 00 00 00 00 00 |..Y.............| 00003f20 04 00 00 00 00 00 00 00 20 c4 fe f7 ff 7f 00 00 |........ .......| 00003f30 04 00 00 00 00 00 00 00 80 10 00 00 00 00 00 00 |................| 00003f40 f8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 |........@.......| 00003f50 90 b0 fe f7 ff 7f 00 00 01 00 00 00 00 00 00 00 |................| 00003f60 10 e8 59 f7 ff 7f 00 00 30 e9 59 f7 ff 7f 00 00 |..Y.....0.Y.....| 00003f70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003f80 00 00 10 00 00 00 00 00 00 00 08 00 00 00 00 00 |................| * 00003fa0 00 00 01 00 00 00 00 00 00 80 00 00 00 00 00 00 |................| * 00003fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00003fd0 21 b8 dd f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |!...............| 00003fe0 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................| 00003ff0 5e 83 3d 00 00 00 00 00 00 00 00 00 00 00 00 00 |^.=.............| 00004000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00004020 00 02 40 00 00 00 00 00 d0 df ff f7 ff 7f 00 00 |..@.............| 00004030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00004040 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00004050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000040a0 d5 79 00 00 00 00 00 00 60 33 ff f7 ff 7f 00 00 |.y......`3......| 000040b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000040c0 00 90 fe f7 ff 7f 00 00 00 a0 fe f7 ff 7f 00 00 |................| 000040d0 e0 9f fe f7 ff 7f 00 00 00 e0 c4 01 00 00 00 00 |................| 000040e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00004100 a0 eb ff ff ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00004110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00004120 02 00 00 00 05 00 00 00 23 0f 10 00 00 08 04 01 |........#.......| 00004130 09 20 80 00 ff fb 8b 17 23 0f 10 00 f3 15 00 10 |. ......#.......| 00004140 ff 07 00 00 ff fb d3 ef 0f 00 00 00 02 00 00 00 |................| 00004150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00004160 01 00 00 00 00 00 00 00 90 e1 ff f7 ff 7f 00 00 |................| 00004170 a0 a2 de f7 ff 7f 00 00 00 00 00 00 00 00 00 00 |................| 00004180 00 b0 dd f7 ff 7f 00 00 00 00 00 00 02 00 00 00 |................| 00004190 00 00 00 00 00 00 00 00 2a 5e df f7 ff 7f 00 00 |........*^......| 000041a0 a0 a6 fb 00 00 00 00 00 20 e7 ff f7 ff 7f 00 00 |........ .......| 000041b0 00 00 00 00 00 00 00 00 90 e1 ff f7 ff 7f 00 00 |................| 000041c0 00 00 00 00 00 00 00 00 00 e7 ff f7 ff 7f 00 00 |................| 000041d0 00 00 00 00 00 00 00 00 30 a7 fb 00 00 00 00 00 |........0.......| 000041e0 20 a8 fb 00 00 00 00 00 10 a8 fb 00 00 00 00 00 | ...............| 000041f0 00 00 00 00 00 00 00 00 c0 a7 fb 00 00 00 00 00 |................| 00004200 d0 a7 fb 00 00 00 00 00 50 a8 fb 00 00 00 00 00 |........P.......| 00004210 60 a8 fb 00 00 00 00 00 70 a8 fb 00 00 00 00 00 |`.......p.......| 00004220 e0 a7 fb 00 00 00 00 00 f0 a7 fb 00 00 00 00 00 |................| 00004230 50 a7 fb 00 00 00 00 00 60 a7 fb 00 00 00 00 00 |P.......`.......| 00004240 00 00 00 00 00 00 00 00 40 a7 fb 00 00 00 00 00 |........@.......| 00004250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00004270 30 a8 fb 00 00 00 00 00 00 a8 fb 00 00 00 00 00 |0...............| 00004280 00 00 00 00 00 00 00 00 40 a8 fb 00 00 00 00 00 |........@.......| 00004290 00 00 00 00 00 00 00 00 70 a7 fb 00 00 00 00 00 |........p.......| 000042a0 90 a7 fb 00 00 00 00 00 80 a7 fb 00 00 00 00 00 |................| 000042b0 a0 a7 fb 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000042c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000042e0 90 a8 fb 00 00 00 00 00 80 a8 fb 00 00 00 00 00 |................| 000042f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00004350 00 00 00 00 00 00 00 00 a0 a8 fb 00 00 00 00 0... [truncated message content] |
From: <nic...@us...> - 2013-05-21 17:00:48
|
Revision: 643 http://sourceforge.net/p/mplayerxp/code/643 Author: nickols_k Date: 2013-05-21 17:00:46 +0000 (Tue, 21 May 2013) Log Message: ----------- fixed compilation: yasm no longer required about illegal-patch =================== gdb's log shows that hacked-compiler optimized out of antiviral holes all global variables except MPXPCtx and opaque. This means that hacked-gcc was intentionally tuned to make mplayerxp unusable. -------------------- 8< --------------- 8< ------------------------------------- GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /path/mplayerxp...done. (gdb) break main.cpp:2081 (gdb) Breakpoint 1 at 0x447bff: file main.cpp, line 2081. (gdb) run (gdb) Starting program: mplayerxp -vo null -ao null -core.dump @stream:myfile /path/serebro.dyshi.avi [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, main (argc=8, args=0x7fffffffeb48, envp=0x7fffffffeb90) at main.cpp:2083 2083 for(int i=0;i<argc;i++) { (gdb) print &antiviral_hole1 (gdb) $1 = (char (*)[4096]) 0xffb000 <usr::antiviral_hole1> (gdb) print &antiviral_hole2 (gdb) $2 = (char (*)[4096]) 0xffa000 <usr::antiviral_hole2> (gdb) print &antiviral_hole3 (gdb) $3 = (char (*)[4096]) 0xff8000 <usr::antiviral_hole3> (gdb) print &antiviral_hole4 (gdb) $4 = (char (*)[4096]) 0xff6000 <usr::antiviral_hole4> (gdb) print &mp_conf (gdb) $5 = (usr::MP_Config *) 0xff5020 <usr::mp_conf> (gdb) print &MPXPCtx (gdb) $6 = (usr::LocalPtr<usr::MPXPContext> *) 0xff9120 <usr::MPXPCtx> (gdb) print &secure_keys (gdb) $7 = (volatile usr::MPXPSecureKeys **) 0xff5008 <usr::secure_keys> (gdb) print &opaque1 (gdb) $8 = (usr::Opaque *) 0xff94a0 <usr::opaque1> (gdb) print &opaque2 (gdb) $9 = (usr::Opaque *) 0xff9000 <usr::opaque2> (gdb) print &opaque3 (gdb) $10 = (usr::Opaque *) 0xff7120 <usr::opaque3> (gdb) print &opaque4 (gdb) $11 = (usr::Opaque *) 0xff7000 <usr::opaque4> (gdb) print &xp_num_cpu (gdb) $12 = (unsigned int *) 0xff5000 <usr::xp_num_cpu> (gdb) -------------------- 8< --------------- 8< ------------------------------------- Modified Paths: -------------- mplayerxp/configure Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2013-05-19 07:38:45 UTC (rev 642) +++ mplayerxp/configure 2013-05-21 17:00:46 UTC (rev 643) @@ -365,7 +365,7 @@ add_cflags "-I$srcdir/../lavc" print_config HAVE_ mpxp_config.h mpxp_config.mak lavc # Configuring external lavc stuff -lavc_args="--enable-static --disable-shared --enable-gpl --enable-pthreads --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-avdevice --disable-avfilter --disable-avresample" +lavc_args="--enable-static --disable-shared --enable-gpl --enable-pthreads --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-avdevice --disable-avfilter --disable-avresample --disable-yasm" if test -n $host ; then _arch=$host_arch x86_32 && _arch="i686" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-19 07:38:48
|
Revision: 642 http://sourceforge.net/p/mplayerxp/code/642 Author: nickols_k Date: 2013-05-19 07:38:45 +0000 (Sun, 19 May 2013) Log Message: ----------- about illegal-patch =================== In addition to previous observations i've found out that malefactors have hacked libstdc++: ---------------------- 8< --------------------- 8< ---------------------------------- GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp...done. (gdb) break main.cpp:1580 Breakpoint 1 at 0x46978b: file main.cpp, line 1580. (gdb) run Starting program: /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp -vo fbdev -ao alsa trassa\ e95.avi [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, usr::MPlayerXP (argv=std::vector of length 6, capacity 8 = {...}, envm=std::map with 20 elements) at main.cpp:1580 1580 xmp_init(); (gdb) print envm $1 = std::map with 20 elements (gdb) print argv $2 = std::vector of length 6, capacity 8 = {"/mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp", "-vo", "fbdev", "-ao", "alsa", "trassa e95.avi"} (gdb) q A debugging session is active. Inferior 1 [process 1047] will be killed. Quit anyway? (y or n) ---------------------- 8< --------------------- 8< ---------------------------------- it's clear that std::vector contains char* but not std::string(s) therefore, malefactor(s) substitute libstdc++ too: ---------------------- 8< --------------------- 8< ---------------------------------- $nm -D -C mplayerxp | grep string U std::string::find(char, unsigned long) const U std::string::find(char const*, unsigned long, unsigned long) const U std::string::rfind(char, unsigned long) const U std::string::substr(unsigned long, unsigned long) const U std::string::compare(char const*) const U std::string::_M_leak_hard() U std::string::_Rep::_M_destroy(std::allocator<char> const&) U std::string::_Rep::_M_dispose(std::allocator<char> const&) 000000000103a040 u std::string::_Rep::_S_empty_rep_storage U std::string::append(char const*, unsigned long) U std::string::append(std::string const&) U std::string::assign(char const*, unsigned long) U std::string::assign(std::string const&) U std::string::resize(unsigned long, char) U std::string::reserve(unsigned long) U std::string::_M_mutate(unsigned long, unsigned long, unsigned long) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&, unsigned long, unsigned long) U std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() 0000000000580f00 W std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) 0000000000482680 W std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) $nm -D -C mplayerxp | grep ostream U std::ostream::put(char) U std::ostream::flush() U std::ostream::seekp(long, std::_Ios_Seekdir) U std::ostream::tellp() U std::ostream::write(char const*, long) U std::ostream& std::ostream::_M_insert<double>(double) U std::ostream& std::ostream::_M_insert<long>(long) U std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long) U std::ostream& std::ostream::_M_insert<void const*>(void const*) U std::ostream& std::ostream::_M_insert<long long>(long long) U std::basic_ostream<char, std::char_traits<char> >::~basic_ostream() U std::basic_ostream<char, std::char_traits<char> >::~basic_ostream() U std::ostream::operator<<(int) U std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) U std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&) U std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) 000000000103a4a0 V typeinfo for std::ostream U virtual thunk to std::basic_ostream<char, std::char_traits<char> >::~basic_ostream() U virtual thunk to std::basic_ostream<char, std::char_traits<char> >::~basic_ostream() ---------------------- 8< --------------------- 8< ---------------------------------- second observation: mplayerxp was extremelly virused by illgal patch: ---------------------- 8< --------------------- 8< ---------------------------------- GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp...done. (gdb) break main.cpp:2109 Breakpoint 1 at 0x44b21c: file main.cpp, line 2109. (gdb) break cfgparser.cpp:769 Breakpoint 2 at 0x5a8271: file cfgparser.cpp, line 769. (gdb) run Starting program: /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp --long-help [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, main (argc=<optimized out>, args=<optimized out>, envp=0x7fffffffebd0) at main.cpp:2109 2109 mpxp_ok<<"*** Antiviral protection was inited ***!!!"<<std::endl; (gdb) print envm $1 = std::map with 20 elements = {["COLUMNS"] = "174", ["HISTCONTROL"] = "ignorespace", ["HOME"] = "/root", ["LANG"] = "ru_RU.UTF-8", ["LINES"] = "54", ["LOGNAME"] = "root", ["MAIL"] = "/var/spool/mail/root", ["MC_SID"] = "1251", ["MC_TMPDIR"] = "/tmp/mc-root", ["PATH"] = "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl", ["PWD"] = "/mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp", ["SHELL"] = "/bin/bash", ["SHLVL"] = "2", ["TERM"] = "linux", ["USER"] = "root", ["XDG_RUNTIME_DIR"] = "/run/user/0", ["XDG_SEAT"] = "seat0", ["XDG_SESSION_ID"] = "3", ["XDG_VTNR"] = "2", ["_"] = "/usr/bin/gdb"} (gdb) s operator<< (__pf=<optimized out>, this=0x104cdc0 <_ZN3usrL7mpxp_okE>) at /usr/include/c++/4.8.0/ostream:113 113 return __pf(*this); (gdb) s main (argc=<optimized out>, args=<optimized out>, envp=0x7fffffffebd0) at main.cpp:2112 2112 memset(&mp_conf.x86,-1,sizeof(x86_features_t)); (gdb) s 2115 return MPlayerXP(argv,envm); (gdb) s usr::MPlayerXP (argv=std::vector of length 2, capacity 2 = {...}, envm=std::map with 20 elements) at main.cpp:1559 1559 int MPlayerXP(const std::vector<std::string>& argv, const std::map<std::string,std::string>& envm){ (gdb) print envm $2 = std::map with 20 elements (gdb) c Continuing. Breakpoint 2, usr::M_Config::__show_options (this=this@entry=0x2369010, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:769 769 while(opts[i].name) { (gdb) n 766 void M_Config::__show_options(unsigned ntabs,const std::string& pfx,const mpxp_option_t* opts) const { (gdb) n 769 while(opts[i].name) { (gdb) n 781 __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); (gdb) n 769 while(opts[i].name) { (gdb) n 768 i=0; (gdb) n 781 __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); (gdb) n 770 if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { (gdb) n 784 if(opts[i].type<=CONF_TYPE_PRINT) { (gdb) n 847 i++; (gdb) n 769 while(opts[i].name) { (gdb) n 770 if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { (gdb) n 784 if(opts[i].type<=CONF_TYPE_PRINT) { (gdb) n 785 for(n=0;n<ntabs;n++) mpxp_info<<" "; (gdb) n 786 if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) n 789 if((opts[i].flags&CONF_NOCFG)==0) { (gdb) n 791 (opts[i].type==CONF_TYPE_FLAG?"flg": (gdb) n 794 opts[i].type==CONF_TYPE_STRING?"str":"")<<"="; (gdb) n 790 mpxp_info<<" {"<< (gdb) n 794 opts[i].type==CONF_TYPE_STRING?"str":"")<<"="; (gdb) n 795 switch(opts[i].type) { (gdb) n 804 const char **defv = (const char**)(opts[i].p); (gdb) n 805 if(defv) mpxp_info<<"\""<<*defv<<"\""; (gdb) n 843 mpxp_info<<"}"; (gdb) n 845 mpxp_info<<std::endl; (gdb) n 847 i++; (gdb) n 769 while(opts[i].name) { (gdb) n 770 if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { (gdb) n 784 if(opts[i].type<=CONF_TYPE_PRINT) { (gdb) n 785 for(n=0;n<ntabs;n++) mpxp_info<<" "; (gdb) n 786 if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) n 789 if((opts[i].flags&CONF_NOCFG)==0) { (gdb) print opts[i] $3 = {name = 0xb71391 "ao", p = 0x103b100 <usr::mp_conf+224>, type = 3, flags = 0, min = 0, max = 0, help = 0xbc76f8 "select audio output driver and optinaly device"} (gdb) q A debugging session is active. Inferior 1 [process 1275] will be killed. Quit anyway? (y or n) ---------------------- 8< --------------------- 8< ---------------------------------- 1) at first print gdb shows context of envm but at second print it already hides its context. 2) replacement of 'std::string' with 'char*' by hacked-gcc affected class mpxp_ostream: ---------------------- 8< --------------------- 8< ---------------------------------- GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp...done. (gdb) break cfgparser.cpp:769 Breakpoint 1 at 0x5a8271: file cfgparser.cpp, line 769. (gdb) run Starting program: /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp --long-help [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:769 769 while(opts[i].name) { (gdb) n 766 void M_Config::__show_options(unsigned ntabs,const std::string& pfx,const mpxp_option_t* opts) const { (gdb) n 769 while(opts[i].name) { (gdb) n 781 __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); (gdb) n 769 while(opts[i].name) { (gdb) n 768 i=0; (gdb) n 781 __show_options(ntabs+2,newpfx,(const mpxp_option_t *)opts[i].p); (gdb) n 770 if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { (gdb) n 784 if(opts[i].type<=CONF_TYPE_PRINT) { (gdb) n 847 i++; (gdb) n 769 while(opts[i].name) { (gdb) n 770 if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { (gdb) n 784 if(opts[i].type<=CONF_TYPE_PRINT) { (gdb) n 785 for(n=0;n<ntabs;n++) mpxp_info<<" "; (gdb) n 786 if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) n 789 if((opts[i].flags&CONF_NOCFG)==0) { (gdb) n 791 (opts[i].type==CONF_TYPE_FLAG?"flg": (gdb) n 794 opts[i].type==CONF_TYPE_STRING?"str":"")<<"="; (gdb) n 790 mpxp_info<<" {"<< (gdb) n 794 opts[i].type==CONF_TYPE_STRING?"str":"")<<"="; (gdb) n 795 switch(opts[i].type) { (gdb) n 804 const char **defv = (const char**)(opts[i].p); (gdb) n 805 if(defv) mpxp_info<<"\""<<*defv<<"\""; (gdb) n 843 mpxp_info<<"}"; (gdb) n 845 mpxp_info<<std::endl; (gdb) n 847 i++; (gdb) n 769 while(opts[i].name) { (gdb) n 770 if(opts[i].type==CONF_TYPE_SUBCONFIG && opts[i].p) { (gdb) n 784 if(opts[i].type<=CONF_TYPE_PRINT) { (gdb) n 785 for(n=0;n<ntabs;n++) mpxp_info<<" "; (gdb) n 786 if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 787 else mpxp_info<<" "<<std::endl; (gdb) n 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< (__pf=<optimized out>, this=<optimized out>) at /usr/include/c++/4.8.0/ostream:132 132 __pf(*this); (gdb) n usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< (__pf=<optimized out>, this=0x1cff240 <_ZN3usrL9mpxp_infoE>) at /usr/include/c++/4.8.0/ostream:132 132 __pf(*this); (gdb) n usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< <std::char_traits<char> > (__s=<optimized out>, __out=...) at /usr/include/c++/4.8.0/ostream:532 532 if (!__s) (gdb) n usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< (__pf=<optimized out>, this=0x1cff240 <_ZN3usrL9mpxp_infoE>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s left (__base=...) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s setf (__mask=std::_S_adjustfield, __fmtfl=std::_S_left, this=0x1d008d0 <_ZN3usrL9mpxp_infoE+5776>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator|= (__b=std::_S_left, __a=@0x1d008e8: 4130) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator| (__b=std::_S_left, __a=4098) at /usr/include/c++/4.8.0/bits/ios_base.h:80 80 { return _Ios_Fmtflags(static_cast<int>(__a) | static_cast<int>(__b)); } (gdb) s usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< <std::char_traits<char> > (__s=0xb71391 "ao", __out=...) at /usr/include/c++/4.8.0/ostream:532 532 if (!__s) (gdb) s 536 static_cast<streamsize>(_Traits::length(__s))); (gdb) s length (__s=0xb71391 "ao") at /usr/include/c++/4.8.0/bits/char_traits.h:259 259 { return __builtin_strlen(__s); } (gdb) s operator<< <std::char_traits<char> > (__s=0xb71391 "ao", __out=...) at /usr/include/c++/4.8.0/ostream:535 535 __ostream_insert(__out, __s, (gdb) s usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< <std::char_traits<char> > (__s=0xbc76f8 "select audio output driver and optinaly device", __out=...) at /usr/include/c++/4.8.0/ostream:532 532 if (!__s) (gdb) s 536 static_cast<streamsize>(_Traits::length(__s))); (gdb) s length (__s=0xbc76f8 "select audio output driver and optinaly device") at /usr/include/c++/4.8.0/bits/char_traits.h:259 259 { return __builtin_strlen(__s); } (gdb) s operator<< <std::char_traits<char> > (__s=0xbc76f8 "select audio output driver and optinaly device", __out=...) at /usr/include/c++/4.8.0/ostream:535 535 __ostream_insert(__out, __s, (gdb) s usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s operator<< (__pf=<optimized out>, this=<optimized out>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) s endl<char, std::char_traits<char> > (__os=...) at /usr/include/c++/4.8.0/ostream:565 565 { return flush(__os.put(__os.widen('\n'))); } (gdb) s usr::M_Config::__show_options (this=this@entry=0x23691c0, ntabs=ntabs@entry=2, pfx="", opts=opts@entry=0xbc8fe0 <usr::mplayerxp_options>) at cfgparser.cpp:788 788 mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; (gdb) q A debugging session is active. Inferior 1 [process 1312] will be killed. Quit anyway? (y or n) ---------------------- 8< --------------------- 8< ---------------------------------- Modified Paths: -------------- mplayerxp/libmpconf/cfgparser.cpp Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-05-18 17:23:21 UTC (rev 641) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-05-19 07:38:45 UTC (rev 642) @@ -784,10 +784,8 @@ if(opts[i].type<=CONF_TYPE_PRINT) { for(n=0;n<ntabs;n++) mpxp_info<<" "; if(!pfx.empty()) mpxp_info<<std::left<<pfx<<std::endl; - else mpxp_info<<"-"<<std::endl; - mpxp_info<<std::left<<opts[i].name<<" " - <<((opts[i].type==CONF_TYPE_PRINT && strcmp(opts[i].help,"show help")!=0)?opts[i].p:opts[i].help) - <<std::endl; + else mpxp_info<<" "<<std::endl; + mpxp_info<<std::left<<opts[i].name<<" "<<opts[i].help<<std::endl; if((opts[i].flags&CONF_NOCFG)==0) { mpxp_info<<" {"<< (opts[i].type==CONF_TYPE_FLAG?"flg": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-18 17:23:24
|
Revision: 641 http://sourceforge.net/p/mplayerxp/code/641 Author: nickols_k Date: 2013-05-18 17:23:21 +0000 (Sat, 18 May 2013) Log Message: ----------- compilation fixed about illegal-patch ==================== With mplayerxp has been happened the same situation as with beye. Hacked-gcc has been tuned and for this project too: ------------------------ 8< ------------------ 8< ------------------------------------ GNU gdb (GDB) 7.6 Copyright (C) 2013 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 /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp...done. (gdb) break main.cpp:850 (gdb) Breakpoint 1 at 0x4648c3: file main.cpp, line 850. (gdb) run (gdb) Starting program: /mnt/Storage/Data/-SF.NET-/MPXP/mplayerxp/mplayerxp/mplayerxp -vo fbdev -ao alsa /mnt/Storage/Data/MP3/Kipelov-ImFree.mp3 [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". Breakpoint 1, usr::MPXPSystem::init_vobsub (this=this@entry=0x23661d0, filename="/mnt/Storage/Data/MP3/Kipelov-ImFree.mp3") at main.cpp:850 850 if (mp_conf.vobsub_name){ (gdb) print filename (gdb) $1 = "/mnt/Storage/Data/MP3/Kipelov-ImFree.mp3" (gdb) print &filename (gdb) $2 = (const std::string *) 0x7fffffffe850 (gdb) print *(&filename) (gdb) $3 = "/mnt/Storage/Data/MP3/Kipelov-ImFree.mp3" (gdb) q (gdb) A debugging session is active. Inferior 1 [process 467] will be killed. Quit anyway? (y or n) ------------------------ 8< ------------------ 8< ------------------------------------ that's clear that hacked-gcc converted: int MPXPSystem::init_vobsub(const std::string& filename) into int MPXPSystem::init_vobsub(char* filename) i suspect that there are no std::string at all :( Modified Paths: -------------- mplayerxp/libvo2/video_out.h Modified: mplayerxp/libvo2/video_out.h =================================================================== --- mplayerxp/libvo2/video_out.h 2013-05-18 15:08:01 UTC (rev 640) +++ mplayerxp/libvo2/video_out.h 2013-05-18 17:23:21 UTC (rev 641) @@ -17,8 +17,10 @@ #include <inttypes.h> #include <stdarg.h> +#ifdef HAVE_X11 #include <X11/Xlib.h> #include <X11/Xutil.h> +#endif #include "dri_vo.h" #include "font_load.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-18 15:08:04
|
Revision: 640 http://sourceforge.net/p/mplayerxp/code/640 Author: nickols_k Date: 2013-05-18 15:08:01 +0000 (Sat, 18 May 2013) Log Message: ----------- make mplayerxp bi-licensed Added Paths: ----------- COPYING.GPLv2 COPYING.GPLv3 Copied: COPYING.GPLv2 (from rev 639, COPYING) =================================================================== --- COPYING.GPLv2 (rev 0) +++ COPYING.GPLv2 2013-05-18 15:08:01 UTC (rev 640) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Added: COPYING.GPLv3 =================================================================== --- COPYING.GPLv3 (rev 0) +++ COPYING.GPLv3 2013-05-18 15:08:01 UTC (rev 640) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-14 14:45:23
|
Revision: 639 http://sourceforge.net/p/mplayerxp/code/639 Author: nickols_k Date: 2013-05-14 14:45:21 +0000 (Tue, 14 May 2013) Log Message: ----------- more streams Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/libao3/ao_null.cpp mplayerxp/libao3/ao_wav.cpp mplayerxp/libmpcodecs/vd_qtvideo.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demux_ogg.cpp mplayerxp/libmpdemux/mux_mpxp64.cpp mplayerxp/libmpdemux/mux_raw.cpp mplayerxp/libmpdemux/muxer.cpp mplayerxp/libmpdemux/muxer.h mplayerxp/libmpdemux/stheader.cpp mplayerxp/libmpstream2/network_asf.cpp mplayerxp/libmpstream2/s_ftp.cpp mplayerxp/libmpsub/subreader.cpp mplayerxp/libmpsub/subreader.h mplayerxp/libmpsub/vobsub.cpp mplayerxp/libvo2/font_load.cpp mplayerxp/libvo2/font_load.h mplayerxp/libvo2/screenshot.cpp mplayerxp/postproc/af_hrtf.cpp mplayerxp/postproc/af_raw.cpp mplayerxp/postproc/libmenu/menu_filesel.cpp mplayerxp/postproc/libmenu/menu_txt.cpp mplayerxp/postproc/vf_raw.cpp mplayerxp/postproc/vf_scale.cpp mplayerxp/win32loader/dshow/DS_Filter.c Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/dump.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -4,6 +4,8 @@ /* dump.c - stream dumper */ +#include <iostream> +#include <fstream> #include <stdio.h> #include <stdlib.h> @@ -28,8 +30,7 @@ int dump_parse(const char *param) { int type=0; - const char *tile; - tile=mrl_parse_line(param,NULL,NULL,&media,&port); + mrl_parse_line(param,NULL,NULL,&media,&port); if(!media) return 0; if(strcmp(media,"stream")==0) type=1; else type=2; @@ -40,7 +41,7 @@ { char buf[4096]; int len; - FILE *f; + std::ofstream f; const char *ext,*name; MP_UNIT("dumpstream"); stream->reset(); @@ -56,17 +57,17 @@ strcpy(buf,port); } name=buf; - f=fopen(name,"wb"); - if(!f){ + f.open(name,std::ios_base::out|std::ios_base::binary); + if(!f.is_open()){ MSG_FATAL(MSGTR_CantOpenDumpfile); exit_player(MSGTR_Fatal_error); } MSG_INFO("Dumping stream to %s\n",name); while(!stream->eof()){ len=stream->read(buf,4096); - if(len>0) fwrite(buf,len,1,f); + if(len>0) f.write(buf,len); } - fclose(f); + f.close(); mpxp_info<<MSGTR_StreamDumped<<std::endl; exit_player(MSGTR_Exit_eof); } @@ -82,7 +83,7 @@ virtual ~dump_priv_t() {} int my_use_pts; - FILE* mux_file; + std::ofstream mux_file; muxer_t* muxer; muxer_stream_t *m_audio,*m_video,*m_subs; unsigned decoded_frameno; @@ -141,9 +142,9 @@ MSG_FATAL("Unsupported muxer format %s found\n",media); exit_player(MSGTR_Fatal_error); } - priv->mux_file=fopen(stream_dump_name,"wb"); + priv->mux_file.open(stream_dump_name,std::ios_base::out|std::ios_base::binary); MSG_DBG2("Preparing stream dumping: %s\n",stream_dump_name); - if(!priv->mux_file){ + if(!priv->mux_file.is_open()){ MSG_FATAL(MSGTR_CantOpenDumpfile); exit_player(MSGTR_Fatal_error); } @@ -270,10 +271,10 @@ if(demuxer->sub->sh) { if(priv->m_subs) MSG_V("Finishing sstream as\n"); } - fseeko(priv->mux_file,0,SEEK_SET); + priv->mux_file.seekp(0,std::ios_base::beg); muxer_write_header(priv->muxer,demuxer); - fclose(priv->mux_file); - delete demuxer->priv; + priv->mux_file.close(); + delete priv; demuxer->priv=NULL; } mpxp_info<<MSGTR_StreamDumped<<std::endl; Modified: mplayerxp/libao3/ao_null.cpp =================================================================== --- mplayerxp/libao3/ao_null.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libao3/ao_null.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -1,6 +1,9 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <iostream> +#include <fstream> + #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -88,7 +91,7 @@ struct timeval last_tv; int buffer; - FILE* fd; + std::ofstream fd; int fast_mode; int wav_mode; }; @@ -96,13 +99,14 @@ Null_AO_Interface::Null_AO_Interface(const std::string& _subdevice) :AO_Interface(_subdevice) {} Null_AO_Interface::~Null_AO_Interface() { - if(fd && wav_mode && fseeko(fd, 0, SEEK_SET) == 0){ /* Write wave header */ + if(fd.is_open() && wav_mode){ /* Write wave header */ + fd.seekp(0, std::ios_base::beg); wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; wavhdr.file_length = le2me_32(wavhdr.file_length); wavhdr.data_length = le2me_32(wavhdr.data_length); - ::fwrite(&wavhdr,sizeof(wavhdr),1,fd); + fd.write((char*)&wavhdr,sizeof(wavhdr)); } - if(fd) ::fclose(fd); + if(fd.is_open()) fd.close(); } void Null_AO_Interface::drain() { @@ -139,8 +143,7 @@ UNUSED(flags); if (!subdevice.empty()) { mrl_parse_line(subdevice,NULL,NULL,&null_dev,&mode); - fd=NULL; - if(null_dev) fd = ::fopen(null_dev, "wb"); + if(null_dev) fd.open(null_dev, std::ios_base::out|std::ios_base::binary); if(::strcmp(mode,"wav")==0) wav_mode=1; } //end parsing subdevice return MPXP_Ok; @@ -179,7 +182,7 @@ } buffer=0; gettimeofday(&last_tv, 0); - if(fd && wav_mode) { + if(fd.is_open() && wav_mode) { wavhdr.channels = le2me_16(_channels); wavhdr.sample_rate = le2me_32(_samplerate); wavhdr.bytes_per_second = le2me_32(afmt2bps(_format)); @@ -188,7 +191,7 @@ wavhdr.data_length=le2me_32(0x7ffff000); wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; - ::fwrite(&wavhdr,sizeof(wavhdr),1,fd); + fd.write((char*)&wavhdr,sizeof(wavhdr)); wavhdr.file_length=wavhdr.data_length=0; } return MPXP_Ok; @@ -225,7 +228,7 @@ UNUSED(flags); if(fd && len) { mpxp_dbg2<<"writing "<<len<<" bytes into file"<<std::endl; - ::fwrite(data,len,1,fd); + fd.write((const char*)data,len); wavhdr.data_length += len; } return fast_mode?bursts*_outburst:len; Modified: mplayerxp/libao3/ao_wav.cpp =================================================================== --- mplayerxp/libao3/ao_wav.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libao3/ao_wav.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -20,6 +20,9 @@ * with MPlayer; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include <iostream> +#include <fstream> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -92,7 +95,7 @@ int fast; uint64_t data_length; - FILE* fp; + std::ofstream fp; WaveHeader wavhdr; unsigned _channels,_samplerate,_format; unsigned _buffersize,_outburst; @@ -102,13 +105,8 @@ :AO_Interface(_subdevice) {} Wave_AO_Interface::~Wave_AO_Interface() { if(pcm_waveheader){ /* Rewrite wave header */ - int broken_seek = 0; -#ifdef __MINGW32__ - // Windows, in its usual idiocy "emulates" seeks on pipes so it always looks - // like they work. So we have to detect them brute-force. - broken_seek = GetFileType((HANDLE)_get_osfhandle(_fileno(fp))) != FILE_TYPE_DISK; -#endif - if (broken_seek || fseek(fp, 0, SEEK_SET) != 0) + fp.seekp(0,std::ios_base::beg); + if (!fp.good()) mpxp_err<<"Could not seek to start, WAV size headers not updated!"<<std::endl; else if (data_length > 0x7ffff000) mpxp_err<<"File larger than allowed for WAV files, may play truncated!"<<std::endl; @@ -116,10 +114,10 @@ wavhdr.file_length = data_length + sizeof(wavhdr) - 8; wavhdr.file_length = le2me_32(wavhdr.file_length); wavhdr.data_length = le2me_32(data_length); - ::fwrite(&wavhdr,sizeof(wavhdr),1,fp); + fp.write((char*)&wavhdr,sizeof(wavhdr)); } } - ::fclose(fp); + fp.close(); } // to set/get/query special features/parameters @@ -189,10 +187,10 @@ wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; mpxp_info<<"ao_wav: "<<out_filename<<" "<<_samplerate<<"-"<<((_channels > 1) ? "Stereo" : "Mono")<<" "<<afmt2str(_format)<<std::endl; - fp = ::fopen(out_filename.c_str(), "wb"); - if(fp) { + fp.open(out_filename.c_str(),std::ios_base::out|std::ios_base::binary); + if(fp.is_open()) { if(pcm_waveheader){ /* Reserve space for wave header */ - ::fwrite(&wavhdr,sizeof(wavhdr),1,fp); + fp.write((char*)&wavhdr,sizeof(wavhdr)); } return MPXP_Ok; } @@ -222,7 +220,7 @@ // return: number of bytes played unsigned Wave_AO_Interface::play(const any_t* data,unsigned len,unsigned flags){ UNUSED(flags); - ::fwrite(data,len,1,fp); + fp.write((const char*)data,len); if(pcm_waveheader) data_length += len; return len; } Modified: mplayerxp/libmpcodecs/vd_qtvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpcodecs/vd_qtvideo.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -260,21 +260,12 @@ //Fill the imagedescription for our SVQ3 frame //we can probably get this from Demuxer -#if 0 - framedescHandle=(ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription)+200); - MSG_V("framedescHandle=%p *p=%p\n",framedescHandle,*framedescHandle); -{ FILE* f=fopen("/root/.wine/fake_windows/IDesc","r"); - if(!f) MSG_ERR("filenot found: IDesc\n"); - fread(*framedescHandle,sizeof(ImageDescription)+200,1,f); - fclose(f); -} -#else if(!sh->ImageDesc) sh->ImageDesc=reinterpret_cast<ImageDescription*>(sh->bih+1); // hack for SVQ3-in-AVI MSG_V("ImageDescription size: %d\n",((ImageDescription*)(sh->ImageDesc))->idSize); framedescHandle=(ImageDescriptionHandle)NewHandleClear(((ImageDescription*)(sh->ImageDesc))->idSize); memcpy(*framedescHandle,sh->ImageDesc,((ImageDescription*)(sh->ImageDesc))->idSize); dump_ImageDescription(*framedescHandle); -#endif + //Find codecscomponent for video decompression // result = FindCodec ('SVQ1',anyCodec,&compressor,&decompressor ); // MSG_V("FindCodec SVQ1 returned:%i compressor: 0x%X decompressor: 0x%X\n",result,compressor,decompressor); Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -10,6 +10,8 @@ */ #include <algorithm> #include <limits> +#include <iostream> +#include <fstream> #include <stdlib.h> #include <stdio.h> @@ -342,7 +344,7 @@ static const int MAX_PARAM_LEN=100; MPXP_Rc M_Config::parse_config_file(const std::string& conffile) { - FILE *fp; + std::ifstream fs; char *line; char opt[MAX_OPT_LEN + 1]; char param[MAX_PARAM_LEN + 1]; @@ -374,7 +376,8 @@ goto out; } - if ((fp = ::fopen(conffile.c_str(), "r")) == NULL) { + fs.open(conffile.c_str(),std::ios_base::in); + if (!fs.is_open()) { if (recursion_depth > 1) mpxp_err<<": "<<::strerror(errno)<<std::endl; delete line; ret = MPXP_Ok; @@ -382,7 +385,8 @@ } if (recursion_depth > 1) mpxp_fatal<<std::endl; - while (fgets(line, MAX_LINE_LEN, fp)) { + while (!fs.eof()) { + fs.getline(line, MAX_LINE_LEN); if (errors >= 16) { mpxp_fatal<<"too many errors"<<std::endl; goto out; @@ -504,7 +508,7 @@ } delete line; - fclose(fp); + fs.close(); out: --recursion_depth; return ret; Modified: mplayerxp/libmpdemux/demux_avi.cpp =================================================================== --- mplayerxp/libmpdemux/demux_avi.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/demux_avi.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -622,45 +622,6 @@ delete priv->suidx; } -/* Read a saved index file */ -#if 0 -if (index_file_load) { - FILE *fp; - char magic[7]; - unsigned int i; - - if ((fp = fopen(index_file_load, "r")) == NULL) { - MSG_ERR(MSGTR_MPDEMUX_AVIHDR_CantReadIdxFile, index_file_load, strerror(errno)); - goto gen_index; - } - fread(&magic, 6, 1, fp); - if (strncmp(magic, "MPIDX1", 6)) { - MSG_ERR(MSGTR_MPDEMUX_AVIHDR_NotValidMPidxFile, index_file_load); - goto gen_index; - } - fread(&priv->idx_size, sizeof(priv->idx_size), 1, fp); - priv->idx=mp_malloc(priv->idx_size*sizeof(AVIINDEXENTRY)); - if (!priv->idx) { - MSG_ERR(MSGTR_MPDEMUX_AVIHDR_FailedMallocForIdxFile, index_file_load); - priv->idx_size = 0; - goto gen_index; - } - - for (i=0; i<priv->idx_size;i++) { - AVIINDEXENTRY *idx; - idx=&((AVIINDEXENTRY *)priv->idx)[i]; - fread(idx, sizeof(AVIINDEXENTRY), 1, fp); - if (feof(fp)) { - MSG_ERR(MSGTR_MPDEMUX_AVIHDR_PrematureEOF, index_file_load); - delete priv->idx; - priv->idx_size = 0; - goto gen_index; - } - } - fclose(fp); - mp_msg(MSGT_HEADER,MSGL_INFO, MSGTR_MPDEMUX_AVIHDR_IdxFileLoaded, index_file_load); -} -#endif /* Generate indexes */ if(index_mode>=2 || (priv->idx_size==0 && index_mode==1)){ // build index for file: @@ -735,27 +696,6 @@ priv->idx_size=priv->idx_pos; MSG_INFO("Indexed are generated for %ul chunks\n",priv->idx_size); if(mp_conf.verbose>=2) print_index(priv->idx,priv->idx_size); - -#if 0 - /* Write generated index to a file */ - if (index_file_save) { - FILE *fp; - unsigned int i; - - if ((fp=fopen(index_file_save, "w")) == NULL) { - MSG_ERR(MSGTR_MPDEMUX_AVIHDR_Failed2WriteIdxFile, index_file_save, strerror(errno)); - return; - } - fwrite("MPIDX1", 6, 1, fp); - fwrite(&priv->idx_size, sizeof(priv->idx_size), 1, fp); - for (i=0; i<priv->idx_size; i++) { - AVIINDEXENTRY *idx = &((AVIINDEXENTRY *)priv->idx)[i]; - fwrite(idx, sizeof(AVIINDEXENTRY), 1, fp); - } - fclose(fp); - MSG_INFO(MSGTR_MPDEMUX_AVIHDR_IdxFileSaved, index_file_save); - } -#endif } } #undef MIN Modified: mplayerxp/libmpdemux/demux_ogg.cpp =================================================================== --- mplayerxp/libmpdemux/demux_ogg.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/demux_ogg.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -182,7 +182,6 @@ static subtitle ogg_sub; static float clear_sub; -//FILE* subout; static MPXP_Rc ogg_probe(Demuxer *demuxer) { Modified: mplayerxp/libmpdemux/mux_mpxp64.cpp =================================================================== --- mplayerxp/libmpdemux/mux_mpxp64.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/mux_mpxp64.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -62,105 +62,105 @@ float prev_seek; }priv_mpxpav64_t; -static void mpxpav64_put64(FILE *f,uint64_t value) +static void mpxpav64_put64(std::ofstream& f,uint64_t value) { uint64_t val; val = me2le_64(value); - fwrite(&val,8,1,f); + f.write((char*)&val,8); } -static void mpxpav64_put32(FILE *f,uint32_t value) +static void mpxpav64_put32(std::ofstream& f,uint32_t value) { uint32_t val; val = me2le_32(value); - fwrite(&val,4,1,f); + f.write((char*)&val,4); } -static void mpxpav64_put16(FILE *f,uint16_t value) +static void mpxpav64_put16(std::ofstream& f,uint16_t value) { uint16_t val; val = me2le_16(value); - fwrite(&val,2,1,f); + f.write((char*)&val,2); } -static void mpxpav64_put8(FILE *f,uint8_t value) +static void mpxpav64_put8(std::ofstream& f,uint8_t value) { - fwrite(&value,1,1,f); + f.write((char*)&value,1); } -static void mpxpav64_put_pts64(FILE *f,double value) +static void mpxpav64_put_pts64(std::ofstream& f,double value) { uint64_t val; val = llrint(value*1000); /* 1 ms */ mpxpav64_put64(f,val); } -static void mpxpav64_put_pts32(FILE *f,float value) +static void mpxpav64_put_pts32(std::ofstream& f,float value) { uint32_t val; val = PTS2INT(value); /* 1 ms */ mpxpav64_put32(f,val); } -static void mpxpav64_put_pts16(FILE *f,float value) +static void mpxpav64_put_pts16(std::ofstream& f,float value) { uint16_t val; val = PTS2INT(value); /* 1 ms */ mpxpav64_put16(f,val); } -static void mpxpav64_put_pts8(FILE *f,float value) +static void mpxpav64_put_pts8(std::ofstream& f,float value) { uint8_t val; val = PTS2INT(value); /* 1 ms */ mpxpav64_put8(f,val); } -static void mpxpav64_put_unicode(FILE *f, const char *tag) +static void mpxpav64_put_unicode(std::ofstream& f, const char *tag) { size_t len; char *str=nls_recode_from_screen_cp("UTF-16LE",tag,&len); mpxpav64_put16(f,len); - fwrite(str,len,1,f); + f.write(str,len); delete str; } -static void mpxpav64_put_frcc_unicode(FILE *f, const char *frcc,const char *tag) +static void mpxpav64_put_frcc_unicode(std::ofstream& f, const char *frcc,const char *tag) { - fwrite(frcc,4,1,f); + f.write(frcc,4); mpxpav64_put_unicode(f,tag); } -static uint64_t mpxpav64_open_header64(FILE *f,const char *id) +static uint64_t mpxpav64_open_header64(std::ofstream& f,const char *id) { - fwrite(id,8,1,f); + f.write(id,8); mpxpav64_put64(f,-1); - return ftello(f); + return f.tellp(); } -static void mpxpav64_close_header64(FILE *f,uint64_t header_start) +static void mpxpav64_close_header64(std::ofstream& f,uint64_t header_start) { uint64_t header_end; - header_end = ftello(f); - fseeko(f,header_start-8,SEEK_SET); + header_end = f.tellp(); + f.seekp(header_start-8,std::ios_base::beg); mpxpav64_put64(f,header_end-header_start); - fseeko(f,header_end,SEEK_SET); + f.seekp(header_end,std::ios_base::beg); } -static uint64_t mpxpav64_open_header32(FILE *f,const char *id) +static uint64_t mpxpav64_open_header32(std::ofstream& f,const char *id) { - fwrite(id,4,1,f); + f.write(id,4); mpxpav64_put32(f,-1); - return ftello(f); + return f.tellp(); } -static void mpxpav64_close_header32(FILE *f,uint64_t header_start) +static void mpxpav64_close_header32(std::ofstream& f,uint64_t header_start) { uint64_t header_end; - header_end = ftello(f); - fseeko(f,header_start-4,SEEK_SET); + header_end = f.tellp(); + f.seekp(header_start-4,std::ios_base::beg); mpxpav64_put32(f,header_end-header_start); - fseeko(f,header_end,SEEK_SET); + f.seekp(header_end,std::ios_base::beg); } static muxer_stream_t* mpxpav64_new_stream(muxer_t *muxer,int type) @@ -206,7 +206,7 @@ static void mpxpav64_put_fcnt(muxer_t *muxer,Demuxer*dinfo) { uint64_t fpos; - FILE *f = muxer->file; + std::ofstream& f = muxer->file; const char *sname; fpos=mpxpav64_open_header32(f,"FCNT"); #ifdef USE_ICONV @@ -297,19 +297,19 @@ priv_mpxpav64_stream_t *privs=(priv_mpxpav64_stream_t *)s->priv; uint64_t fpos,spos,flags=0; uint8_t* frcc; - FILE *f = muxer->file; + std::ofstream& f = muxer->file; VideoPropHeader vprp; fpos=mpxpav64_open_header32(f,"ST64"); switch(s->type) { case MUXER_TYPE_VIDEO: - fwrite("vids",4,1,f); + f.write("vids",4); break; case MUXER_TYPE_AUDIO: - fwrite("auds",4,1,f); + f.write("auds",4); break; default: - fwrite("gens",4,1,f); + f.write("gens",4); break; } mpxpav64_put64(f,privs->data_off); @@ -336,10 +336,10 @@ case MUXER_TYPE_VIDEO: flags=13; mpxpav64_put8(f,flags); - fwrite("video/x-video",flags,1,f); + f.write("video/x-video",flags); spos=mpxpav64_open_header32(f,"BIH "); le2me_BITMAPINFOHEADER(s->bih); - fwrite(s->bih,s->bih->biSize,1,f); + f.write((char*)s->bih,s->bih->biSize); le2me_BITMAPINFOHEADER(s->bih); mpxpav64_close_header32(f,spos); if(s->aspect) @@ -363,7 +363,7 @@ le2me_VIDEO_FIELD_DESC(&vprp.FieldInfo[0]); le2me_VIDEO_FIELD_DESC(&vprp.FieldInfo[1]); spos=mpxpav64_open_header32(f,"vprp"); - fwrite(&vprp,sizeof(VideoPropHeader),1,f); + f.write((char*)&vprp,sizeof(VideoPropHeader)); le2me_VideoPropHeader(&vprp); le2me_VIDEO_FIELD_DESC(&vprp.FieldInfo[0]); le2me_VIDEO_FIELD_DESC(&vprp.FieldInfo[1]); @@ -374,7 +374,7 @@ ImageDescription id; spos=mpxpav64_open_header32(f,"IMGD"); le2me_ImageDesc(&id); - fwrite(&id,sizeof(ImageDescription),1,f); + f.write((char*)&id,sizeof(ImageDescription)); le2me_ImageDesc(&id); mpxpav64_close_header32(f,spos); } @@ -382,10 +382,10 @@ case MUXER_TYPE_AUDIO: flags=13; mpxpav64_put8(f,flags); - fwrite("audio/x-audio",flags,1,f); + f.write("audio/x-audio",flags); spos=mpxpav64_open_header32(f,"WAVE"); le2me_WAVEFORMATEX(s->wf); - fwrite(s->wf,WFSIZE(s->wf),1,f); + f.write((char*)s->wf,WFSIZE(s->wf)); le2me_WAVEFORMATEX(s->wf); mpxpav64_close_header32(f,spos); frcc=(uint8_t *)(&((sh_audio_t *)(s->source))->wtag); @@ -399,7 +399,7 @@ default: flags=17; mpxpav64_put8(f,flags); - fwrite("unknown/x-unknown",flags,1,f); + f.write("unknown/x-unknown",flags); break; } @@ -414,9 +414,9 @@ uint32_t max_bitrate=0; float pts; size_t i; - FILE *f = muxer->file; + std::ofstream& f = muxer->file; if(!pass) pmpxpav64->mainh=mpxpav64_open_header64(f,"MPXPAV64"); - else fseeko(f,16,SEEK_CUR); + else f.seekp(16,std::ios_base::cur); hpos=mpxpav64_open_header64(f,"HEADER64"); fpos=mpxpav64_open_header32(f,"FPRP"); tmp=0; @@ -447,7 +447,7 @@ for(i=0;i<muxer->avih.dwStreams;i++) mpxpav64_put_st64(muxer,muxer->streams[i]); mpxpav64_close_header64(f,hpos); if(!pass) pmpxpav64->datah=mpxpav64_open_header64(f,"AVDATA64"); - else fseeko(f,16,SEEK_CUR); + else f.seekp(16,std::ios_base::cur); pass++; } @@ -456,14 +456,14 @@ { priv_mpxpav64_t *pmpxpav64=(priv_mpxpav64_t *)s->muxer->priv; priv_mpxpav64_stream_t *privs=(priv_mpxpav64_stream_t *)s->priv; - FILE *f = s->muxer->file; + std::ofstream& f = s->muxer->file; uint64_t off; float xpts; uint8_t xflg; int want_pts32,is_seek; uint8_t seek[3]= {'S','E','E'}, Dx[2]; /* make indexes */ - off=ftello(f); + off=f.tellp(); xflg=0; is_seek=0; if(!privs->data_off) privs->data_off=off; @@ -503,7 +503,7 @@ else privs->idx=mp_realloc(privs->idx,(privs->idx_size+1)*sizeof(uint64_t)); ((uint64_t *)(privs->idx))[privs->idx_size]=off; privs->idx_size++; - fwrite(seek,3,1,f); + f.write((char*)seek,3); } want_pts32=0; if(privs->prev_pts==HUGE) want_pts32=1; @@ -537,7 +537,7 @@ Dx[0]=is_seek?'K':flags&AVIIF_KEYFRAME?'D':'d'; Dx[1]=xflg; - fwrite(Dx,2,1,f); + f.write((char*)Dx,2); if((xflg&0x80)==0x80) { if(s->id < 0x100U) mpxpav64_put8(f,s->id); @@ -557,7 +557,7 @@ else if(PTS2INT(xpts)<0x100000000ULL) mpxpav64_put_pts32(f,xpts); else mpxpav64_put_pts64(f,xpts); } - fwrite(s->buffer,len,1,f); + f.write((char*)s->buffer,len); MSG_V("MUX_MPXPAV64: write %lu bytes of #%u %08X flags %f pts %f\n",len,s->id,flags,pts,xpts); /* update statistic */ privs->npackets++; @@ -582,8 +582,8 @@ priv_mpxpav64_stream_t *privs=(priv_mpxpav64_stream_t *)s->priv; uint64_t ioff; uint32_t i; - FILE *f = s->muxer->file; - if(!privs->idx_off) privs->idx_off=ftello(f); + std::ofstream& f = s->muxer->file; + if(!privs->idx_off) privs->idx_off=f.tellp(); ioff=mpxpav64_open_header64(f,"INDEX_64"); mpxpav64_put32(f,s->id); for(i=0;i<privs->idx_size;i++) mpxpav64_put64(f,((uint64_t *)privs->idx)[i]); @@ -595,8 +595,8 @@ priv_mpxpav64_stream_t *privs=(priv_mpxpav64_stream_t *)s->priv; uint64_t ioff; uint32_t i; - FILE *f = s->muxer->file; - if(!privs->idx_off) privs->idx_off=ftello(f); + std::ofstream& f = s->muxer->file; + if(!privs->idx_off) privs->idx_off=f.tellp(); ioff=mpxpav64_open_header32(f,"IX32"); mpxpav64_put32(f,s->id); for(i=0;i<privs->idx_size;i++) mpxpav64_put32(f,((uint64_t *)privs->idx)[i]); @@ -608,8 +608,8 @@ off_t avdata64_size; priv_mpxpav64_t *pmpxpav64=(priv_mpxpav64_t *)muxer->priv; unsigned i; - FILE *f = muxer->file; - avdata64_size=ftello(f); + std::ofstream& f = muxer->file; + avdata64_size=f.tellp(); mpxpav64_close_header64(f,pmpxpav64->datah); for(i=0;i<muxer->avih.dwStreams;i++) { Modified: mplayerxp/libmpdemux/mux_raw.cpp =================================================================== --- mplayerxp/libmpdemux/mux_raw.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/mux_raw.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -62,7 +62,7 @@ static void rawfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags,float pts){ muxer_t *muxer=s->muxer; - fwrite(s->buffer,len,1,muxer->file); + muxer->file.write((char*)s->buffer,len); } static void rawfile_write_header(muxer_t *muxer,Demuxer*dinfo){ Modified: mplayerxp/libmpdemux/muxer.cpp =================================================================== --- mplayerxp/libmpdemux/muxer.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/muxer.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -34,14 +34,13 @@ delete packet; } -muxer_t *muxer_new_muxer(const char *type,const char *subtype,FILE *f){ - muxer_t* muxer=new(zeromem) muxer_t; - muxer->file = f; -// if(!strcmp(type,"lavf")) { if(!muxer_init_muxer_lavf(muxer,subtype)) { delete muxer; muxer=NULL; }} +muxer_t *muxer_new_muxer(const std::string& type,const std::string& subtype,std::ofstream& f){ + muxer_t* muxer=new(zeromem) muxer_t(f); +// if(type=="lavf") { if(!muxer_init_muxer_lavf(muxer,subtype)) { delete muxer; muxer=NULL; }} // else - if(!strcmp(type,"mpxp")) muxer_init_muxer_mpxp64(muxer); + if(type=="mpxp") muxer_init_muxer_mpxp64(muxer); else - if(!strcmp(type,"raw")) muxer_init_muxer_raw(muxer); + if(type=="raw") muxer_init_muxer_raw(muxer); else { delete muxer; muxer=NULL; } return muxer; } Modified: mplayerxp/libmpdemux/muxer.h =================================================================== --- mplayerxp/libmpdemux/muxer.h 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/muxer.h 2013-05-14 14:45:21 UTC (rev 639) @@ -1,5 +1,8 @@ #ifndef MUXER_H_INCLUDED #define MUXER_H_INCLUDED 1 +#include <string> +#include <iostream> +#include <fstream> enum { MUXER_MAX_STREAMS =16, @@ -62,6 +65,7 @@ }; struct muxer_t { + muxer_t(std::ofstream& f):file(f) {} // encoding: MainAVIHeader avih; muxer_stream_t* def_v; // default video stream (for general headers) @@ -71,18 +75,18 @@ void (*cont_write_header)(struct muxer_t *,Demuxer* dinfo); void (*cont_write_index)(struct muxer_t *); muxer_stream_t* (*cont_new_stream)(struct muxer_t *,int); - FILE* file; + std::ofstream& file; any_t*priv; }; -muxer_t *muxer_new_muxer(const char *type,const char *subtype,FILE *f); +muxer_t *muxer_new_muxer(const std::string& type,const std::string& subtype,std::ofstream& f); inline muxer_stream_t* muxer_new_stream(muxer_t* muxer,int a) { return muxer->cont_new_stream(muxer,a); } inline void muxer_write_chunk(muxer_stream_t* a,size_t b,unsigned c,float d) { a->muxer->cont_write_chunk(a,b,c,d); } inline void muxer_write_header(muxer_t* muxer,Demuxer* info) { if(muxer->cont_write_header) muxer->cont_write_header(muxer,info); } inline void muxer_write_index(muxer_t* muxer) { if(muxer->cont_write_index) muxer->cont_write_index(muxer); } inline void muxer_fix_parameters(muxer_t* muxer) { if(muxer->fix_parameters) muxer->fix_parameters(muxer); } -extern void muxer_init_muxer_raw(muxer_t *); -extern void muxer_init_muxer_mpxp64(muxer_t *); -extern int muxer_init_muxer_lavf(muxer_t *,const char *); +extern void muxer_init_muxer_raw(muxer_t*); +extern void muxer_init_muxer_mpxp64(muxer_t*); +extern int muxer_init_muxer_lavf(muxer_t*,const std::string&); #endif Modified: mplayerxp/libmpdemux/stheader.cpp =================================================================== --- mplayerxp/libmpdemux/stheader.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpdemux/stheader.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -126,7 +126,7 @@ (fourcc == mmioFOURCC('m','p','e','g')) || (fourcc == mmioFOURCC('M','P','E','G'))) { - int saved_pos; +// int saved_pos; Demuxer::demuxer_type_e saved_type; /* demuxer pos saving is required for libavcodec mpeg decoder as it's Modified: mplayerxp/libmpstream2/network_asf.cpp =================================================================== --- mplayerxp/libmpstream2/network_asf.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpstream2/network_asf.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -88,17 +88,17 @@ return stream_chunck->size+4; } -static const char asf_stream_header_guid[16] = {0x91, 0x07, 0xdc, 0xb7, +static const uint8_t asf_stream_header_guid[16] = {0x91, 0x07, 0xdc, 0xb7, 0xb7, 0xa9, 0xcf, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65}; -static const char asf_file_header_guid[16] = {0xa1, 0xdc, 0xab, 0x8c, +static const uint8_t asf_file_header_guid[16] = {0xa1, 0xdc, 0xab, 0x8c, 0x47, 0xa9, 0xcf, 0x11, 0x8e, 0xe4, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65}; -static const char asf_content_desc_guid[16] = {0x33, 0x26, 0xb2, 0x75, +static const uint8_t asf_content_desc_guid[16] = {0x33, 0x26, 0xb2, 0x75, 0x8e, 0x66, 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c}; -static const char asf_stream_group_guid[16] = {0xce, 0x75, 0xf8, 0x7b, +static const uint8_t asf_stream_group_guid[16] = {0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2}; -static const char asf_data_chunk_guid[16] = {0x36, 0x26, 0xb2, 0x75, +static const uint8_t asf_data_chunk_guid[16] = {0x36, 0x26, 0xb2, 0x75, 0x8e, 0x66, 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c}; -static int find_asf_guid(char *buf, const char *guid, int cur_pos, int buf_len) +static int find_asf_guid(char *buf, const uint8_t *guid, int cur_pos, int buf_len) { int i; for (i = cur_pos; i < buf_len - 19; i++) { Modified: mplayerxp/libmpstream2/s_ftp.cpp =================================================================== --- mplayerxp/libmpstream2/s_ftp.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpstream2/s_ftp.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -275,7 +275,7 @@ // Close current download if(tcp.established()) { - static const char pre_cmd[]={TELNET_IAC,TELNET_IP,TELNET_IAC,TELNET_SYNCH}; + static const uint8_t pre_cmd[]={TELNET_IAC,TELNET_IP,TELNET_IAC,TELNET_SYNCH}; //int fl; // Send send the telnet sequence needed to make the server react Modified: mplayerxp/libmpsub/subreader.cpp =================================================================== --- mplayerxp/libmpsub/subreader.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpsub/subreader.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -8,8 +8,9 @@ * Some code cleanup & mp_realloc() by A'rpi/ESP-team * dunnowhat sub format by szabi */ +#include <iostream> +#include <fstream> - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -53,8 +54,7 @@ while (i > 0 && isspace(s[i])) s[i--] = '\0'; } - -static subtitle * __FASTCALL__ sub_read_line_sami(FILE *fd, subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_sami(std::ifstream& fd, subtitle *current) { static char line[LINE_LEN+1]; static char *s = NULL, *slacktime_s; char text[LINE_LEN+1], *p=NULL, *q; @@ -64,9 +64,10 @@ state = 0; /* read the first line */ - if (!s) - if (!(s = fgets(line, LINE_LEN, fd))) return 0; - + if (!s) { + fd.getline(line,LINE_LEN); + if (!fd.good()) return 0; + } do { switch (state) { @@ -124,7 +125,8 @@ } /* read next line */ - if (state != 99 && !(s = fgets (line, LINE_LEN, fd))) { + fd.getline(line,LINE_LEN); + if (state != 99 && !fd.good()) { if (current->start > 0) { break; // if it is the last subtitle } else { @@ -166,7 +168,7 @@ else return NULL; // last text field } -static subtitle * __FASTCALL__ sub_read_line_microdvd(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_microdvd(std::ifstream& fd,subtitle *current) { char line[LINE_LEN+1]; char line2[LINE_LEN+1]; char *p; @@ -174,7 +176,8 @@ int i; do { - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line,LINE_LEN); + if (!fd.good()) return NULL; } while ((sscanf (line, "{%ld}{}%[^\r\n]", &(current->start), line2) < 2) && @@ -195,19 +198,21 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_subrip(FILE *fd, subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_subrip(std::ifstream& fd, subtitle *current) { char line[LINE_LEN+1]; int a1,a2,a3,a4,b1,b2,b3,b4; char *p=NULL, *q=NULL; int len; while (1) { - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8) continue; current->start = a1*360000+a2*6000+a3*100+a4; current->end = b1*360000+b2*6000+b3*100+b4; - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; p=q=line; for (current->lines=1; current->lines < SUB_MAX_TEXT; current->lines++) { @@ -224,20 +229,22 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_subviewer(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_subviewer(std::ifstream& fd,subtitle *current) { char line[LINE_LEN+1]; int a1,a2,a3,a4,b1,b2,b3,b4; char *p=NULL; int i,len; while (!current->text[0]) { - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; if ((len=sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8) continue; current->start = a1*360000+a2*6000+a3*100+a4/10; current->end = b1*360000+b2*6000+b3*100+b4/10; for (i=0; i<SUB_MAX_TEXT;) { - if (!fgets (line, LINE_LEN, fd)) break; + fd.getline(line, LINE_LEN); + if (!fd.good()) break; len=0; for (p=line; *p!='\n' && *p!='\r' && *p; p++,len++); if (len) { @@ -254,7 +261,7 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_vplayer(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_vplayer(std::ifstream& fd,subtitle *current) { char line[LINE_LEN+1]; int a1,a2,a3; char *p=NULL, separator; @@ -262,7 +269,8 @@ int i,len,plen; while (!current->text[0]) { - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; if ((len=sscanf (line, "%d:%d:%d%c%n",&a1,&a2,&a3,&separator,&plen)) < 4) continue; @@ -288,7 +296,7 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_rt(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_rt(std::ifstream& fd,subtitle *current) { //TODO: This format uses quite rich (sub/super)set of xhtml // I couldn't check it since DTD is not included. // WARNING: full XML parses can be required for proper parsing @@ -299,7 +307,8 @@ int i,len,plen; while (!current->text[0]) { - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; //TODO: it seems that format of time is not easily determined, it may be 1:12, 1:12.0 or 0:1:12.0 //to describe the same moment in time. Maybe there are even more formats in use. //if ((len=sscanf (line, "<Time Begin=\"%d:%d:%d.%d\" End=\"%d:%d:%d.%d\"",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8) @@ -327,7 +336,7 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_ssa(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_ssa(std::ifstream& fd,subtitle *current) { int hour1, min1, sec1, hunsec1, hour2, min2, sec2, hunsec2, nothing; int num; @@ -338,7 +347,8 @@ char *tmp; do { - if (!fgets (line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; } while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d," "%[^\n\r]", ¬hing, &hour1, &min1, &sec1, &hunsec1, @@ -369,12 +379,12 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_dunnowhat(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_dunnowhat(std::ifstream& fd,subtitle *current) { char line[LINE_LEN+1]; char text[LINE_LEN+1]; - if (!fgets (line, LINE_LEN, fd)) - return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; if (sscanf (line, "%ld,%ld,\"%[^\"]", &(current->start), &(current->end), text) <3) return (subtitle*)ERR; @@ -384,7 +394,7 @@ return current; } -static subtitle * __FASTCALL__ sub_read_line_mpsub(FILE *fd, subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_mpsub(std::ifstream& fd, subtitle *current) { char line[LINE_LEN+1]; float a,b; int num=0; @@ -392,7 +402,8 @@ do { - if (!fgets(line, LINE_LEN, fd)) return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; } while (sscanf (line, "%f %f", &a, &b) !=2); mpsub_position += a*(sub_uses_time ? 100.0 : 1.0); @@ -401,7 +412,8 @@ current->end=(int) mpsub_position; while (num < SUB_MAX_TEXT) { - if (!fgets (line, LINE_LEN, fd)) { + fd.getline(line, LINE_LEN); + if (!fd.good()) { if (num == 0) return NULL; else return current; } @@ -425,12 +437,13 @@ static subtitle *previous_aqt_sub = NULL; -static subtitle * __FASTCALL__ sub_read_line_aqt(FILE *fd,subtitle *current) { +static subtitle * __FASTCALL__ sub_read_line_aqt(std::ifstream& fd,subtitle *current) { char line[LINE_LEN+1]; while (1) { // try to locate next subtitle - if (!fgets (line, LINE_LEN, fd)) + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; if (!(sscanf (line, "-->> %ld", &(current->start)) <1)) break; @@ -441,15 +454,15 @@ previous_aqt_sub = current; - if (!fgets (line, LINE_LEN, fd)) - return NULL; + fd.getline(line, LINE_LEN); + if (!fd.good()) return NULL; sub_readtext(line,¤t->text[0]); current->lines = 1; current->end = current->start; // will be corrected by next subtitle - if (!fgets (line, LINE_LEN, fd)) - return current;; + fd.getline(line, LINE_LEN); + if (!fd.good()) return current; sub_readtext(line,¤t->text[1]); current->lines = 2; @@ -463,15 +476,15 @@ return current; } -static int sub_autodetect (FILE *fd) { +static int sub_autodetect (std::ifstream& fd) { char line[LINE_LEN+1]; int i,j=0; char p; while (j < 100) { j++; - if (!fgets (line, LINE_LEN, fd)) - return SUB_INVALID; + fd.getline(line, LINE_LEN); + if (!fd.good()) return SUB_INVALID; if (sscanf (line, "{%d}{%d}", &i, &i)==2) {sub_uses_time=0;return SUB_MICRODVD;} @@ -628,7 +641,7 @@ static const char *fmtname[] = { "microdvd", "subrip", "subviewer", "sami", "vplayer", "rt", "ssa", "dunnowhat", "mpsub", "aqt" }; -static subtitle * (*__FASTCALL__ func[])(FILE *fd,subtitle *dest)= +static subtitle * (*__FASTCALL__ func[])(std::ifstream& fd,subtitle *dest)= { sub_read_line_microdvd, sub_read_line_subrip, @@ -642,18 +655,18 @@ sub_read_line_aqt }; -subtitle* sub_read_file (const char *filename, float fps) { - FILE *fd; +subtitle* sub_read_file (const std::string& filename, float fps) { + std::ifstream fd; int n_max; subtitle *first; - if(filename==NULL) return NULL; //qnx segfault - fd=fopen (filename, "r"); if (!fd) return NULL; + if(filename.empty()) return NULL; //qnx segfault + fd.open (filename.c_str(),std::ios_base::in); if (!fd.is_open()) return NULL; sub_format=sub_autodetect (fd); - if (sub_format==SUB_INVALID) { MSG_ERR ("SUB: Could not determine file format\n"); fclose(fd); return NULL;} + if (sub_format==SUB_INVALID) { MSG_ERR ("SUB: Could not determine file format\n"); fd.close(); return NULL;} MSG_INFO ("SUB: Detected subtitle file format: %s\n", fmtname[sub_format]); - rewind (fd); + fd.seekg(0,std::ios_base::beg); #ifdef USE_ICONV subcp_open(); @@ -661,7 +674,7 @@ sub_num=0;n_max=32; first=(subtitle *)mp_malloc(n_max*sizeof(subtitle)); - if(!first) { fclose(fd); return NULL; } + if(!first) { fd.close(); return NULL; } while(1){ subtitle *sub; @@ -679,7 +692,7 @@ if(sub==ERR) ++sub_errs; else ++sub_num; // Error vs. Valid } - fclose(fd); + fd.close(); #ifdef USE_ICONV subcp_close(); @@ -729,31 +742,28 @@ ".aqt", ".AQT" }; -char * sub_filename(const char* path,const char * fname ) +std::string sub_filename(const std::string& path,const std::string& fname ) { char * sub_name1; char * sub_name2; char * aviptr1, * aviptr2; - const char * tmp; unsigned i,j; - FILE * f; - int pos=0; + std::ifstream f; + if (fname.empty()) return NULL; - if ( fname == NULL ) return NULL; - - sub_name1=(char *)strrchr(fname,'.'); + sub_name1=(char *)strrchr(fname.c_str(),'.'); if (!sub_name1) return NULL; - pos=sub_name1-fname; - sub_name1=new char [strlen(fname)+8]; - strcpy(sub_name1,fname); + sub_name1=new char [fname.length()+8]; + strcpy(sub_name1,fname.c_str()); - sub_name2=new char [strlen(path) + strlen(fname) + 8]; - if ((tmp=strrchr(fname,'/'))) - sprintf (sub_name2, "%s%s", path, tmp+1); + sub_name2=new char [path.length() + fname.length() + 8]; + size_t tmp=fname.rfind('/'); + if (tmp!=std::string::npos) + sprintf (sub_name2, "%s%s", path.c_str(), fname.substr(tmp+1).c_str()); else - sprintf (sub_name2, "%s%s", path, fname); + sprintf (sub_name2, "%s%s", path.c_str(), fname.c_str()); aviptr1=strrchr(sub_name1,'.'); aviptr2=strrchr(sub_name2,'.'); @@ -766,8 +776,9 @@ for ( i=0;i<(sizeof(sub_exts)/sizeof(char*));i++ ) { #endif strcpy(j?aviptr1:aviptr2,sub_exts[i]); - if((f=fopen( sub_name,"rt" ))) { - fclose( f ); + f.open(sub_name); + if(f.is_open()) { + f.close(); MSG_INFO( "SUB: Detected sub file: %s\n",sub_name ); if (i<2) sub_data.utf8=1; return sub_name; @@ -776,7 +787,7 @@ } delete sub_name1; delete sub_name2; - return NULL; + return ""; } void list_sub_file(subtitle* subs){ @@ -802,48 +813,44 @@ void dump_mpsub(subtitle* subs, float fps){ int i,j; - FILE *fd; + std::ofstream fd; float a,b; mpsub_position=0; if (mp_conf.sub_fps==0) mp_conf.sub_fps=fps; - fd=fopen ("dump.mpsub", "w"); - if (!fd) { + fd.open ("dump.mpsub",std::ios_base::out); + if (!fd.is_open()) { perror ("dump_mpsub: fopen"); return; } - if (sub_uses_time) fprintf (fd,"FORMAT=TIME\n\n"); - else fprintf (fd, "FORMAT=%5.2f\n\n", fps); + if (sub_uses_time) fd<<"FORMAT=TIME"<<std::endl<<std::endl; + else fd<<"FORMAT="<<fps<<std::endl<<std::endl; for(j=0;j<sub_num;j++){ subtitle* egysub=&subs[j]; if (sub_uses_time) { a=((egysub->start-mpsub_position)/100.0); b=((egysub->end-egysub->start)/100.0); - if ( (float)((int)a) == a) - fprintf (fd, "%.0f",a); - else - fprintf (fd, "%.2f",a); + if ( (float)((int)a) == a) fd<<(int)a; + else fd<<a; - if ( (float)((int)b) == b) - fprintf (fd, " %.0f\n",b); - else - fprintf (fd, " %.2f\n",b); + if ( (float)((int)b) == b) fd<<(int)b; + else fd<<b; } else { - fprintf (fd, "%ld %ld\n", (long)((egysub->start*(fps/mp_conf.sub_fps))-((mpsub_position*(fps/mp_conf.sub_fps)))), - (long)(((egysub->end)-(egysub->start))*(fps/mp_conf.sub_fps))); + fd<<(long)((egysub->start*(fps/mp_conf.sub_fps))-((mpsub_position*(fps/mp_conf.sub_fps)))) + <<" "<<(long)(((egysub->end)-(egysub->start))*(fps/mp_conf.sub_fps)); } mpsub_position = egysub->end; for (i=0; i<egysub->lines; i++) { - fprintf (fd, "%s\n",egysub->text[i]); + fd<<" "<<egysub->text[i]<<std::endl; } - fprintf (fd, "\n"); + fd<<std::endl; } - fclose (fd); + fd.close (); MSG_DBG2 ("SUB: Subtitles dumped in \'dump.mpsub\'.\n"); } Modified: mplayerxp/libmpsub/subreader.h =================================================================== --- mplayerxp/libmpsub/subreader.h 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpsub/subreader.h 2013-05-14 14:45:21 UTC (rev 639) @@ -1,6 +1,8 @@ #ifndef __MPLAYER_SUBREADER_H #define __MPLAYER_SUBREADER_H +#include <string> + namespace usr { class Video_Output; } @@ -36,15 +38,15 @@ char *text[SUB_MAX_TEXT]; }; -extern subtitle* sub_read_file (const char *filename, float pts); -extern char * sub_filename(const char *path,const char *fname); +extern subtitle* sub_read_file (const std::string& filename, float pts); +extern std::string sub_filename(const std::string& path,const std::string& fname); extern void list_sub_file(subtitle* subs); extern void dump_mpsub(subtitle* subs, float fps); extern void sub_free(subtitle* subs ); extern void find_sub(subtitle* subtitles,unsigned long key,Video_Output*vo_data); -extern void subcp_open (void); -extern void subcp_close (void); +extern void subcp_open (); +extern void subcp_close (); extern subtitle* subcp_recode (subtitle *sub); extern subtitle* subcp_recode1 (subtitle *sub); Modified: mplayerxp/libmpsub/vobsub.cpp =================================================================== --- mplayerxp/libmpsub/vobsub.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libmpsub/vobsub.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -5,7 +5,9 @@ * Some code freely inspired from VobSub <URL:http://vobsub.edensrising.com>, * with kind permission from Gabest <ga...@fr...> */ -/* #define HAVE_GETLINE */ +#include <iostream> +#include <fstream> + #include <ctype.h> #include <errno.h> #include <limits.h> @@ -23,12 +25,9 @@ #include "spudec.h" #include "mpsub_msg.h" -#ifdef HAVE_GETLINE -extern ssize_t getline(char **, size_t *, FILE *); -#else /* FIXME This should go into a general purpose library or even a separate file. */ -static ssize_t __FASTCALL__ __getline (char **lineptr, size_t *n, FILE *stream) +static ssize_t __FASTCALL__ __getline (char **lineptr, size_t *n, std::ifstream& stream) { size_t res = 0; int c; @@ -47,7 +46,7 @@ if (*lineptr == NULL || *n == 0) return -1; - for (c = fgetc(stream); c != EOF; c = fgetc(stream)) { + for (c = stream.get(); stream.good(); c = stream.get()) { if (res + 1 >= *n) { char *tmp = (char*)mp_realloc(*lineptr, *n * 2); if (tmp == NULL) @@ -66,7 +65,6 @@ (*lineptr)[res] = 0; return res; } -#endif /********************************************************************** * MPEG parsing @@ -725,7 +723,7 @@ return 0; } -static int __FASTCALL__ vobsub_parse_one_line(vobsub_t *vob, FILE *fd) +static int __FASTCALL__ vobsub_parse_one_line(vobsub_t *vob, std::ifstream& fd) { ssize_t line_size; int res = -1; @@ -773,15 +771,17 @@ { vobsub_t *vob = (vobsub_t*)_vob; int res = -1; - FILE *fd = ::fopen(name.c_str(), "rb"); - if (fd == NULL) { + std::ifstream fd; + fd.open(name.c_str(),std::ios_base::in|std::ios_base::binary); + if (!fd.is_open()) { if (force) mpxp_warn<<"VobSub: Can't open IFO file"<<std::endl; } else { // parse IFO header unsigned char block[0x800]; const char *const ifo_magic = "DVDVIDEO-VTS"; - if (fread(block, sizeof(block), 1, fd) != 1) { + fd.read((char*)block, sizeof(block)); + if (!fd.good()) { if (force) mpxp_err<<"VobSub: Can't read IFO header"<<std::endl; } else if (memcmp(block, ifo_magic, strlen(ifo_magic) + 1)) @@ -814,9 +814,9 @@ char *tmp = (char *)block + 0x256 + sid * 6 + 2; langid.assign(tmp,2); } - if (fseek(fd, pgci_sector * sizeof(block), SEEK_SET) - || fread(block, sizeof(block), 1, fd) != 1) - mpxp_err<<"VobSub: Can't read IFO PGCI"<<std::endl; + fd.seekg(pgci_sector * sizeof(block), std::ios_base::beg); + fd.read((char*)block, sizeof(block)); + if (!fd.good()) mpxp_err<<"VobSub: Can't read IFO PGCI"<<std::endl; else { unsigned long idx; unsigned long pgc_offset = block[0xc] << 24 | block[0xd] << 16 @@ -830,7 +830,7 @@ res = 0; } } - fclose(fd); + fd.close(); } return res; } @@ -851,7 +851,7 @@ vob->delay = 0; vob->forced_subs=0; std::string buf; - FILE *fd; + std::ifstream fd; mpeg_t *mpg; /* read in the info file */ std::string stmp=""; @@ -862,8 +862,8 @@ vobsub_parse_ifo(vob,ifo, vob->palette, &vob->orig_frame_width, &vob->orig_frame_height, force, -1, stmp); /* read in the index */ buf=name+".idx"; - fd = ::fopen(buf.c_str(), "rb"); - if (fd == NULL) { + fd.open(buf.c_str(),std::ios_base::in|std::ios_base::binary); + if (!fd.is_open()) { if(force) mpxp_err<<"VobSub: Can't open IDX file"<<std::endl; else { @@ -872,7 +872,7 @@ } } else { while (vobsub_parse_one_line(vob, fd) >= 0) /* NOOP */ ; - ::fclose(fd); + fd.close(); } /* if no palette in .idx then use custom colors */ if ((vob->custom == 0)&&(vob->have_palette!=1)) Modified: mplayerxp/libvo2/font_load.cpp =================================================================== --- mplayerxp/libvo2/font_load.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libvo2/font_load.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -2,6 +2,9 @@ #include "osdep/mplib.h" using namespace usr; +#include <iostream> +#include <fstream> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -12,40 +15,40 @@ #include "sub.h" #include "vo_msg.h" -raw_file* load_raw(const char *name,int verbose){ +raw_file* load_raw(const std::string& name,int verbose){ int bpp; raw_file* raw=new raw_file; unsigned char head[32]; - FILE *f=fopen(name,"rb"); - if(!f) { delete raw; return NULL; } // can't open - if(fread(head,32,1,f)<1) { delete raw; fclose(f); return NULL; } // too small - if(memcmp(head,"mhwanh",6)) { delete raw; fclose(f); return NULL; } // not raw file + std::ifstream f; + f.open(name.c_str(),std::ios_base::in|std::ios_base::binary); + if(!f.is_open()) { delete raw; return NULL; } // can't open + f.read((char*)(head),32); if(!f.good()) { delete raw; f.close(); return NULL; } // too small + if(memcmp(head,"mhwanh",6)) { delete raw; f.close(); return NULL; } // not raw file raw->w=head[8]*256+head[9]; raw->h=head[10]*256+head[11]; raw->c=head[12]*256+head[13]; if(raw->w == 0) /* 2 bytes were not enough for the width... read 4 bytes from the end of the header */ raw->w = ((head[28]*0x100 + head[29])*0x100 + head[30])*0x100 + head[31]; - if(raw->c>256) { delete raw; fclose(f); return NULL; } // too many colors!? + if(raw->c>256) { delete raw; f.close(); return NULL; } // too many colors!? mpxp_v<<"RAW: "<<name<<" "<<raw->w<<" x "<<raw->h<<", "<<raw->c<<" colors"<<std::endl; if(raw->c){ raw->pal=new unsigned char [raw->c*3]; - fread(raw->pal,3,raw->c,f); + f.read((char*)(raw->pal),3*raw->c); bpp=1; } else { raw->pal=NULL; bpp=3; } raw->bmp=new unsigned char [raw->h*raw->w*bpp]; - fread(raw->bmp,raw->h*raw->w*bpp,1,f); - fclose(f); + f.read((char*)(raw->bmp),raw->h*raw->w*bpp); + f.close(); return raw; } -font_desc_t* read_font_desc(const char* fname,float factor,int verbose){ +font_desc_t* read_font_desc(const std::string& fname,float factor,int verbose){ char sor[1024]; unsigned char sor2[1024]; font_desc_t *desc; - FILE *f; char *dn; char section[64]; int i,j; @@ -55,16 +58,17 @@ desc=new(zeromem) font_desc_t; if(!desc) return NULL; - f=fopen(fname,"rt"); - if(!f) { + std::ifstream f; + f.open(fname.c_str(),std::ios_base::in); + if(!f.is_open()) { mpxp_err<<"font: can't open file: "<<fname<<std::endl; delete desc; return NULL; } - i = strlen (fname) - 9; + i = fname.length() - 9; if ((dn = new char [i+1])){ - strncpy (dn, fname, i); + strncpy (dn, fname.c_str(), i); dn[i]='\0'; } @@ -77,7 +81,7 @@ section[0]=0; - while(fgets(sor,1020,f)){ + while(f.getline(sor,1020)){ char* p[8]; int pdb=0; unsigned char *s=(unsigned char *)sor; @@ -223,7 +227,7 @@ } mpxp_err<<"Syntax error in font desc: "<<sor<<std::endl; } - fclose(f); + f.close(); for(i=0;i<=fontdb;i++){ if(!desc->pic_a[i] || !desc->pic_b[i]){ mpxp_err<<"font: Missing bitmap(s) for sub-font #"<<i<<std::endl; @@ -231,19 +235,18 @@ return NULL; } // re-sample alpha - int f=factor*256.0f; + int ff=factor*256.0f; int size=desc->pic_a[i]->w*desc->pic_a[i]->h; - int j; - mpxp_v<<"font: resampling alpha by factor "<<factor<<" ("<<f<<")"<<std::endl; + mpxp_v<<"font: resampling alpha by factor "<<factor<<" ("<<ff<<")"<<std::endl; for(j=0;j<size;j++){ int x=desc->pic_a[i]->bmp[j]; // alpha int y=desc->pic_b[i]->bmp[j]; // bitmap #ifdef FAST_OSD - x=(x<(255-f))?0:1; + x=(x<(255-ff))?0:1; #else - x=255-((x*f)>>8); // scale + x=255-((x*ff)>>8); // scale if(x+y>255) x=255-y; // to avoid overflows Modified: mplayerxp/libvo2/font_load.h =================================================================== --- mplayerxp/libvo2/font_load.h 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libvo2/font_load.h 2013-05-14 14:45:21 UTC (rev 639) @@ -1,5 +1,6 @@ #ifndef __FONT_LOAD_H #define __FONT_LOAD_H 1 +#include <string> struct raw_file { unsigned char *bmp; @@ -22,7 +23,7 @@ short width[65536]; }; -raw_file* load_raw(const char *name,int verbose); -font_desc_t* read_font_desc(const char* fname,float factor,int verbose); +raw_file* load_raw(const std::string& name,int verbose); +font_desc_t* read_font_desc(const std::string& fname,float factor,int verbose); #endif Modified: mplayerxp/libvo2/screenshot.cpp =================================================================== --- mplayerxp/libvo2/screenshot.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/libvo2/screenshot.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -9,6 +9,8 @@ * Uses libpng (which uses zlib), so see according licenses. * */ +#include <iostream> +#include <fstream> #include <stdio.h> #include <stdlib.h> @@ -123,62 +125,61 @@ /* Note: this is LE version */ static void write_bmp(const char *fname,unsigned w,unsigned h,uint8_t *data) { - FILE* out; + std::ofstream f; char c[4]; uint32_t udata; unsigned i; unsigned long fsize_off,data_off,fsize_val,data_val; - if(!(out=fopen(fname,"wb"))) return; + f.open(fname,std::ios_base::out|std::ios_base::binary); + if(!f.is_open()) return; c[0]='B'; c[1]='M'; - fwrite(c,2,1,out); - fsize_off = ftello(out); - fseeko(out,4,SEEK_CUR); + f.write(c,2); + fsize_off = f.tellp(); + f.seekp(4,std::ios_base::cur); memset(c,0,4); - fwrite(c,4,1,out); - data_off=ftello(out); - fseeko(out,4,SEEK_CUR); + f.write(c,4); + data_off=f.tellp(); + f.seekp(4,std::ios_base::cur); udata=40; - fwrite(&udata,4,1,out); /* sizeof BITMAPINFOHEADER == biSize */ + f.write((char*)&udata,4); /* sizeof BITMAPINFOHEADER == biSize */ udata=w; - fwrite(&udata,4,1,out); /* sizeof biWidth */ + f.write((char*)&udata,4); /* sizeof biWidth */ udata=h; - fwrite(&udata,4,1,out); /* sizeof biHeight */ + f.write((char*)&udata,4); /* sizeof biHeight */ udata=1; - fwrite(&udata,2,1,out); /* sizeof biPlanes */ + f.write((char*)&udata,2); /* sizeof biPlanes */ udata=24; - fwrite(&udata,2,1,out); /* sizeof biBitCount */ + f.write((char*)&udata,2); /* sizeof biBitCount */ udata=0; - fwrite(&udata,4,1,out); /* sizeof biCompression */ + f.write((char*)&udata,4); /* sizeof biCompression */ udata=w*h*3; - fwrite(&udata,4,1,out); /* sizeof biSizeImage */ + f.write((char*)&udata,4); /* sizeof biSizeImage */ udata=0; - fwrite(&udata,4,1,out); /* sizeof biXPelsPerMeter */ + f.write((char*)&udata,4); /* sizeof biXPelsPerMeter */ udata=0; - fwrite(&udata,4,1,out); /* sizeof biYPelsPerMeter */ + f.write((char*)&udata,4); /* sizeof biYPelsPerMeter */ udata=0; - fwrite(&udata,4,1,out); /* sizeof biClrUsed */ + f.write((char*)&udata,4); /* sizeof biClrUsed */ udata=0; - fwrite(&udata,4,1,out); /* sizeof biClrImportant */ - data_val=ftello(out); - for(i=0;i<h;i++) /* flip picture here */ - { - fwrite(data+(w*3)*(h-i-1),w*3,1,out); + f.write((char*)&udata,4); /* sizeof biClrImportant */ + data_val=f.tellp(); + for(i=0;i<h;i++) {/* flip picture here */ + f.write((char*)(data+(w*3)*(h-i-1)),w*3); } - fsize_val=ftello(out); - fseeko(out,fsize_off,SEEK_SET); - fwrite(&fsize_val,4,1,out); - fseeko(out,data_off,SEEK_SET); - fwrite(&data_val,2,1,out); - fseeko(out,fsize_val,SEEK_SET); - fclose(out); + fsize_val=f.tellp(); + f.seekp(fsize_off,std::ios_base::beg); + f.write((char*)&fsize_val,4); + f.seekp(data_off,std::ios_base::beg); + f.write((char*)&data_val,2); + f.seekp(fsize_val,std::ios_base::beg); + f.close(); } #endif MPXP_Rc gr_screenshot(const char *fname,const uint8_t *planes[],const unsigned *strides,uint32_t fourcc,unsigned w,unsigned h) { - unsigned k; char buf[256]; #ifdef HAVE_PNG struct pngdata png; @@ -186,7 +187,6 @@ uint8_t *image_data=NULL; uint8_t *dst[3]; int dstStride[3]; - unsigned bpp = 24; struct SwsContext * sws = NULL; Modified: mplayerxp/postproc/af_hrtf.cpp =================================================================== --- mplayerxp/postproc/af_hrtf.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/postproc/af_hrtf.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -136,17 +136,6 @@ float l_agc, r_agc, lpr_agc, lmr_agc; float f, d_gain, c_gain, c_agc_cfk; -#if 0 - static int counter = 0; - static FILE *fp_out; - - if(counter == 0) - fp_out = fopen("af_hrtf.log", "w"); - if(counter % 240 == 0) - fprintf(fp_out, "%g %g %g %g %g ", counter * (1.0 / 48000), - l_gain, r_gain, lpr_gain, lmr_gain); -#endif - /*** AXIS NO. 1: (Lt, Rt) -> (C, Ls, Rs) ***/ /* AGC adaption */ d_gain = (fabs(l_gain - *adapt_l_gain) + Modified: mplayerxp/postproc/af_raw.cpp =================================================================== --- mplayerxp/postproc/af_raw.cpp 2013-05-14 12:02:20 UTC (rev 638) +++ mplayerxp/postproc/af_raw.cpp 2013-05-14 14:45:21 UTC (rev 639) @@ -5,6 +5,8 @@ This audio filter exports the incoming signal to raw or RIFF WAVE file TODO: add length + pts to export into sockets */ +#include <iostream> +#include <fstream> #include <stdio.h> #include <stdlib.h> @@ -50,7 +52,7 @@ char* filename; // File to export data int wav_mode; struct WaveHeader wavhdr; - FILE *fd; + std::ofstream fd; }; /* Initialization and runtime control_af @@ -64,13 +66,14 @@ char *pt; // Accepts any streams memcpy(&af->conf,arg,sizeof(af_conf_t)); - if(!s->fd) { /* reenterability */ - if(!(s->fd=fopen(s->filename,"wb"))) + if(s->fd.is_open()) { /* reenterability */ + s->fd.open(s->filename,std::ios_base::out|std::ios_base::binary); + if(!(s->fd.is_open())) MSG_ERR("Can't open %s\n",s->filename); pt=strchr(s->filename,'.'); s->wav_mode=0; if(pt) if(strcmp(pt+1,"wav")==0) s->wav_mode=1; - if(s->wav_mode && s->fd) + if(s->wav_mode && s->fd.is_open()) { uint16_t fmt=af->conf.format>>16; if(!fmt) fmt=0x01; /* pcm */ @@ -87,7 +90,7 @@ s->wavhdr.bits = le2me_16((af->conf.format&MPAF_BPS_MASK)*8); s->wavhdr.data=le2me_32(WAV_ID_DATA); s->wavhdr.data_length=le2me_32(0x7ffff000); - fwrite(&s->wavhdr,sizeof(struct WaveHeader),1,s->fd); + s->fd.write((char*)(&s->wavhdr),sizeof(struct WaveHeader)); s->wavhdr.file_length=s->wavhdr.data_length=0; } } @@ -119,21 +122,20 @@ { af_raw_t* s = reinterpret_cast<af_raw_t*>(af->setup); if(s) { - if(s->fd) { - off_t pos = ftello(s->fd); + if(s->fd.is_open()) { + off_t pos = s->fd.tellp(); if(s->wav_mode){ /* Write wave header */ - fseeko(s->fd, 0, SEEK_SET); + s->fd.seekp(0, std::ios_base::beg); s->wavhdr.file_length = pos-8; s->wavhdr.file_length = le2me_32(s->wavhdr.file_length); s->wavhdr.data_length = le2me_32(s->wavhdr.data_length); - fwrite(&s->wavhdr,sizeof(struct WaveHeader),1,s->fd); - fseeko(s->fd, pos, SEEK_SET); + s->fd.write((c... [truncated message content] |
From: <nic...@us...> - 2013-05-14 12:02:23
|
Revision: 638 http://sourceforge.net/p/mplayerxp/code/638 Author: nickols_k Date: 2013-05-14 12:02:20 +0000 (Tue, 14 May 2013) Log Message: ----------- more streams Modified Paths: -------------- mplayerxp/libmpstream2/s_file.cpp mplayerxp/libvo2/vo_fbdev.cpp Modified: mplayerxp/libmpstream2/s_file.cpp =================================================================== --- mplayerxp/libmpstream2/s_file.cpp 2013-05-08 13:49:59 UTC (rev 637) +++ mplayerxp/libmpstream2/s_file.cpp 2013-05-14 12:02:20 UTC (rev 638) @@ -4,6 +4,9 @@ /* s_file - stream interface for file i/o. */ +#include <iostream> +#include <fstream> + #include <errno.h> #include <stdlib.h> #include <stdio.h> @@ -36,29 +39,29 @@ virtual off_t sector_size() const; virtual std::string mime_type() const; private: - int fd; - int was_open; + std::ifstream fs; off_t spos; off_t end_pos; }; File_Stream_Interface::File_Stream_Interface(libinput_t&l) :Stream_Interface(l), - fd(0),was_open(0),spos(0) {} + spos(0) {} File_Stream_Interface::~File_Stream_Interface() {} MPXP_Rc File_Stream_Interface::open(const std::string& filename,unsigned flags) { UNUSED(flags); - if(filename=="-") fd=0; - else fd=::open(filename.c_str(),O_RDONLY); - if(fd<0) { +// if(filename=="-") fd=0; +// else fd=::open(filename.c_str(),O_RDONLY); + fs.open(filename.c_str(),std::ios_base::binary | std::ios_base::in); + if(!fs.is_open()) { mpxp_err<<"[s_file] Cannot open file: "<<filename<<std::endl; return MPXP_False; } - was_open = (fd==0)?0:1; - end_pos = ::lseek(fd,0,SEEK_END); - ::lseek(fd,0,SEEK_SET); + fs.seekg(0,std::ios_base::end); + end_pos = fs.tellg(); + fs.seekg(0,std::ios_base::beg); /* decreasing number of packet from 256 to 10 speedups cache2 from 3.27% to 1.26% with full speed 1.04% for -nocache */ /* Note: Please locate sector_size changinf after all read/write operations of open() function */ @@ -76,14 +79,18 @@ Should we repeate read() again on these errno: `EAGAIN', `EIO' ??? */ sp->type=0; - sp->len = ::read(fd,sp->buf,sp->len); - if(sp->len>0) spos += sp->len; - return sp->len; + fs.read(sp->buf,sp->len); + spos = fs.tellg(); + return fs.good()?sp->len:-1; } off_t File_Stream_Interface::seek(off_t pos) { - spos=::lseek(fd,pos,SEEK_SET); + fs.clear(fs.failbit); + fs.clear(fs.badbit); + fs.clear(fs.eofbit); + fs.seekg(pos,std::ios_base::beg); + spos=fs.tellg(); return spos; } @@ -94,7 +101,7 @@ void File_Stream_Interface::close() { - if(was_open) ::close(fd); + if(fs.is_open()) fs.close(); } MPXP_Rc File_Stream_Interface::ctrl(unsigned cmd,any_t*args) { Modified: mplayerxp/libvo2/vo_fbdev.cpp =================================================================== --- mplayerxp/libvo2/vo_fbdev.cpp 2013-05-08 13:49:59 UTC (rev 637) +++ mplayerxp/libvo2/vo_fbdev.cpp 2013-05-14 12:02:20 UTC (rev 638) @@ -8,6 +8,8 @@ * * Some idea and code borrowed from Chris Lawrence's ppmtofb-0.27 */ +#include <iostream> +#include <fstream> static const char* FBDEV= "fbdev: "; @@ -128,12 +130,11 @@ MPXP_Rc fb_preinit(); std::string parse_sub_device(const std::string& sd); int parse_fbmode_cfg(const std::string& cfgfile); - int get_token(int num); + int get_token(std::ifstream&,int num); void vt_set_textarea(int u, int l); void lots_of_printf() const; LocalPtr<Aspect>aspect; - FILE * fp; int line_num; char * line; char * token[MAX_NR_TOKEN]; @@ -145,8 +146,7 @@ range_t * monitor_dotclock; fb_mode_t * mode; /* vt related variables */ - int vt_fd; - FILE * vt_fp; + std::ofstream vt_fp; int vt_doit; /* vo_fbdev related variables */ int dev_fd; @@ -175,7 +175,6 @@ unsigned out_width; unsigned out_height; int last_row; - int fs; MPXP_Rc pre_init_err; #ifdef CONFIG_VIDIX /* Name of VIDIX driver */ @@ -314,7 +313,7 @@ if(fb_preinit()!=MPXP_Ok) exit_player("FBDev preinit"); } -int FBDev_VO_Interface::get_token(int num) +int FBDev_VO_Interface::get_token(std::ifstream& fp,int num) { static int read_nextline = 1; static int line_pos; @@ -327,7 +326,8 @@ } if (read_nextline) { - if (!fgets(line, MAX_LINE_LEN, fp)) goto out_eof; + fp.getline(line, MAX_LINE_LEN); + if (!fp.good()) goto out_eof; line_pos = 0; ++line_num; read_nextline = 0; @@ -374,10 +374,12 @@ char *endptr; // strtoul()... int in_mode_def = 0; int tmp, i; + std::ifstream fp; mpxp_dbg2<<"Reading "<<cfgfile.c_str()<<":"; - if ((fp = fopen(cfgfile.c_str(), "r")) == NULL) { + fp.open(cfgfile.c_str(),std::ios_base::in); + if (!fp.is_open()) { mpxp_err<<"can't open '"<<cfgfile<<"': "<<strerror(errno)<<std::endl; return -1; } @@ -390,12 +392,12 @@ /* * check if the cfgfile starts with 'mode' */ - while ((tmp = get_token(1)) == RET_EOL) /* NOTHING */; + while ((tmp = get_token(fp,1)) == RET_EOL) /* NOTHING */; if (tmp == RET_EOF) goto out; if (!strcmp(token[0], "mode")) goto loop_enter; goto err_out_parse_error; - while ((tmp = get_token(1)) != RET_EOF) { + while ((tmp = get_token(fp,1)) != RET_EOF) { if (tmp == RET_EOL) continue; if (!strcmp(token[0], "mode")) { if (in_mode_def) { @@ -413,7 +415,7 @@ ++nr_modes; memset(_mode,0,sizeof(fb_mode_t)); - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; for (i = 0; i < nr_modes - 1; i++) { if (!strcmp(token[0], fb_modes[i].name)) { mpxp_err<<"mode name '"<<token[0]<<"' isn't unique"<<std::endl; @@ -427,7 +429,7 @@ in_mode_def = 1; } else if (!strcmp(token[0], "geometry")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(5) < 0) goto err_out_parse_error; + if (get_token(fp,5) < 0) goto err_out_parse_error; _mode->xres = strtoul(token[0], &endptr, 0); if (*endptr) goto err_out_parse_error; _mode->yres = strtoul(token[1], &endptr, 0); @@ -440,7 +442,7 @@ if (*endptr) goto err_out_parse_error; } else if (!strcmp(token[0], "timings")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(7) < 0) goto err_out_parse_error; + if (get_token(fp,7) < 0) goto err_out_parse_error; _mode->pixclock = strtoul(token[0], &endptr, 0); if (*endptr) goto err_out_parse_error; _mode->left = strtoul(token[1], &endptr, 0); @@ -460,44 +462,44 @@ in_mode_def = 0; } else if (!strcmp(token[0], "accel")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; /* * it's only used for text acceleration * so we just ignore it. */ } else if (!strcmp(token[0], "hsync")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; if (!strcmp(token[0], "low")) _mode->sync &= ~FB_SYNC_HOR_HIGH_ACT; else if(!strcmp(token[0], "high")) _mode->sync |= FB_SYNC_HOR_HIGH_ACT; else goto err_out_parse_error; } else if (!strcmp(token[0], "vsync")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; if (!strcmp(token[0], "low")) _mode->sync &= ~FB_SYNC_VERT_HIGH_ACT; else if(!strcmp(token[0], "high")) _mode->sync |= FB_SYNC_VERT_HIGH_ACT; else goto err_out_parse_error; } else if (!strcmp(token[0], "csync")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; if (!strcmp(token[0], "low")) _mode->sync &= ~FB_SYNC_COMP_HIGH_ACT; else if(!strcmp(token[0], "high")) _mode->sync |= FB_SYNC_COMP_HIGH_ACT; else goto err_out_parse_error; } else if (!strcmp(token[0], "extsync")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; if (!strcmp(token[0], "false")) _mode->sync &= ~FB_SYNC_EXT; else if(!strcmp(token[0], "true")) _mode->sync |= FB_SYNC_EXT; else goto err_out_parse_error; } else if (!strcmp(token[0], "laced")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; if (!strcmp(token[0], "false")) _mode->vmode = FB_VMODE_NONINTERLACED; else if (!strcmp(token[0], "true")) _mode->vmode = FB_VMODE_INTERLACED; else goto err_out_parse_error; } else if (!strcmp(token[0], "double")) { check_in_mode_def(in_mode_def); goto err_out_print_linenum; - if (get_token(1) < 0) goto err_out_parse_error; + if (get_token(fp,1) < 0) goto err_out_parse_error; if (!strcmp(token[0], "false")) ; else if (!strcmp(token[0], "true")) _mode->vmode = FB_VMODE_DOUBLE; else goto err_out_parse_error; @@ -507,7 +509,7 @@ out: mpxp_dbg2<<nr_modes<<"modes"<<std::endl; delete line; - fclose(fp); + fp.close(); return nr_modes; err_out_parse_error: mpxp_err<<"parse error"; @@ -520,7 +522,6 @@ } nr_modes = 0; delete line; - delete fp; return -2; err_out_not_valid: mpxp_err<<"previous mode is not correct"<<std::endl; @@ -873,8 +874,8 @@ if (mp_conf.verbose > 1) mpxp_dbg2<<FBDEV<< "vt_set_textarea("<<u<<","<<l<<"): "<<urow<<","<<lrow<<std::endl; - ::fprintf(vt_fp, "\33[%d;%dr\33[%d;%dH", urow, lrow, lrow, 0); - ::fflush(vt_fp); + vt_fp<<"\33["<<urow<<";"<<lrow<<"r\33["<<lrow<<";0H"; + vt_fp.flush(); } MPXP_Rc FBDev_VO_Interface::configure(uint32_t width, uint32_t height, uint32_t d_width, @@ -1079,11 +1080,8 @@ return MPXP_False; } } - if (vt_doit && (vt_fd = open("/dev/tty", O_WRONLY)) == -1) { - mpxp_err<<FBDEV<< "can't open /dev/tty: "<<strerror(errno)<<std::endl; - vt_doit = 0; - } - if (vt_doit && !(vt_fp = fdopen(vt_fd, "w"))) { + vt_fp.open("/dev/tty", std::ios_base::out); + if (vt_doit && !vt_fp.is_open()) { mpxp_err<<FBDEV<< "can't fdopen /dev/tty: "<<strerror(errno)<<std::endl; vt_doit = 0; } @@ -1096,18 +1094,19 @@ MPXP_Rc FBDev_VO_Interface::query_format(vo_query_fourcc_t * format) const { + MPXP_Rc rc=MPXP_False; #ifdef CONFIG_VIDIX if(vidix) return vidix->query_fourcc(format); #endif format->flags=VOCAP_NA; switch(format->fourcc) { - case IMGFMT_BGR15: if(bpp == 15) format->flags=VOCAP_SUPPORTED; break; - case IMGFMT_BGR16: if(bpp == 16) format->flags=VOCAP_SUPPORTED; break; - case IMGFMT_BGR24: if(bpp == 24) format->flags=VOCAP_SUPPORTED; break; - case IMGFMT_BGR32: if(bpp == 32) format->flags=VOCAP_SUPPORTED; break; + case IMGFMT_BGR15: if(bpp == 15) format->flags=VOCAP_SUPPORTED; rc=MPXP_Ok; break; + case IMGFMT_BGR16: if(bpp == 16) format->flags=VOCAP_SUPPORTED; rc=MPXP_Ok; break; + case IMGFMT_BGR24: if(bpp == 24) format->flags=VOCAP_SUPPORTED; rc=MPXP_Ok; break; + case IMGFMT_BGR32: if(bpp == 32) format->flags=VOCAP_SUPPORTED; rc=MPXP_Ok; break; default: break; } - return MPXP_Ok; + return rc; } MPXP_Rc FBDev_VO_Interface::select_frame(unsigned idx) @@ -1115,14 +1114,11 @@ #ifdef CONFIG_VIDIX if(vidix) return vidix->select_frame(idx); #endif - unsigned i, out_offset = 0, in_offset = 0; - for (i = 0; i < out_height; i++) { - memcpy( L123123875 + out_offset, next_frame[idx] + in_offset, - out_width * pixel_size); - out_offset += line_len; - in_offset += out_width * pixel_size; - } + size_t src_stride=out_width*pixel_size; + size_t dst_stride=line_len; + stream_copy_pic(L123123875,next_frame[idx],src_stride,out_height,dst_stride,src_stride); + return MPXP_Ok; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-08 13:50:06
|
Revision: 637 http://sourceforge.net/p/mplayerxp/code/637 Author: nickols_k Date: 2013-05-08 13:49:59 +0000 (Wed, 08 May 2013) Log Message: ----------- sync with beye + minor constantization Modified Paths: -------------- mplayerxp/libao3/audio_out.cpp mplayerxp/libmpdemux/aviprint.cpp mplayerxp/libmpstream2/stream.cpp mplayerxp/libmpstream2/stream.h mplayerxp/libvo2/font_load.cpp mplayerxp/libvo2/video_out.cpp mplayerxp/main.cpp Modified: mplayerxp/libao3/audio_out.cpp =================================================================== --- mplayerxp/libao3/audio_out.cpp 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/libao3/audio_out.cpp 2013-05-08 13:49:59 UTC (rev 637) @@ -1,6 +1,8 @@ #include "mpxp_config.h" #include "osdep/mplib.h" using namespace usr; +#include <vector> + #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -71,16 +73,46 @@ struct priv_t : public Opaque { public: - priv_t() {} + priv_t(); virtual ~priv_t() {} char antiviral_hole[RND_CHAR5]; const ao_info_t*info; AO_Interface* driver; + std::vector<const ao_info_t*> list; int muted; float mute_l,mute_r; }; +priv_t::priv_t() { +#ifdef USE_OSS_AUDIO + list.push_back(&audio_out_oss); +#endif +#ifdef HAVE_SDL + list.push_back(&audio_out_sdl); +#endif +#ifdef HAVE_ALSA + list.push_back(&audio_out_alsa); +#endif +#ifdef HAVE_ARTS + list.push_back(&audio_out_arts); +#endif +#ifdef HAVE_ESD + list.push_back(&audio_out_esd); +#endif +#ifdef HAVE_OPENAL + list.push_back(&audio_out_openal); +#endif +#ifdef HAVE_NAS + list.push_back(&audio_out_nas); +#endif +#ifdef HAVE_JACK + list.push_back(&audio_out_jack); +#endif + list.push_back(&audio_out_wav); + list.push_back(&audio_out_null); +} + const char * __FASTCALL__ ao_format_name(int format) { switch (format) @@ -207,17 +239,17 @@ MPXP_Rc Audio_Output::_register(const std::string& driver_name,unsigned flags) const { priv_t& priv=static_cast<priv_t&>(opaque); - unsigned i; + size_t i,sz=priv.list.size(); if(driver_name.empty()) { - priv.info=audio_out_drivers[0]; - priv.driver=audio_out_drivers[0]->query_interface(subdevice?subdevice:""); + priv.info=priv.list[0]; + priv.driver=priv.list[0]->query_interface(subdevice?subdevice:""); } else - for (i=0; audio_out_drivers[i] != &audio_out_null; i++) { - const ao_info_t *info = audio_out_drivers[i]; + for (i=0; i<sz; i++) { + const ao_info_t *info = priv.list[i]; if(info->short_name==driver_name){ - priv.info = audio_out_drivers[i]; - priv.driver = audio_out_drivers[i]->query_interface(subdevice?subdevice:""); + priv.info = priv.list[i]; + priv.driver = priv.list[i]->query_interface(subdevice?subdevice:""); break; } } Modified: mplayerxp/libmpdemux/aviprint.cpp =================================================================== --- mplayerxp/libmpdemux/aviprint.cpp 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/libmpdemux/aviprint.cpp 2013-05-08 13:49:59 UTC (rev 637) @@ -109,7 +109,7 @@ MSG_V("======= End of WAVE Format =======\n"); } -static char * aspect_ratios[]= +static const char * aspect_ratios[]= { "forbidden", "1.0000 (VGA)", @@ -129,7 +129,7 @@ "reserved" }; -static char *decode_aspect_ratio(unsigned char id) +static const char *decode_aspect_ratio(unsigned char id) { if(id>15) id=0; return aspect_ratios[id]; Modified: mplayerxp/libmpstream2/stream.cpp =================================================================== --- mplayerxp/libmpstream2/stream.cpp 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/libmpstream2/stream.cpp 2013-05-08 13:49:59 UTC (rev 637) @@ -58,45 +58,40 @@ extern const stream_interface_info_t file_stream; extern const stream_interface_info_t null_stream; -static const stream_interface_info_t* sdrivers[] = +Stream::Stream(Stream::type_e t) + :_type(t) { #ifdef HAVE_LIBCDIO_CDDA - &cdda_stream, + list.push_back(&cdda_stream); #ifdef HAVE_STREAMING - &cddb_stream, + list.push_back(&cddb_stream); #endif #endif #ifdef USE_DVDNAV - &dvdnav_stream, + list.push_back(&dvdnav_stream); #endif #ifdef USE_DVDREAD - &dvdread_stream, + list.push_back(&dvdread_stream); #endif #ifdef USE_TV - &tv_stream, + list.push_back(&tv_stream); #endif #ifdef USE_LIBVCD - &vcdnav_stream, + list.push_back(&vcdnav_stream); #endif #ifdef USE_OSS_AUDIO - &oss_stream, + list.push_back(&oss_stream); #endif #ifdef HAVE_STREAMING - &ftp_stream, - &rtsp_stream, - &udp_stream, - &network_stream, + list.push_back(&ftp_stream); + list.push_back(&rtsp_stream); + list.push_back(&udp_stream); + list.push_back(&network_stream); #endif - &lavs_stream, - &stdin_stream, - &file_stream, - &null_stream, - NULL -}; - -Stream::Stream(Stream::type_e t) - :_type(t) -{ + list.push_back(&lavs_stream); + list.push_back(&stdin_stream); + list.push_back(&file_stream); + list.push_back(&null_stream); pin=STREAM_PIN; reset(); } @@ -125,20 +120,19 @@ MPXP_Rc Stream::open(libinput_t&libinput,const std::string& filename,int* ff) { - unsigned i,done; + size_t i,sz=list.size(); unsigned mrl_len; file_format=*ff; - done=0; - for(i=0;sdrivers[i]!=&null_stream;i++) { - mrl_len=strlen(sdrivers[i]->mrl); - if(filename.substr(0,mrl_len)==sdrivers[i]->mrl||sdrivers[i]->mrl[0]=='*') { - mpxp_v<<"[Stream]: "<<"Opening "<<sdrivers[i]->mrl<<" ... "; - Stream_Interface* drv = sdrivers[i]->query_interface(libinput); - if(sdrivers[i]->mrl[0]=='*') mrl_len=0; + for(i=0;i<sz;i++) { + mrl_len=strlen(list[i]->mrl); + if(filename.substr(0,mrl_len)==list[i]->mrl||list[i]->mrl[0]=='*') { + mpxp_v<<"[Stream]: "<<"Opening "<<list[i]->mrl<<" ... "; + Stream_Interface* drv = list[i]->query_interface(libinput); + if(list[i]->mrl[0]=='*') mrl_len=0; if(drv->open(&filename[mrl_len],0)==MPXP_Ok) { mpxp_v<<"Ok"<<std::endl; *ff = file_format; - driver_info=sdrivers[i]; + driver_info=list[i]; driver=drv; return MPXP_Ok; } @@ -243,6 +237,41 @@ return y; } +static const stream_interface_info_t* sdrivers[] = +{ +#ifdef HAVE_LIBCDIO_CDDA + &cdda_stream, +#ifdef HAVE_STREAMING + &cddb_stream, +#endif +#endif +#ifdef USE_DVDNAV + &dvdnav_stream, +#endif +#ifdef USE_DVDREAD + &dvdread_stream, +#endif +#ifdef USE_TV + &tv_stream, +#endif +#ifdef USE_LIBVCD + &vcdnav_stream, +#endif +#ifdef USE_OSS_AUDIO + &oss_stream, +#endif +#ifdef HAVE_STREAMING + &ftp_stream, + &rtsp_stream, + &udp_stream, + &network_stream, +#endif + &lavs_stream, + &stdin_stream, + &file_stream, + &null_stream, + NULL +}; void Stream::print_drivers() { unsigned i; Modified: mplayerxp/libmpstream2/stream.h =================================================================== --- mplayerxp/libmpstream2/stream.h 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/libmpstream2/stream.h 2013-05-08 13:49:59 UTC (rev 637) @@ -4,6 +4,7 @@ #include "osdep/mplib.h" using namespace usr; +#include <vector> #include <string> #include <inttypes.h> #include <sys/types.h> @@ -91,6 +92,7 @@ private: int read(stream_packet_t* sp); Stream_Interface* driver; /**< low-level stream driver */ + std::vector<const stream_interface_info_t*> list; type_e _type; int _eof; /**< indicates EOF */ }; Modified: mplayerxp/libvo2/font_load.cpp =================================================================== --- mplayerxp/libvo2/font_load.cpp 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/libvo2/font_load.cpp 2013-05-08 13:49:59 UTC (rev 637) @@ -51,7 +51,6 @@ int i,j; int chardb=0; int fontdb=-1; - int version=0; desc=new(zeromem) font_desc_t; if(!desc) return NULL; @@ -135,7 +134,7 @@ continue; } } else if(strcmp(section,"[files]")==0){ - char *default_dir=DATADIR"/font"; + const char *default_dir=DATADIR"/font"; if(pdb==2 && strcmp(p[0],"alpha")==0){ char *cp; if (!(cp=new char [strlen(desc->fpath)+strlen(p[1])+2])) { @@ -193,10 +192,6 @@ desc->name=mp_strdup(p[1]); continue; } - if(pdb==2 && strcmp(p[0],"descversion")==0){ - version=atoi(p[1]); - continue; - } if(pdb==2 && strcmp(p[0],"spacewidth")==0){ desc->spacewidth=atoi(p[1]); continue; Modified: mplayerxp/libvo2/video_out.cpp =================================================================== --- mplayerxp/libvo2/video_out.cpp 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/libvo2/video_out.cpp 2013-05-08 13:49:59 UTC (rev 637) @@ -23,6 +23,7 @@ */ #include <algorithm> #include <iomanip> +#include <vector> #include <stdio.h> #include <stdint.h> @@ -121,11 +122,31 @@ dri_priv_t dri; const vo_info_t* video_out; class VO_Interface* vo_iface; + std::vector<const vo_info_t*> list; const OSD_Render* draw_alpha; vf_stream_t* parent; }; vo_priv_t::vo_priv_t() { +#ifdef HAVE_XV + list.push_back(&xv_vo_info); +#endif +#ifdef HAVE_OPENGL + list.push_back(&opengl_vo_info); +#endif +#ifdef HAVE_X11 + list.push_back(&x11_vo_info); +#endif +#ifdef HAVE_SDL + list.push_back(&sdl_vo_info); +#endif +#ifdef HAVE_VESA + list.push_back(&vesa_vo_info); +#endif +#ifdef HAVE_FBDEV + list.push_back(&fbdev_vo_info); +#endif + list.push_back(&null_vo_info); dri.num_xp_frames=1; } @@ -174,13 +195,13 @@ if(offset!=std::string::npos) subdev = drv_name.substr(offset+1); } vo_priv_t& priv=static_cast<vo_priv_t&>(vo_priv); - unsigned i; - if(drv_name.empty()) priv.video_out=vo_infos[0]; + size_t i,sz=priv.list.size(); + if(drv_name.empty()) priv.video_out=priv.list[0]; else - for (i=0; vo_infos[i] != &null_vo_info; i++){ - const vo_info_t *info = vo_infos[i]; + for (i=0; i<sz; i++){ + const vo_info_t *info = priv.list[i]; if(info->short_name==drv_name){ - priv.video_out = vo_infos[i]; + priv.video_out = priv.list[i]; break; } } Modified: mplayerxp/main.cpp =================================================================== --- mplayerxp/main.cpp 2013-05-08 12:54:26 UTC (rev 636) +++ mplayerxp/main.cpp 2013-05-08 13:49:59 UTC (rev 637) @@ -284,13 +284,8 @@ } void MPXPSystem::uninit_player(unsigned int mask){ Stream* stream=NULL; - sh_audio_t* sh_audio=NULL; - sh_video_t* sh_video=NULL; - if(_demuxer) { - stream=static_cast<Stream*>(_demuxer->stream); - sh_audio=reinterpret_cast<sh_audio_t*>(_demuxer->audio->sh); - sh_video=reinterpret_cast<sh_video_t*>(_demuxer->video->sh); - } + if(_demuxer) stream=static_cast<Stream*>(_demuxer->stream); + fflush(stdout); fflush(stderr); mask=inited_flags&mask; @@ -320,7 +315,6 @@ inited_flags&=~INITED_VCODEC; MP_UNIT("uninit_vcodec"); mpcv_uninit(*mpxp_context().video().decoder); - sh_video=NULL; } if(mask&INITED_VO){ @@ -335,7 +329,6 @@ inited_flags&=~INITED_ACODEC; MP_UNIT("uninit_acodec"); mpca_uninit(*mpxp_context().audio().decoder); - sh_audio=NULL; } if(mask&INITED_AO){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-05-08 12:54:55
|
Revision: 636 http://sourceforge.net/p/mplayerxp/code/636 Author: nickols_k Date: 2013-05-08 12:54:26 +0000 (Wed, 08 May 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/dump.cpp mplayerxp/dump.h mplayerxp/global_msg.h mplayerxp/input2/in_msg.h mplayerxp/input2/input.cpp mplayerxp/input2/input.h mplayerxp/input2/joystick.cpp mplayerxp/input2/joystick.h mplayerxp/input2/lirc.cpp mplayerxp/input2/lirc.h mplayerxp/input2/mouse.h mplayerxp/libao3/afmt.cpp mplayerxp/libao3/ao_alsa.cpp mplayerxp/libao3/ao_arts.cpp mplayerxp/libao3/ao_esd.cpp mplayerxp/libao3/ao_jack.cpp mplayerxp/libao3/ao_msg.h mplayerxp/libao3/ao_nas.cpp mplayerxp/libao3/ao_null.cpp mplayerxp/libao3/ao_openal.cpp mplayerxp/libao3/ao_oss.cpp mplayerxp/libao3/ao_sdl.cpp mplayerxp/libao3/ao_wav.cpp mplayerxp/libao3/audio_out.cpp mplayerxp/libao3/audio_out.h mplayerxp/libao3/audio_out_internal.h mplayerxp/libmpcodecs/ad.cpp mplayerxp/libmpcodecs/ad_a52.cpp mplayerxp/libmpcodecs/ad_acm.cpp mplayerxp/libmpcodecs/ad_dca.cpp mplayerxp/libmpcodecs/ad_dmo.cpp mplayerxp/libmpcodecs/ad_dshow.cpp mplayerxp/libmpcodecs/ad_dvdpcm.cpp mplayerxp/libmpcodecs/ad_faad.cpp mplayerxp/libmpcodecs/ad_hwac3.cpp mplayerxp/libmpcodecs/ad_lavc.cpp mplayerxp/libmpcodecs/ad_libdv.cpp mplayerxp/libmpcodecs/ad_mp3.cpp mplayerxp/libmpcodecs/ad_msg.h mplayerxp/libmpcodecs/ad_null.cpp mplayerxp/libmpcodecs/ad_pcm.cpp mplayerxp/libmpcodecs/ad_qtaudio.cpp mplayerxp/libmpcodecs/ad_real.cpp mplayerxp/libmpcodecs/ad_twin.cpp mplayerxp/libmpcodecs/ad_vorbis.cpp mplayerxp/libmpcodecs/codecs_ld.cpp mplayerxp/libmpcodecs/codecs_ld.h mplayerxp/libmpcodecs/dec_audio.cpp mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libmpcodecs/dec_video.h mplayerxp/libmpcodecs/liba52/bit_allocate.cpp mplayerxp/libmpcodecs/liba52/bitstream.cpp mplayerxp/libmpcodecs/liba52/crc.cpp mplayerxp/libmpcodecs/liba52/downmix.cpp mplayerxp/libmpcodecs/liba52/imdct.cpp mplayerxp/libmpcodecs/liba52/parse.cpp mplayerxp/libmpcodecs/liba52/resample.cpp mplayerxp/libmpcodecs/libdca/bitstream.cpp mplayerxp/libmpcodecs/libdca/downmix.cpp mplayerxp/libmpcodecs/libdca/parse.cpp mplayerxp/libmpcodecs/libdca/resample.cpp mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp mplayerxp/libmpcodecs/vd.cpp mplayerxp/libmpcodecs/vd_divx4.cpp mplayerxp/libmpcodecs/vd_dmo.cpp mplayerxp/libmpcodecs/vd_dshow.cpp mplayerxp/libmpcodecs/vd_huffyuv.cpp mplayerxp/libmpcodecs/vd_lavc.cpp mplayerxp/libmpcodecs/vd_libdv.cpp mplayerxp/libmpcodecs/vd_libmpeg2.cpp mplayerxp/libmpcodecs/vd_mpegpes.cpp mplayerxp/libmpcodecs/vd_msg.h mplayerxp/libmpcodecs/vd_null.cpp mplayerxp/libmpcodecs/vd_nuv.cpp mplayerxp/libmpcodecs/vd_qtvideo.cpp mplayerxp/libmpcodecs/vd_raw.cpp mplayerxp/libmpcodecs/vd_real.cpp mplayerxp/libmpcodecs/vd_theora.cpp mplayerxp/libmpcodecs/vd_vfw.cpp mplayerxp/libmpcodecs/vd_xanim.cpp mplayerxp/libmpcodecs/vd_xvid.cpp mplayerxp/libmpconf/cfgparser.cpp mplayerxp/libmpconf/cfgparser.h mplayerxp/libmpconf/codec-cfg.cpp mplayerxp/libmpconf/m_option.cpp mplayerxp/libmpconf/m_property.cpp mplayerxp/libmpconf/m_struct.cpp mplayerxp/libmpconf/parser_msg.h mplayerxp/libmpdemux/aviprint.cpp mplayerxp/libmpdemux/demux_ac3.cpp mplayerxp/libmpdemux/demux_aiff.cpp mplayerxp/libmpdemux/demux_asf.cpp mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demux_bmp.cpp mplayerxp/libmpdemux/demux_dca.cpp mplayerxp/libmpdemux/demux_demuxers.cpp mplayerxp/libmpdemux/demux_dv.cpp mplayerxp/libmpdemux/demux_film.cpp mplayerxp/libmpdemux/demux_flac.cpp mplayerxp/libmpdemux/demux_fli.cpp mplayerxp/libmpdemux/demux_lavf.cpp mplayerxp/libmpdemux/demux_mkv.cpp mplayerxp/libmpdemux/demux_mov.cpp mplayerxp/libmpdemux/demux_mp3.cpp mplayerxp/libmpdemux/demux_mpg.cpp mplayerxp/libmpdemux/demux_mpxp64.cpp mplayerxp/libmpdemux/demux_msg.h mplayerxp/libmpdemux/demux_musepack.cpp mplayerxp/libmpdemux/demux_nsv.cpp mplayerxp/libmpdemux/demux_null.cpp mplayerxp/libmpdemux/demux_nuv.cpp mplayerxp/libmpdemux/demux_ogg.cpp mplayerxp/libmpdemux/demux_pva.cpp mplayerxp/libmpdemux/demux_rawaudio.cpp mplayerxp/libmpdemux/demux_rawvideo.cpp mplayerxp/libmpdemux/demux_real.cpp mplayerxp/libmpdemux/demux_realaud.cpp mplayerxp/libmpdemux/demux_roq.cpp mplayerxp/libmpdemux/demux_smjpeg.cpp mplayerxp/libmpdemux/demux_snd_au.cpp mplayerxp/libmpdemux/demux_ts.cpp mplayerxp/libmpdemux/demux_ty.cpp mplayerxp/libmpdemux/demux_viv.cpp mplayerxp/libmpdemux/demux_voc.cpp mplayerxp/libmpdemux/demux_vqf.cpp mplayerxp/libmpdemux/demux_wav.cpp mplayerxp/libmpdemux/demux_y4m.cpp mplayerxp/libmpdemux/demuxer.cpp mplayerxp/libmpdemux/demuxer.h mplayerxp/libmpdemux/demuxer_info.cpp mplayerxp/libmpdemux/demuxer_info.h mplayerxp/libmpdemux/demuxer_packet.cpp mplayerxp/libmpdemux/demuxer_packet.h mplayerxp/libmpdemux/demuxer_r.cpp mplayerxp/libmpdemux/demuxer_stream.cpp mplayerxp/libmpdemux/demuxer_stream.h mplayerxp/libmpdemux/mp3_hdr.cpp mplayerxp/libmpdemux/mpdemux.cpp mplayerxp/libmpdemux/mpeg_hdr.cpp mplayerxp/libmpdemux/mux_lavf.cpp mplayerxp/libmpdemux/mux_mpxp64.cpp mplayerxp/libmpdemux/mux_raw.cpp mplayerxp/libmpdemux/muxer.cpp mplayerxp/libmpdemux/parse_es.cpp mplayerxp/libmpdemux/parse_mp4.cpp mplayerxp/libmpdemux/stheader.cpp mplayerxp/libmpdemux/stheader.h mplayerxp/libmpdemux/sub_cc.cpp mplayerxp/libmpdemux/sub_ty.cpp mplayerxp/libmpdemux/yuv4mpeg.cpp mplayerxp/libmpdemux/yuv4mpeg.h mplayerxp/libmpdemux/yuv4mpeg_ratio.cpp mplayerxp/libmpstream2/cache2.cpp mplayerxp/libmpstream2/cdd.h mplayerxp/libmpstream2/cdda.cpp mplayerxp/libmpstream2/cddb.cpp mplayerxp/libmpstream2/cookies.cpp mplayerxp/libmpstream2/freesdp/common.cpp mplayerxp/libmpstream2/freesdp/errorlist.cpp mplayerxp/libmpstream2/freesdp/parser.cpp mplayerxp/libmpstream2/http.cpp mplayerxp/libmpstream2/http.h mplayerxp/libmpstream2/librtsp/rtsp.cpp mplayerxp/libmpstream2/librtsp/rtsp.h mplayerxp/libmpstream2/librtsp/rtsp_rtp.cpp mplayerxp/libmpstream2/librtsp/rtsp_rtp.h mplayerxp/libmpstream2/librtsp/rtsp_session.cpp mplayerxp/libmpstream2/librtsp/rtsp_session.h mplayerxp/libmpstream2/mrl.cpp mplayerxp/libmpstream2/mrl.h mplayerxp/libmpstream2/network.cpp mplayerxp/libmpstream2/network.h mplayerxp/libmpstream2/network_asf.cpp mplayerxp/libmpstream2/network_asf.h mplayerxp/libmpstream2/network_asf_mmst.cpp mplayerxp/libmpstream2/network_asf_mmst.h mplayerxp/libmpstream2/network_nop.cpp mplayerxp/libmpstream2/network_nop.h mplayerxp/libmpstream2/network_pnm.cpp mplayerxp/libmpstream2/network_pnm.h mplayerxp/libmpstream2/network_real_rtsp.cpp mplayerxp/libmpstream2/network_real_rtsp.h mplayerxp/libmpstream2/network_rtp.cpp mplayerxp/libmpstream2/network_rtp.h mplayerxp/libmpstream2/network_rtsp.cpp mplayerxp/libmpstream2/network_rtsp.h mplayerxp/libmpstream2/pnm.cpp mplayerxp/libmpstream2/pnm.h mplayerxp/libmpstream2/realrtsp/asmrp.cpp mplayerxp/libmpstream2/realrtsp/real.cpp mplayerxp/libmpstream2/realrtsp/rmff.cpp mplayerxp/libmpstream2/realrtsp/sdpplin.cpp mplayerxp/libmpstream2/realrtsp/xbuffer.cpp mplayerxp/libmpstream2/rtp_cache.cpp mplayerxp/libmpstream2/rtp_cache.h mplayerxp/libmpstream2/s_cdd.cpp mplayerxp/libmpstream2/s_dvdnav.cpp mplayerxp/libmpstream2/s_dvdread.cpp mplayerxp/libmpstream2/s_file.cpp mplayerxp/libmpstream2/s_ftp.cpp mplayerxp/libmpstream2/s_lavc.cpp mplayerxp/libmpstream2/s_network.cpp mplayerxp/libmpstream2/s_null.cpp mplayerxp/libmpstream2/s_oss.cpp mplayerxp/libmpstream2/s_rtsp.cpp mplayerxp/libmpstream2/s_tv.cpp mplayerxp/libmpstream2/s_udp.cpp mplayerxp/libmpstream2/s_vcdnav.cpp mplayerxp/libmpstream2/stream.cpp mplayerxp/libmpstream2/stream.h mplayerxp/libmpstream2/stream_internal.h mplayerxp/libmpstream2/stream_msg.h mplayerxp/libmpstream2/tcp.cpp mplayerxp/libmpstream2/tcp.h mplayerxp/libmpstream2/tvi/frequencies.cpp mplayerxp/libmpstream2/tvi/frequencies.h mplayerxp/libmpstream2/tvi/tv.h mplayerxp/libmpstream2/tvi/tvi_bsdbt848.cpp mplayerxp/libmpstream2/tvi/tvi_def.h mplayerxp/libmpstream2/tvi/tvi_dummy.cpp mplayerxp/libmpstream2/tvi/tvi_v4l.cpp mplayerxp/libmpstream2/udp.cpp mplayerxp/libmpstream2/udp.h mplayerxp/libmpstream2/url.cpp mplayerxp/libmpstream2/url.h mplayerxp/libmpsub/find_sub.cpp mplayerxp/libmpsub/mpsub_msg.h mplayerxp/libmpsub/spudec.cpp mplayerxp/libmpsub/spudec.h mplayerxp/libmpsub/subreader.cpp mplayerxp/libmpsub/subreader.h mplayerxp/libmpsub/vobsub.cpp mplayerxp/libplaytree2/asxparser.cpp mplayerxp/libplaytree2/asxparser.h mplayerxp/libplaytree2/playtree.cpp mplayerxp/libplaytree2/playtree.h mplayerxp/libplaytree2/playtree_msg.h mplayerxp/libplaytree2/playtreeparser.cpp mplayerxp/libplaytree2/playtreeparser.h mplayerxp/libvo2/aspect.cpp mplayerxp/libvo2/aspect.h mplayerxp/libvo2/font_load.cpp mplayerxp/libvo2/img_format.cpp mplayerxp/libvo2/jpeg_enc.cpp mplayerxp/libvo2/osd_render.cpp mplayerxp/libvo2/osd_render.h mplayerxp/libvo2/screenshot.cpp mplayerxp/libvo2/sub.cpp mplayerxp/libvo2/sub.h mplayerxp/libvo2/video_out.cpp mplayerxp/libvo2/video_out.h mplayerxp/libvo2/video_out_internal.h mplayerxp/libvo2/vidix_system.cpp mplayerxp/libvo2/vidix_system.h mplayerxp/libvo2/vo_fbdev.cpp mplayerxp/libvo2/vo_msg.h mplayerxp/libvo2/vo_null.cpp mplayerxp/libvo2/vo_opengl.cpp mplayerxp/libvo2/vo_sdl.cpp mplayerxp/libvo2/vo_vesa.cpp mplayerxp/libvo2/vo_x11.cpp mplayerxp/libvo2/vo_xv.cpp mplayerxp/libvo2/x11_system.cpp mplayerxp/libvo2/x11_system.h mplayerxp/main.cpp mplayerxp/mplayerxp.h mplayerxp/mpxp_msg.cpp mplayerxp/mpxp_msg.h mplayerxp/nls/nls.h mplayerxp/nls/nls_msg.h mplayerxp/nls/recode.cpp mplayerxp/osdep/aclib.cpp mplayerxp/osdep/aclib_template.h mplayerxp/osdep/bswap.h mplayerxp/osdep/cpudetect.cpp mplayerxp/osdep/cpudetect.h mplayerxp/osdep/fastmemcpy.h mplayerxp/osdep/get_path.cpp mplayerxp/osdep/get_path.h mplayerxp/osdep/getch2.cpp mplayerxp/osdep/getch2.h mplayerxp/osdep/keycodes.h mplayerxp/osdep/lrmi.cpp mplayerxp/osdep/lrmi.h mplayerxp/osdep/mm_accel.h mplayerxp/osdep/mp_malloc.cpp mplayerxp/osdep/mp_malloc.h mplayerxp/osdep/mplib.cpp mplayerxp/osdep/mplib.h mplayerxp/osdep/osdep_msg.h mplayerxp/osdep/shmem.cpp mplayerxp/osdep/shmem.h mplayerxp/osdep/timer-lx.cpp mplayerxp/osdep/timer.cpp mplayerxp/osdep/timer.h mplayerxp/osdep/vbelib.cpp mplayerxp/osdep/vbelib.h mplayerxp/player_msg.h mplayerxp/postproc/af.cpp mplayerxp/postproc/af_ao3.cpp mplayerxp/postproc/af_channels.cpp mplayerxp/postproc/af_crystality.cpp mplayerxp/postproc/af_delay.cpp mplayerxp/postproc/af_dyn.cpp mplayerxp/postproc/af_echo3d.cpp mplayerxp/postproc/af_equalizer.cpp mplayerxp/postproc/af_export.cpp mplayerxp/postproc/af_extrastereo.cpp mplayerxp/postproc/af_ffenc.cpp mplayerxp/postproc/af_format.cpp mplayerxp/postproc/af_hrtf.cpp mplayerxp/postproc/af_karaoke.cpp mplayerxp/postproc/af_lp.cpp mplayerxp/postproc/af_null.cpp mplayerxp/postproc/af_pan.cpp mplayerxp/postproc/af_raw.cpp mplayerxp/postproc/af_resample.cpp mplayerxp/postproc/af_scaletempo.cpp mplayerxp/postproc/af_sinesuppress.cpp mplayerxp/postproc/af_sub.cpp mplayerxp/postproc/af_surround.cpp mplayerxp/postproc/af_tools.cpp mplayerxp/postproc/af_volnorm.cpp mplayerxp/postproc/af_volume.cpp mplayerxp/postproc/aflib.cpp mplayerxp/postproc/libmenu/menu.cpp mplayerxp/postproc/libmenu/menu.h mplayerxp/postproc/libmenu/menu_cmdlist.cpp mplayerxp/postproc/libmenu/menu_console.cpp mplayerxp/postproc/libmenu/menu_filesel.cpp mplayerxp/postproc/libmenu/menu_list.cpp mplayerxp/postproc/libmenu/menu_param.cpp mplayerxp/postproc/libmenu/menu_pt.cpp mplayerxp/postproc/libmenu/menu_txt.cpp mplayerxp/postproc/postprocess.cpp mplayerxp/postproc/pp_msg.h mplayerxp/postproc/swscale.cpp mplayerxp/postproc/vf.cpp mplayerxp/postproc/vf.h mplayerxp/postproc/vf_1bpp.cpp mplayerxp/postproc/vf_2xsai.cpp mplayerxp/postproc/vf_aspect.cpp mplayerxp/postproc/vf_delogo.cpp mplayerxp/postproc/vf_denoise3d.cpp mplayerxp/postproc/vf_dint.cpp mplayerxp/postproc/vf_down3dright.cpp mplayerxp/postproc/vf_eq.cpp mplayerxp/postproc/vf_expand.cpp mplayerxp/postproc/vf_flip.cpp mplayerxp/postproc/vf_format.cpp mplayerxp/postproc/vf_framestep.cpp mplayerxp/postproc/vf_il.cpp mplayerxp/postproc/vf_menu.cpp mplayerxp/postproc/vf_mirror.cpp mplayerxp/postproc/vf_noise.cpp mplayerxp/postproc/vf_null.cpp mplayerxp/postproc/vf_ow.cpp mplayerxp/postproc/vf_palette.cpp mplayerxp/postproc/vf_panscan.cpp mplayerxp/postproc/vf_perspective.cpp mplayerxp/postproc/vf_pp.cpp mplayerxp/postproc/vf_raw.cpp mplayerxp/postproc/vf_rectangle.cpp mplayerxp/postproc/vf_rgb2bgr.cpp mplayerxp/postproc/vf_rotate.cpp mplayerxp/postproc/vf_scale.cpp mplayerxp/postproc/vf_smartblur.cpp mplayerxp/postproc/vf_softpulldown.cpp mplayerxp/postproc/vf_swapuv.cpp mplayerxp/postproc/vf_test.cpp mplayerxp/postproc/vf_unsharp.cpp mplayerxp/postproc/vf_vo2.cpp mplayerxp/postproc/vf_yuvcsp.cpp mplayerxp/postproc/vf_yuy2.cpp mplayerxp/postproc/vf_yvu9.cpp mplayerxp/xmpcore/PointerProtector.h mplayerxp/xmpcore/sig_hand.cpp mplayerxp/xmpcore/sig_hand.h mplayerxp/xmpcore/xmp_adecoder.cpp mplayerxp/xmpcore/xmp_adecoder.h mplayerxp/xmpcore/xmp_aframe.cpp mplayerxp/xmpcore/xmp_aframe.h mplayerxp/xmpcore/xmp_aplayer.cpp mplayerxp/xmpcore/xmp_aplayer.h mplayerxp/xmpcore/xmp_context.cpp mplayerxp/xmpcore/xmp_context.h mplayerxp/xmpcore/xmp_core.cpp mplayerxp/xmpcore/xmp_core.h mplayerxp/xmpcore/xmp_enums.h mplayerxp/xmpcore/xmp_image.cpp mplayerxp/xmpcore/xmp_image.h mplayerxp/xmpcore/xmp_vdecoder.cpp mplayerxp/xmpcore/xmp_vdecoder.h mplayerxp/xmpcore/xmp_vplayer.cpp mplayerxp/xmpcore/xmp_vplayer.h Modified: mplayerxp/dump.cpp =================================================================== --- mplayerxp/dump.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/dump.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* dump.c - stream dumper */ @@ -20,7 +20,7 @@ #include "global_msg.h" #include "dump.h" -namespace mpxp { +namespace usr { static char *media=NULL,*port=NULL; @@ -464,4 +464,4 @@ ,priv->asize); } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/dump.h =================================================================== --- mplayerxp/dump.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/dump.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #ifndef DUMP_H_INCLUDED #define DUMP_H_INCLUDED 1 #include "libmpdemux/demuxer_r.h" -namespace mpxp { +namespace usr { int dump_parse(const char *param); void dump_stream(Stream *stream); void dump_mux_init(Demuxer *demuxer,libinput_t&libinput); Modified: mplayerxp/global_msg.h =================================================================== --- mplayerxp/global_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/global_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #define MSGT_CLASS MSGT_GLOBAL #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_GLOBAL); static mpxp_ostream_fatal mpxp_fatal(MSGT_GLOBAL); static mpxp_ostream_err mpxp_err(MSGT_GLOBAL); @@ -17,5 +17,5 @@ static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_GLOBAL); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_GLOBAL); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/in_msg.h =================================================================== --- mplayerxp/input2/in_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/in_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -3,7 +3,7 @@ #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_INPUT); static mpxp_ostream_fatal mpxp_fatal(MSGT_INPUT); static mpxp_ostream_err mpxp_err(MSGT_INPUT); @@ -15,6 +15,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_INPUT); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_INPUT); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_INPUT); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/input.cpp =================================================================== --- mplayerxp/input2/input.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/input.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <iomanip> #include <stdlib.h> @@ -37,7 +37,7 @@ #include "joystick.h" #include "osdep/getch2.h" -namespace mpxp { +namespace usr { static const int MP_MAX_KEY_FD=10; static const int MP_MAX_CMD_FD=10; @@ -1428,4 +1428,4 @@ return MPXP_False; } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/input2/input.h =================================================================== --- mplayerxp/input2/input.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/input.h 2013-05-08 12:54:26 UTC (rev 636) @@ -2,13 +2,13 @@ #define INPUT_H_INCLUDED 1 #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <map> #include "xmpcore/xmp_enums.h" -namespace mpxp { +namespace usr { // All commands id enum { MP_CMD_SEEK =0, @@ -166,5 +166,5 @@ extern void mp_input_print_binds(libinput_t& handle); // Interruptible usleep: (used by libmpdemux) extern MPXP_Rc mp_input_check_interrupt(libinput_t& handle,int time); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/joystick.cpp =================================================================== --- mplayerxp/input2/joystick.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/joystick.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #ifdef HAVE_JOYSTICK #include "joystick.h" @@ -27,7 +27,7 @@ #include "in_msg.h" -namespace mpxp { +namespace usr { typedef struct priv_s { int axis[10]; int btns; @@ -146,11 +146,11 @@ } return MP_INPUT_NOTHING; } -} // namespace mpxp +} // namespace usr #else -namespace mpxp { +namespace usr { any_t* mp_input_joystick_open(const char* dev) { UNUNSED(dev); return NULL; } void mp_input_joystick_close(any_t* ctx) { UNUSED(ctx); } int mp_input_joystick_read(any_t* ctx) { UNUSED(ctx); return MP_INPUT_NOTHING; } -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/joystick.h =================================================================== --- mplayerxp/input2/joystick.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/joystick.h 2013-05-08 12:54:26 UTC (rev 636) @@ -1,7 +1,7 @@ #ifndef JOYSTICK_H_INCLUDED #define JOYSTICK_H_INCLUDED 1 -namespace mpxp { +namespace usr { enum { JOY_BASE =(0x100+128), JOY_AXIS0_PLUS =(JOY_BASE+0), @@ -42,5 +42,5 @@ extern any_t* mp_input_joystick_open(const char* dev); extern void mp_input_joystick_close(any_t* ctx); extern int mp_input_joystick_read(any_t* ctx); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/lirc.cpp =================================================================== --- mplayerxp/input2/lirc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/lirc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #ifdef HAVE_LIRC @@ -17,7 +17,7 @@ #include "input.h" #include "in_msg.h" -namespace mpxp { +namespace usr { static struct lirc_config *lirc_config; char *lirc_configfile; @@ -114,5 +114,5 @@ lirc_deinit(); delete priv; } -}// namespace mpxp +}// namespace usr #endif Modified: mplayerxp/input2/lirc.h =================================================================== --- mplayerxp/input2/lirc.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/lirc.h 2013-05-08 12:54:26 UTC (rev 636) @@ -1,8 +1,8 @@ #ifndef __LIRC_H_INCLUDED #define __LIRC_H_INCLUDED 1 -namespace mpxp { +namespace usr { extern any_t* mp_input_lirc_open(void); extern int mp_input_lirc_read_cmd(any_t* ctx,char* dest, int s); extern void mp_input_lirc_close(any_t* ctx); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/input2/mouse.h =================================================================== --- mplayerxp/input2/mouse.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/input2/mouse.h 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #ifndef MOUSE_H_INCLUDED #define MOUSE_H_INCLUDED 1 -namespace mpxp { +namespace usr { enum { MOUSE_BASE=((0x100+256)|MP_NO_REPEAT_KEY), MOUSE_BTN0=(MOUSE_BASE+0), @@ -27,5 +27,5 @@ MOUSE_BTN8_DBL=(MOUSE_BASE_DBL+8), MOUSE_BTN9_DBL=(MOUSE_BASE_DBL+9) }; -} // namespace mpxp +} // namespace usr #endif \ No newline at end of file Modified: mplayerxp/libao3/afmt.cpp =================================================================== --- mplayerxp/libao3/afmt.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/afmt.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include "afmt.h" const char* afmt2str(unsigned fmt) { Modified: mplayerxp/libao3/ao_alsa.cpp =================================================================== --- mplayerxp/libao3/ao_alsa.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_alsa.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* ao_alsa9 - ALSA-0.9.x output plugin for MPlayer @@ -31,7 +31,7 @@ #include "ao_msg.h" #include "libmpstream2/mrl.h" -namespace mpxp { +namespace usr { typedef struct priv_conf_s { int mmap; int noblock; @@ -1004,5 +1004,5 @@ "under developement", query_interface }; -} //namespace mpxp +} //namespace usr Modified: mplayerxp/libao3/ao_arts.cpp =================================================================== --- mplayerxp/libao3/ao_arts.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_arts.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * aRts (KDE analogue Real-Time synthesizer) audio output driver for MPlayerXP * @@ -32,7 +32,7 @@ #include "afmt.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { /* Feel mp_free to experiment with the following values: */ static const int ARTS_PACKETS=10; /* Number of audio packets */ static const int ARTS_PACKET_SIZE_LOG2=11; /* Log2 of audio packet size */ @@ -205,4 +205,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_esd.cpp =================================================================== --- mplayerxp/libao3/ao_esd.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_esd.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * EsounD (Enlightened Sound Daemon) audio output driver for MPlayerXP * @@ -57,7 +57,7 @@ #include "ao_msg.h" -namespace mpxp { +namespace usr { static const int ESD_RESAMPLES=0; #define ESD_DEBUG 0 @@ -481,4 +481,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_jack.cpp =================================================================== --- mplayerxp/libao3/ao_jack.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_jack.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * JACK audio output driver for MPlayer * @@ -39,7 +39,7 @@ #include "mpxp_conf_lavc.h" #include <jack/jack.h> -namespace mpxp { +namespace usr { //! maximum number of channels supported, avoids lots of mallocs static const int MAX_CHANS=6; @@ -365,4 +365,4 @@ "based on ao_sdl.c", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_msg.h =================================================================== --- mplayerxp/libao3/ao_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -3,7 +3,7 @@ #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_AO); static mpxp_ostream_fatal mpxp_fatal(MSGT_AO); static mpxp_ostream_err mpxp_err(MSGT_AO); @@ -15,6 +15,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_AO); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_AO); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_AO); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libao3/ao_nas.cpp =================================================================== --- mplayerxp/libao3/ao_nas.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_nas.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * NAS audio output driver * @@ -62,7 +62,7 @@ #include "afmt.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { /* NAS_FRAG_SIZE must be a power-of-two value */ static const int NAS_FRAG_SIZE=4096; @@ -634,4 +634,4 @@ "", query_interface }; -} // namespace mpxp \ No newline at end of file +} // namespace usr \ No newline at end of file Modified: mplayerxp/libao3/ao_null.cpp =================================================================== --- mplayerxp/libao3/ao_null.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_null.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -18,7 +18,7 @@ #include "audio_out_internal.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { static const uint32_t WAV_ID_RIFF=FOURCC_TAG(0x46,0x46,0x49,0x52); /* "RIFF" */ static const uint32_t WAV_ID_WAVE=FOURCC_TAG(0x45,0x56,0x41,0x57); /* "WAVE" */ static const uint32_t WAV_ID_FMT =FOURCC_TAG(0x20,0x74,0x6d,0x66); /* "fmt " */ @@ -255,4 +255,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_openal.cpp =================================================================== --- mplayerxp/libao3/ao_openal.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_openal.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * OpenAL audio output driver for MPlayerXP * @@ -36,7 +36,7 @@ #include "osdep/timer.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { static const int MAX_CHANS=8; static const int NUM_BUF=128; static const int CHUNK_SIZE=512; @@ -273,4 +273,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_oss.cpp =================================================================== --- mplayerxp/libao3/ao_oss.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_oss.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> @@ -18,7 +18,7 @@ #include "audio_out_internal.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { const char *oss_mixer_device = PATH_DEV_MIXER; /* Support for >2 output channels added 2001-11-25 - Steve Davies <st...@da...> */ class Oss_AO_Interface : public AO_Interface { @@ -445,4 +445,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_sdl.cpp =================================================================== --- mplayerxp/libao3/ao_sdl.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_sdl.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * ao_sdl.c - libao3 SDLlib Audio Output Driver for MPlayer * @@ -26,7 +26,7 @@ #include "osdep/fastmemcpy.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { // Samplesize used by the SDLlib AudioSpec struct static const int SAMPLESIZE=1024; @@ -349,4 +349,4 @@ "", query_interface }; -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/ao_wav.cpp =================================================================== --- mplayerxp/libao3/ao_wav.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/ao_wav.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * PCM audio output driver * @@ -39,7 +39,7 @@ #include <windows.h> #endif -namespace mpxp { +namespace usr { static const uint32_t WAV_ID_RIFF=0x46464952; /* "RIFF" */ static const uint32_t WAV_ID_WAVE=0x45564157; /* "WAVE" */ static const uint32_t WAV_ID_FMT =0x20746d66; /* "fmt " */ Modified: mplayerxp/libao3/audio_out.cpp =================================================================== --- mplayerxp/libao3/audio_out.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/audio_out.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -10,7 +10,7 @@ #include "afmt.h" #include "ao_msg.h" -namespace mpxp { +namespace usr { extern const ao_info_t audio_out_wav; extern const ao_info_t audio_out_null; #ifdef USE_OSS_AUDIO @@ -364,4 +364,4 @@ priv.muted=1; } } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libao3/audio_out.h =================================================================== --- mplayerxp/libao3/audio_out.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/audio_out.h 2013-05-08 12:54:26 UTC (rev 636) @@ -5,7 +5,7 @@ #include <string> -namespace mpxp { +namespace usr { class AO_Interface; /** Text description of AO-driver */ @@ -73,5 +73,5 @@ /* prototypes */ extern const char * __FASTCALL__ ao_format_name(int format); extern int __FASTCALL__ ao_format_bits(int format); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libao3/audio_out_internal.h =================================================================== --- mplayerxp/libao3/audio_out_internal.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libao3/audio_out_internal.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #include <string> -namespace mpxp { +namespace usr { /** AO-driver interface */ class AO_Interface : public Opaque { public: @@ -65,5 +65,5 @@ protected: std::string subdevice; }; -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/ad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* ad.c - audio decoder interface */ Modified: mplayerxp/libmpcodecs/ad_a52.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_a52.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_a52.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_XOPEN 1 Modified: mplayerxp/libmpcodecs/ad_acm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_acm.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_acm.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_dca.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dca.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dca.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_XOPEN 1 Modified: mplayerxp/libmpcodecs/ad_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dmo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dmo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dshow.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_dvdpcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_dvdpcm.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_faad.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_faad.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_faad.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* ad_faad.c - MPlayer AAC decoder using libfaad2 * This file is part of MPlayer, see http://mplayerhq.hu/ for info. * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net> Modified: mplayerxp/libmpcodecs/ad_hwac3.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_hwac3.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_hwac3.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_XOPEN 1 Modified: mplayerxp/libmpcodecs/ad_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_lavc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_lavc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #define __USE_GNU 1 Modified: mplayerxp/libmpcodecs/ad_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_libdv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_libdv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: mplayerxp/libmpcodecs/ad_mp3.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_mp3.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_msg.h =================================================================== --- mplayerxp/libmpcodecs/ad_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #define MSGT_CLASS MSGT_DECAUDIO #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_DECAUDIO); static mpxp_ostream_fatal mpxp_fatal(MSGT_DECAUDIO); static mpxp_ostream_err mpxp_err(MSGT_DECAUDIO); @@ -16,6 +16,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_DECAUDIO); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_DECAUDIO); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_DECAUDIO); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/ad_null.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_null.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_null.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_pcm.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_pcm.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_pcm.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_qtaudio.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_qtaudio.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_real.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_real.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_real.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/ad_twin.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_twin.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_twin.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/ad_vorbis.cpp =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/ad_vorbis.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <unistd.h> Modified: mplayerxp/libmpcodecs/codecs_ld.cpp =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/codecs_ld.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* codecs_ld - light interface to codec loader */ @@ -13,7 +13,7 @@ #include "mpxp_help.h" #include "global_msg.h" -namespace mpxp { +namespace usr { any_t* ld_codec(const std::string& name,const std::string& url_hint) { any_t*dll_handle; @@ -63,4 +63,4 @@ if(!rval) mpxp_err<<"[codec_ld] "<<MSGTR_CODEC_DLL_SYM_ERR<<":"<<sym_name<<std::endl; return rval; } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libmpcodecs/codecs_ld.h =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/codecs_ld.h 2013-05-08 12:54:26 UTC (rev 636) @@ -6,10 +6,10 @@ #include "mpxp_config.h" #include <string> -namespace mpxp { +namespace usr { extern any_t* ld_codec(const std::string& name,const std::string& url_hint); /* extern char * codec_name( const char *name );*/ extern any_t* ld_sym(any_t*handle,const std::string& sym_name); extern any_t* ld_aliased_sym(any_t*handle,const std::string& sym_name,...); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/dec_audio.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_audio.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/dec_audio.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <algorithm> #include <stdio.h> Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/dec_video.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #ifdef _OPENMP #include <omp.h> Modified: mplayerxp/libmpcodecs/dec_video.h =================================================================== --- mplayerxp/libmpcodecs/dec_video.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/dec_video.h 2013-05-08 12:54:26 UTC (rev 636) @@ -3,7 +3,7 @@ #include "xmpcore/xmp_enums.h" #include "libmpdemux/demuxer_r.h" -namespace mpxp { +namespace usr { struct libinput_t; } Modified: mplayerxp/libmpcodecs/liba52/bit_allocate.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/bit_allocate.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/bit_allocate.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * bit_allocate.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/bitstream.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/bitstream.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/bitstream.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * bitstream.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/crc.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/crc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/crc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * crc.c * Modified: mplayerxp/libmpcodecs/liba52/downmix.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/downmix.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/downmix.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * downmix.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/imdct.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/imdct.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/imdct.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * imdct.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/parse.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/parse.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/parse.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * parse.c * Copyright (C) 2000-2002 Michel Lespinasse <wa...@zo...> Modified: mplayerxp/libmpcodecs/liba52/resample.cpp =================================================================== --- mplayerxp/libmpcodecs/liba52/resample.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/liba52/resample.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; // a52_resample_init should find the requested converter (from type flags -> // given number of channels) and set up some function pointers... Modified: mplayerxp/libmpcodecs/libdca/bitstream.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/bitstream.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/bitstream.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * bitstream.c * Copyright (C) 2004 Gildas Bazin <gb...@vi...> Modified: mplayerxp/libmpcodecs/libdca/downmix.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/downmix.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/downmix.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * downmix.c * Copyright (C) 2004 Gildas Bazin <gb...@vi...> Modified: mplayerxp/libmpcodecs/libdca/parse.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/parse.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/parse.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * parse.c * Copyright (C) 2004 Gildas Bazin <gb...@vi...> Modified: mplayerxp/libmpcodecs/libdca/resample.cpp =================================================================== --- mplayerxp/libmpcodecs/libdca/resample.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libdca/resample.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; // dca_resample_init should find the requested converter (from type flags -> // given number of channels) and set up some function pointers... Modified: mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libnuppelvideo/RTjpegN.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* RTjpeg (C) Justin Schoeman 1998 (ju...@su...) Modified: mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libnuppelvideo/minilzo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* minilzo.c -- mini subset of the LZO real-time data compression library This file is part of the LZO real-time data compression library. Modified: mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/libnuppelvideo/nuppelvideo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * NuppelVideo 0.05 file parser * for MPlayer Modified: mplayerxp/libmpcodecs/vd.cpp =================================================================== --- mplayerxp/libmpcodecs/vd.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: mplayerxp/libmpcodecs/vd_divx4.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_divx4.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_divx4.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* HACKING notes: first time it was OpenDivx project by Mayo (unsupported by mplayerxp) Modified: mplayerxp/libmpcodecs/vd_dmo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dmo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_dmo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: mplayerxp/libmpcodecs/vd_dshow.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_dshow.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: mplayerxp/libmpcodecs/vd_huffyuv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_huffyuv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_huffyuv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * * HuffYUV Decoder for Mplayer Modified: mplayerxp/libmpcodecs/vd_lavc.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_lavc.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_lavc.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <algorithm> #include <ctype.h> Modified: mplayerxp/libmpcodecs/vd_libdv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libdv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_libdv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <string.h> Modified: mplayerxp/libmpcodecs/vd_libmpeg2.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_libmpeg2.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* we still need that: benchmarks: Modified: mplayerxp/libmpcodecs/vd_mpegpes.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_mpegpes.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_mpegpes.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_msg.h =================================================================== --- mplayerxp/libmpcodecs/vd_msg.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_msg.h 2013-05-08 12:54:26 UTC (rev 636) @@ -4,7 +4,7 @@ #define MSGT_CLASS MSGT_DECVIDEO #include "mpxp_msg.h" -namespace mpxp { +namespace usr { static mpxp_ostream_info mpxp_info(MSGT_DECVIDEO); static mpxp_ostream_fatal mpxp_fatal(MSGT_DECVIDEO); static mpxp_ostream_err mpxp_err(MSGT_DECVIDEO); @@ -16,6 +16,6 @@ static mpxp_ostream_dbg2 mpxp_dbg2(MSGT_DECVIDEO); static mpxp_ostream_dbg3 mpxp_dbg3(MSGT_DECVIDEO); static mpxp_ostream_dbg4 mpxp_dbg4(MSGT_DECVIDEO); -} // namespace mpxp +} // namespace usr #endif Modified: mplayerxp/libmpcodecs/vd_null.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_null.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_null.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_nuv.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_nuv.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_nuv.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include "libnuppelvideo/nuppelvideo.h" Modified: mplayerxp/libmpcodecs/vd_qtvideo.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_qtvideo.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_qtvideo.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #define __STDC_FORMAT_MACROS #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_raw.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_raw.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_raw.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> Modified: mplayerxp/libmpcodecs/vd_real.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_real.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_real.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <inttypes.h> Modified: mplayerxp/libmpcodecs/vd_theora.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_theora.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_theora.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: mplayerxp/libmpcodecs/vd_vfw.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_vfw.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_vfw.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; #include "mplayerxp.h" #include <stdio.h> Modified: mplayerxp/libmpcodecs/vd_xanim.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_xanim.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_xanim.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* xacodec.c -- XAnim Video Codec DLL support Modified: mplayerxp/libmpcodecs/vd_xvid.cpp =================================================================== --- mplayerxp/libmpcodecs/vd_xvid.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpcodecs/vd_xvid.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* Xvid codec - is successor of odivx */ Modified: mplayerxp/libmpconf/cfgparser.cpp =================================================================== --- mplayerxp/libmpconf/cfgparser.cpp 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpconf/cfgparser.cpp 2013-05-08 12:54:26 UTC (rev 636) @@ -1,6 +1,6 @@ #include "mpxp_config.h" #include "osdep/mplib.h" -using namespace mpxp; +using namespace usr; /* * command line and config file parser * by Szabolcs Berecz <sz...@in...> @@ -28,7 +28,7 @@ #include "parser_msg.h" #include "osdep/get_path.h" -namespace mpxp { +namespace usr { static const int MAX_RECURSION_DEPTH=8; typedef int (*cfg_func_arg_param_t)(const mpxp_option_t *,const std::string& ,const std::string& ); @@ -885,4 +885,4 @@ } } -} // namespace mpxp +} // namespace usr Modified: mplayerxp/libmpconf/cfgparser.h =================================================================== --- mplayerxp/libmpconf/cfgparser.h 2013-05-08 05:23:43 UTC (rev 635) +++ mplayerxp/libmpconf/cfgparser.h 2013-05-08 12:54:26 UTC (rev 636) @@ -8,7 +8,7 @@ #include <string> #include <map> -namespace mpxp { +namespace usr { struct libinput_t; struct PlayTree; @@ -145,6 +145,6 @@ inline M_Config::flags_e operator|=(M_Config::flags_e& a, M_Config::flags_e b) { return (a=static_cast<M_Config::flags_e>(static_cast<unsigned>(a)|static_cast<unsigned>(b))); } inline M_Config::flags_e operator&=(M_Config::flags_e& a, M_Co... [truncated message content] |
From: <nic...@us...> - 2013-05-08 05:23:50
|
Revision: 635 http://sourceforge.net/p/mplayerxp/code/635 Author: nickols_k Date: 2013-05-08 05:23:43 +0000 (Wed, 08 May 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/main.cpp mplayerxp/osdep/mplib.h Modified: mplayerxp/main.cpp =================================================================== --- mplayerxp/main.cpp 2013-04-30 17:28:09 UTC (rev 634) +++ mplayerxp/main.cpp 2013-05-08 05:23:43 UTC (rev 635) @@ -219,9 +219,13 @@ } static volatile char antiviral_hole2[__VM_PAGE_SIZE__] __PAGE_ALIGNED__; +static Opaque opaque1; static LocalPtr<MPXPContext> MPXPCtx(new(zeromem) MPXPContext); +static Opaque opaque2; static volatile char antiviral_hole3[__VM_PAGE_SIZE__] __PAGE_ALIGNED__; +static Opaque opaque3; volatile MPXPSecureKeys* secure_keys; +static Opaque opaque4; /************************************************************************** Decoding ahead **************************************************************************/ Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2013-04-30 17:28:09 UTC (rev 634) +++ mplayerxp/osdep/mplib.h 2013-05-08 05:23:43 UTC (rev 635) @@ -18,8 +18,16 @@ #include "mp_malloc.h" namespace mpxp { + class Opaque { + public: + Opaque(); + virtual ~Opaque(); + + any_t* false_pointers[RND_CHAR0]; + any_t* unusable; + }; - template <typename T> class LocalPtr { + template <typename T> class LocalPtr : public Opaque { public: LocalPtr(T* value):ptr(value) {} virtual ~LocalPtr() { delete ptr; } @@ -30,16 +38,10 @@ LocalPtr<T>& operator=(LocalPtr<T> a) { return this; } LocalPtr<T>& operator=(LocalPtr<T>& a) { return this; } LocalPtr<T>& operator=(LocalPtr<T>* a) { return this; } + + Opaque opaque1; T* ptr; + Opaque opaque2; }; - - class Opaque { - public: - Opaque(); - virtual ~Opaque(); - - any_t* false_pointers[RND_CHAR0]; - any_t* unusable; - }; } // namespace mpxp #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nic...@us...> - 2013-04-30 17:28:15
|
Revision: 634 http://sourceforge.net/p/mplayerxp/code/634 Author: nickols_k Date: 2013-04-30 17:28:09 +0000 (Tue, 30 Apr 2013) Log Message: ----------- sync with beye Modified Paths: -------------- mplayerxp/configure mplayerxp/osdep/bswap.h Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2013-04-27 17:29:31 UTC (rev 633) +++ mplayerxp/configure 2013-04-30 17:28:09 UTC (rev 634) @@ -406,6 +406,12 @@ check_func2 execinfo.h backtrace print_config HAVE_ mpxp_config.h mpxp_config.mak backtrace +check_header endian.h +print_config HAVE_ mpxp_config.h mpxp_config.mak endian_h + +check_header byteswap.h +print_config HAVE_ mpxp_config.h mpxp_config.mak byteswap_h + disable inet_pton if enabled streaming ; then disable socklib Modified: mplayerxp/osdep/bswap.h =================================================================== --- mplayerxp/osdep/bswap.h 2013-04-27 17:29:31 UTC (rev 633) +++ mplayerxp/osdep/bswap.h 2013-04-30 17:28:09 UTC (rev 634) @@ -1,16 +1,18 @@ #ifndef __BSWAP_H__ #define __BSWAP_H__ +#include "mpxp_config.h" +#ifdef HAVE_ENDIAN_H +#include <endian.h> +#endif #ifdef HAVE_BYTESWAP_H #include <byteswap.h> -#else - +#endif #include <inttypes.h> /* for __WORDSIZE */ -#include "mpxp_config.h" namespace mpxp { -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN #define FOURCC_TAG(ch0,ch1,ch2,ch3) (((uint32_t)(ch3)|((uint32_t)ch2<<8)|(uint32_t)ch1<<16)|((uint32_t)ch0<<24)) #define TWOCC_TAG(ch0,ch1) ((uint16_t)ch0|((uint16_t)ch1)<<8) #else @@ -28,6 +30,7 @@ return (uint16_t)ch0|((uint16_t)ch1)<<8; } +#ifndef HAVE_BYTESWAP_H #if defined(__i386__) inline uint16_t bswap_16(uint16_t x) { __asm("xchgb %b0,%h0" : @@ -154,7 +157,7 @@ // be2me ... BigEndian to MachineEndian // le2me ... LittleEndian to MachineEndian -#ifdef WORDS_BIGENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN inline uint16_t be2me_16(uint16_t x) { return x; } inline uint32_t be2me_32(uint32_t x) { return x; } inline uint64_t be2me_64(uint64_t x) { return x; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |