mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-28 03:34:06 +00:00
Fix for input_read_thread() in the case when interlaced source-scan-type is used
This commit is contained in:
parent
198204a20a
commit
441ce7728f
|
@ -165,8 +165,6 @@ static void* input_read_thread(void* in_args) {
|
||||||
if (args->field_parity == 0) {
|
if (args->field_parity == 0) {
|
||||||
if (yuv_io_read(args->input, args->opts->config->width, args->opts->config->height, frame_in)) {
|
if (yuv_io_read(args->input, args->opts->config->width, args->opts->config->height, frame_in)) {
|
||||||
args->img_in[frames_read & 1] = frame_in;
|
args->img_in[frames_read & 1] = frame_in;
|
||||||
frames_read ++;
|
|
||||||
frame_in = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
// EOF or some error
|
// EOF or some error
|
||||||
if (!feof(args->input)) {
|
if (!feof(args->input)) {
|
||||||
|
@ -180,9 +178,16 @@ static void* input_read_thread(void* in_args) {
|
||||||
if (args->encoder->cfg->source_scan_type != 0) {
|
if (args->encoder->cfg->source_scan_type != 0) {
|
||||||
args->img_in[frames_read & 1] = args->api->picture_alloc(args->encoder->in.width, args->encoder->in.height);
|
args->img_in[frames_read & 1] = args->api->picture_alloc(args->encoder->in.width, args->encoder->in.height);
|
||||||
yuv_io_extract_field(frame_in, args->encoder->cfg->source_scan_type, args->field_parity, args->img_in[frames_read & 1]);
|
yuv_io_extract_field(frame_in, args->encoder->cfg->source_scan_type, args->field_parity, args->img_in[frames_read & 1]);
|
||||||
if (args->field_parity == 1) args->api->picture_free(frame_in);
|
if (args->field_parity == 1) {
|
||||||
args->field_parity ^= 1; //0->1 or 1->0
|
args->api->picture_free(frame_in);
|
||||||
|
frame_in = NULL;
|
||||||
}
|
}
|
||||||
|
args->field_parity ^= 1; //0->1 or 1->0
|
||||||
|
} else {
|
||||||
|
frame_in = NULL;
|
||||||
|
}
|
||||||
|
frames_read++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
goto exit_eof;
|
goto exit_eof;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue