rocdecdecode sample: Fixed the crash issue on AVC streams. (#688)

* * rocDecode/rocdecdecode sample: Fixed the crash issue on AVC streams.
 - We need to set bit depth to 8 when creating the initial decoder. This allows all codec types to be accommodated. Other bit depths can be supported in decoder reconfig later.

* * rocDecode/rocdecdecode sample: Changed program stop from harsh abort to graceful exit, when critial error occurs.

* * rocDecode/rocdecdecode sample: Minor change based on review comment.
This commit is contained in:
Jeff Jiang
2026-01-08 15:27:46 -05:00
committato da GitHub
parent 8fbb195a72
commit 4cf1a48d82
+2 -2
Vedi File
@@ -65,7 +65,7 @@ __attribute__((visibility("hidden"))) inline void report_error(
<< file_name << ":" << line)
<< ... << std::forward<Args>(args))
<< std::endl;
std::abort();
std::exit(EXIT_FAILURE);
}
//hardcoding for this sample
@@ -362,7 +362,7 @@ void create_decoder(DecoderInfo& dec_info) {
// this will get changed in reconfigure when the sequence header is parsed from the stream to detect the actual video parameters
create_info.chroma_format = rocDecVideoChromaFormat_420;
create_info.output_format = rocDecVideoSurfaceFormat_NV12;
create_info.bit_depth_minus_8 = 2;
create_info.bit_depth_minus_8 = 0;
create_info.num_output_surfaces = 1;
CHECK(rocDecCreateDecoder(&dec_info.decoder, &create_info));
}