Skip to content

Commit

Permalink
Use new condensed syntax for format strings in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nschlia committed Apr 19, 2024
1 parent 051c746 commit 61c2d5e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/blurayparser.cc
Expand Up @@ -172,7 +172,7 @@ static bool audio_stream_info(const std::string & path, BLURAY_STREAM_INFO *ss,
}
default:
{
Logging::error(path, "Unrecognised coding type %<%02x>1.", ss->coding_type);
Logging::error(path, "Unrecognised coding type %<02x>1.", ss->coding_type);
break;
}
}
Expand Down Expand Up @@ -382,7 +382,7 @@ static bool video_stream_info(const std::string & path, BLURAY_STREAM_INFO *ss,
}
default:
{
Logging::error(path, "Unrecognised coding type %<%02x>1.", ss->coding_type);
Logging::error(path, "Unrecognised coding type %<02x>1.", ss->coding_type);
break;
}
}
Expand Down Expand Up @@ -542,7 +542,7 @@ static bool create_bluray_virtualfile(BLURAY *bd, const BLURAY_TITLE_INFO* ti, c
audio = video_stream_info(path, &clip->video_streams[parse_find_best_video_stream()], &virtualfile->m_width, &virtualfile->m_height, &virtualfile->m_framerate, &interleaved);
}

Logging::trace(path, "Video %1 %2x%3@%<%5.2f>4%5 fps %6 [%7]", format_bitrate(video_bit_rate).c_str(), virtualfile->m_width, virtualfile->m_height, av_q2d(virtualfile->m_framerate), interleaved ? "i" : "p", format_size(size).c_str(), format_duration(duration).c_str());
Logging::trace(path, "Video %1 %2x%3@%<5.2f>4%5 fps %6 [%7]", format_bitrate(video_bit_rate).c_str(), virtualfile->m_width, virtualfile->m_height, av_q2d(virtualfile->m_framerate), interleaved ? "i" : "p", format_size(size).c_str(), format_duration(duration).c_str());
if (audio)
{
Logging::trace(path, "Audio %1 channels %2", virtualfile->m_channels, format_samplerate(virtualfile->m_sample_rate).c_str());
Expand Down
2 changes: 1 addition & 1 deletion src/dvdio.cc
Expand Up @@ -193,7 +193,7 @@ int DvdIO::openio(LPVIRTUALFILE virtualfile)
m_dvd_title = DVDOpenFile(m_dvd, tt_srpt->title[m_title_idx].title_set_nr, DVD_READ_TITLE_VOBS);
if (m_dvd_title == nullptr)
{
Logging::error(path(), "Can't open title VOBS (VTS_%<%02d>1_X.VOB).", tt_srpt->title[m_title_idx].title_set_nr);
Logging::error(path(), "Can't open title VOBS (VTS_%<02d>1_X.VOB).", tt_srpt->title[m_title_idx].title_set_nr);
ifoClose(m_vts_file);
ifoClose(m_vmg_file);
DVDClose(m_dvd);
Expand Down
2 changes: 1 addition & 1 deletion src/dvdparser.cc
Expand Up @@ -390,7 +390,7 @@ static bool create_dvd_virtualfile(const ifo_handle_t *vts_file, const std::stri
video_bit_rate = static_cast<BITRATE>(size * 8LL * AV_TIME_BASE / static_cast<uint64_t>(duration)); // calculate bitrate in bps
}

Logging::trace(virtualfile->m_destfile, "Video %1 %2x%3@%<%5.2f>4%5 fps %6 [%7]", format_bitrate(video_settings.m_video_bit_rate).c_str(), video_settings.m_width, video_settings.m_height, av_q2d(framerate), interleaved ? "i" : "p", format_size(size).c_str(), format_duration(duration).c_str());
Logging::trace(virtualfile->m_destfile, "Video %1 %2x%3@%<5.2f>4%5 fps %6 [%7]", format_bitrate(video_settings.m_video_bit_rate).c_str(), video_settings.m_width, video_settings.m_height, av_q2d(framerate), interleaved ? "i" : "p", format_size(size).c_str(), format_duration(duration).c_str());

virtualfile->m_width = video_settings.m_width;
virtualfile->m_height = video_settings.m_height;
Expand Down
4 changes: 2 additions & 2 deletions src/thread_pool.cc
Expand Up @@ -68,14 +68,14 @@ void thread_pool::loop_function()
break;
}

Logging::trace(nullptr, "Starting job taking pool thread no. %1 with id 0x%<%" FFMPEGFS_FORMAT_PTHREAD_T ">2.", thread_no, pthread_self());
Logging::trace(nullptr, "Starting job taking pool thread no. %1 with id 0x%<" FFMPEGFS_FORMAT_PTHREAD_T ">2.", thread_no, pthread_self());
info = m_thread_queue.front();
m_thread_queue.pop();
}

int ret = info.m_thread_func(info.m_opaque);

Logging::trace(nullptr, "The job using pool thread no. %1 with id 0x%<%" FFMPEGFS_FORMAT_PTHREAD_T ">2 has exited with return code %3.", thread_no, pthread_self(), ret);
Logging::trace(nullptr, "The job using pool thread no. %1 with id 0x%<" FFMPEGFS_FORMAT_PTHREAD_T ">2 has exited with return code %3.", thread_no, pthread_self(), ret);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/transcode.cc
Expand Up @@ -666,15 +666,15 @@ bool transcoder_read_frame(Cache_Entry* cache_entry, char* buff, size_t offset,

if (!reported)
{
Logging::trace(cache_entry->virtname(), "Frame no. %1: Cache miss at offset %<%11zu>2 (length %<%6u>3).", frame_no, offset, len);
Logging::trace(cache_entry->virtname(), "Frame no. %1: Cache miss at offset %<11zu>2 (length %<6u>3).", frame_no, offset, len);
reported = true;
}

mssleep(GRANULARITY);
}
}

Logging::trace(cache_entry->virtname(), "Frame no. %1: Cache hit at offset %<%11zu>2 (length %<%6u>3).", frame_no, offset, len);
Logging::trace(cache_entry->virtname(), "Frame no. %1: Cache hit at offset %<11zu>2 (length %<6u>3).", frame_no, offset, len);

success = !cache_entry->m_cache_info.m_error;
}
Expand Down

0 comments on commit 61c2d5e

Please sign in to comment.