Do not add decode task when the collect task is not end

This commit is contained in:
dreamsourcelabTAI 2024-05-17 15:38:57 +08:00
parent ede017bfb4
commit 3358e89948
2 changed files with 15 additions and 3 deletions

View File

@ -560,6 +560,11 @@ void DecoderStack::decode_data(const uint64_t decode_start, const uint64_t decod
uint64_t align_sample_count = _snapshot->get_ring_sample_count();
if (align_sample_count == 0){
dsv_info("Have no data to decode.");
return;
}
if (end_index >= align_sample_count){
end_index = align_sample_count - 1;
dsv_info("Reset the decode end sample, new:%llu, old:%llu",

View File

@ -1688,7 +1688,15 @@ namespace pv
{
auto trace = get_decoder_trace(index);
if (trace && trace->create_popup(false))
if (trace == NULL){
return;
}
if (!trace->create_popup(false)){
return;
}
if (have_view_data() && !is_working())
{
remove_decode_task(trace); // remove old task
trace->decoder()->clear();
@ -1868,8 +1876,7 @@ namespace pv
std::lock_guard<std::mutex> lock(_decode_task_mutex);
_decode_tasks.push_back(trace);
if (!_is_decoding)
{
if (!_is_decoding){
if (_decode_thread.joinable())
_decode_thread.join();