Changed init data printing functions to print as hex garbage instead of binary garbage.

This commit is contained in:
Thulinma 2014-04-17 10:35:21 +02:00
parent dbf0b74e0a
commit 4e0fe2e6e5

View file

@ -2,6 +2,7 @@
#include "defines.h" #include "defines.h"
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <iomanip>
/// Retrieves a short in network order from the pointer p. /// Retrieves a short in network order from the pointer p.
@ -816,7 +817,11 @@ namespace DTSC {
} }
str << std::string(indent + 2, ' ') << "Codec: " << codec << std::endl; str << std::string(indent + 2, ' ') << "Codec: " << codec << std::endl;
str << std::string(indent + 2, ' ') << "Type: " << type << std::endl; str << std::string(indent + 2, ' ') << "Type: " << type << std::endl;
str << std::string(indent + 2, ' ') << "Init: " << init << std::endl; str << std::string(indent + 2, ' ') << "Init: ";
for (unsigned int i = 0; i < init.size(); ++i){
str << std::hex << std::setw(2) << std::setfill('0') << (int)init[i];
}
str << std::dec << std::endl;
if (type == "audio") { if (type == "audio") {
str << std::string(indent + 2, ' ') << "Rate: " << rate << std::endl; str << std::string(indent + 2, ' ') << "Rate: " << rate << std::endl;
str << std::string(indent + 2, ' ') << "Size: " << size << std::endl; str << std::string(indent + 2, ' ') << "Size: " << size << std::endl;
@ -916,7 +921,11 @@ namespace DTSC {
} }
str << std::string(indent + 2, ' ') << "Codec: " << codec << std::endl; str << std::string(indent + 2, ' ') << "Codec: " << codec << std::endl;
str << std::string(indent + 2, ' ') << "Type: " << type << std::endl; str << std::string(indent + 2, ' ') << "Type: " << type << std::endl;
str << std::string(indent + 2, ' ') << "Init: " << init << std::endl; str << std::string(indent + 2, ' ') << "Init: ";
for (unsigned int i = 0; i < init.size(); ++i){
str << std::hex << std::setw(2) << std::setfill('0') << (int)init[i];
}
str << std::dec << std::endl;
if (type == "audio") { if (type == "audio") {
str << std::string(indent + 2, ' ') << "Rate: " << rate << std::endl; str << std::string(indent + 2, ' ') << "Rate: " << rate << std::endl;
str << std::string(indent + 2, ' ') << "Size: " << size << std::endl; str << std::string(indent + 2, ' ') << "Size: " << size << std::endl;