Mystery solved

This commit is contained in:
Thulinma 2011-03-13 13:31:55 +01:00
parent 589c517479
commit 1a6a9eeb9b
2 changed files with 5 additions and 1 deletions

View file

@ -13,7 +13,7 @@ int main( int argc, char * argv[] ) {
temp += ifs.get(); temp += ifs.get();
} }
static AMFType amfdata("empty", (unsigned char)0xFF); static AMFType amfdata("empty", (unsigned char)0xFF);
amfdata = parseAMF( temp ); amfdata = parseAMF( (const unsigned char*)temp.c_str(), temp.length()-1 );
amfdata.Print( ); amfdata.Print( );
return 0; return 0;
} }

View file

@ -262,6 +262,9 @@ AMFType parseOneAMF(const unsigned char *& data, unsigned int &len, unsigned int
std::string tmpstr; std::string tmpstr;
unsigned int tmpi = 0; unsigned int tmpi = 0;
unsigned char tmpdbl[8]; unsigned char tmpdbl[8];
#if DEBUG >= 10
fprintf(stderr, "Note: AMF type %hhx found. %i bytes left\n", data[i], len-i);
#endif
switch (data[i]){ switch (data[i]){
case AMF0_NUMBER: case AMF0_NUMBER:
tmpdbl[7] = data[i+1]; tmpdbl[7] = data[i+1];
@ -397,3 +400,4 @@ AMFType parseAMF(const unsigned char * data, unsigned int len){
return ret; return ret;
}//parseAMF }//parseAMF
AMFType parseAMF(std::string data){return parseAMF((const unsigned char*)data.c_str(), data.size());} AMFType parseAMF(std::string data){return parseAMF((const unsigned char*)data.c_str(), data.size());}