mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 00:40:25 +00:00
vcompress: fix multi-tile lavc
fixes the commit 69024468 (from 2022-08-18) that has broken:
`uv -F split:2:1 -t testcard:fps=30p -c lavc`
The problem is that the `tile_cnt` was set _prior_ to the vcompress
state reconfigure, which will yield 2 states. But prior that, the count
was 1. The task was started for tile_cnt (== 1) but waited upon for
separate_tiles.size() (== 2)!
This commit is contained in:
@@ -432,7 +432,6 @@ static shared_ptr<video_frame> compress_frame_tiles(struct compress_state *proxy
|
||||
shared_ptr<video_frame> frame)
|
||||
{
|
||||
struct compress_state_real *s = proxy->ptr;
|
||||
const int tile_cnt = (int) proxy->ptr->state.size();
|
||||
vector<shared_ptr<video_frame>> separate_tiles;
|
||||
if (frame) {
|
||||
if (!check_state_count(frame->tile_count, proxy)) {
|
||||
@@ -440,12 +439,13 @@ static shared_ptr<video_frame> compress_frame_tiles(struct compress_state *proxy
|
||||
}
|
||||
separate_tiles = vf_separate_tiles(frame);
|
||||
} else {
|
||||
separate_tiles.resize(tile_cnt);
|
||||
separate_tiles.resize(proxy->ptr->state.size());
|
||||
}
|
||||
|
||||
// frame pointer may no longer be valid
|
||||
frame = NULL;
|
||||
|
||||
const int tile_cnt = (int) proxy->ptr->state.size();
|
||||
vector<task_result_handle_t> task_handle(tile_cnt);
|
||||
|
||||
vector <compress_worker_data> data_tile(tile_cnt);
|
||||
@@ -461,7 +461,7 @@ static shared_ptr<video_frame> compress_frame_tiles(struct compress_state *proxy
|
||||
vector<shared_ptr<video_frame>> compressed_tiles(separate_tiles.size());
|
||||
|
||||
bool failed = false;
|
||||
for(unsigned int i = 0; i < separate_tiles.size(); ++i) {
|
||||
for (int i = 0; i < tile_cnt; ++i) {
|
||||
struct compress_worker_data *data = (struct compress_worker_data *)
|
||||
wait_task(task_handle[i]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user