From 4e0fe2e6e526b25a45b64734ce7ef6204afc3ff1 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 17 Apr 2014 10:35:21 +0200 Subject: [PATCH] Changed init data printing functions to print as hex garbage instead of binary garbage. --- lib/dtscmeta.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/dtscmeta.cpp b/lib/dtscmeta.cpp index 4830f6d9..0989f217 100644 --- a/lib/dtscmeta.cpp +++ b/lib/dtscmeta.cpp @@ -2,6 +2,7 @@ #include "defines.h" #include #include +#include /// 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, ' ') << "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") { str << std::string(indent + 2, ' ') << "Rate: " << rate << 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, ' ') << "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") { str << std::string(indent + 2, ' ') << "Rate: " << rate << std::endl; str << std::string(indent + 2, ' ') << "Size: " << size << std::endl;