Sample Bug Fix - Batch sync issue (#289)

* bug fix for new dec creation

* move bit depth change after creating new dec

* codec update for every new dec

* bug fix for new dec creation

* move bit depth change after creating new dec

* codec update for every new dec

* fixes sync issue on MI250X for batch sample

* remove unused variable
Bu işleme şunda yer alıyor:
Lakshmi Kumar
2024-03-20 05:25:00 -07:00
işlemeyi yapan: GitHub
ebeveyn 5e9000a508
işleme e4316f009c
+7 -2
Dosyayı Görüntüle
@@ -119,7 +119,6 @@ void DecProc(RocVideoDecoder *p_dec, VideoDemuxer *demuxer, int *pn_frame, doubl
int64_t pts = 0;
double total_dec_time = 0.0;
OutputSurfaceInfo *surf_info;
decoding_complete = false;
auto start_time = std::chrono::high_resolution_clock::now();
do {
demuxer->Demux(&p_video, &n_video_bytes, &pts);
@@ -345,10 +344,16 @@ int main(int argc, char **argv) {
std::right << std::hex << pci_domain_id << "." << pci_device_id << std::dec << std::endl;
}
std::mutex mutex;
for (int j = 0; j < num_files; j++) {
int thread_idx = j % n_thread;
if (j >= n_thread) {
while (!v_dec_info[thread_idx]->decoding_complete);
{
std::unique_lock<std::mutex> lock(mutex);
while (!v_dec_info[thread_idx]->decoding_complete);
v_dec_info[thread_idx]->decoding_complete = false;
}
uint32_t bit_depth = v_demuxer[j]->GetBitDepth();
rocDecVideoCodec codec_id = AVCodec2RocDecVideoCodec(v_demuxer[j]->GetCodecID());
if (v_dec_info[thread_idx]->bit_depth != bit_depth || v_dec_info[thread_idx]->rocdec_codec_id != codec_id) {