From 06520a1bdc5cfbd87df87d7e90dd22a384b7fdb8 Mon Sep 17 00:00:00 2001 From: Frank Bossen <fbossen@gmail.com> Date: Thu, 17 Sep 2020 13:19:23 -0400 Subject: [PATCH] Add .layer to filenames when outputting multiple layers --- source/App/DecoderApp/DecApp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp index 5206d2cdf..f7f8e1f38 100644 --- a/source/App/DecoderApp/DecApp.cpp +++ b/source/App/DecoderApp/DecApp.cpp @@ -285,13 +285,14 @@ uint32_t DecApp::decode() if( m_reconFileName.compare( "/dev/null" ) && m_cDecLib.getVPS() != nullptr && m_cDecLib.getVPS()->getMaxLayers() > 1 && xIsNaluWithinTargetOutputLayerIdSet( &nalu ) ) { size_t pos = reconFileName.find_last_of('.'); + std::string layerString = std::string(".layer") + std::to_string(nalu.m_nuhLayerId); if (pos != string::npos) { - reconFileName.insert( pos, std::to_string( nalu.m_nuhLayerId ) ); + reconFileName.insert(pos, layerString); } else { - reconFileName.append( std::to_string( nalu.m_nuhLayerId ) ); + reconFileName.append(layerString); } } if( ( m_cDecLib.getVPS() != nullptr && ( m_cDecLib.getVPS()->getMaxLayers() == 1 || xIsNaluWithinTargetOutputLayerIdSet( &nalu ) ) ) || m_cDecLib.getVPS() == nullptr ) -- GitLab