diff --git a/src/debug.h b/src/debug.h index 3301b2330..b77c5afb5 100644 --- a/src/debug.h +++ b/src/debug.h @@ -89,7 +89,9 @@ public: unsigned long long time_ms = time_since_epoch_in_ms(); auto flags = std::cerr.flags(); auto precision = std::cerr.precision(); - std::cerr << "[" << std::fixed << std::setprecision(3) << time_ms / 1000.0 << "] " << flags << precision; + std::cerr << "[" << std::fixed << std::setprecision(3) << time_ms / 1000.0 << "] "; + std::cerr.precision(precision); + std::cerr.flags(flags); } return std::cerr; diff --git a/src/host.cpp b/src/host.cpp index 20fe63f61..bec98302c 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -350,7 +350,7 @@ void print_capabilities(struct module *root, bool use_vidcap) cout << "[cap][audio_compress] " << codec.first << std::endl; } - cout << precision; + std::cout.precision(precision); } void print_version() @@ -456,7 +456,9 @@ void print_pixel_formats(void) { tag = codec_is_a_rgb(c) ? 'R' : 'Y'; auto width = cout.width(); + auto flags = cout.flags(); cout << " " << style::bold << left << setw(12) << get_codec_name(c) << style::reset << setw(0) << " " << tag << " " << setw(2) << get_bits_per_component(c) << setw(0) << " " << get_codec_name_long(c) << setw(width) << "\n"; + cout.flags(flags); } } @@ -468,7 +470,10 @@ void print_video_codecs(void) { } tag = is_codec_interframe(c) ? 'I' : '.'; - cout << " " << style::bold << left << setw(12) << get_codec_name(c) << style::reset << setw(0) << " " << tag << " " << " " << get_codec_name_long(c) << "\n"; + auto width = cout.width(); + auto flags = cout.flags(); + cout << " " << style::bold << left << setw(12) << get_codec_name(c) << style::reset << setw(0) << " " << tag << " " << " " << get_codec_name_long(c) << setw(width) << "\n"; + cout.flags(flags); } } diff --git a/src/keyboard_control.cpp b/src/keyboard_control.cpp index 54a22c89e..34b39435d 100644 --- a/src/keyboard_control.cpp +++ b/src/keyboard_control.cpp @@ -226,7 +226,7 @@ static int count_utf8_bytes(unsigned int i) { */ static int64_t get_ansi_code() { int64_t c = GETCH(); - debug_msg(MOD_NAME "Pressed %" PRId32 "\n", c); + debug_msg(MOD_NAME "Pressed %" PRId64 "\n", c); if (c == '[') { // CSI c = '\E' << 8 | '['; while (true) {