From: David Flynn <[email protected]> Previously, when pushing picture data into the decoder, there is an assertion that an output_picture is avaliable from the output_queue. This patch modifies the behaviour to nolonger execute the final combining picture decoding stage unless it has an output picture. The api state machine now requests a picture if any picture in the processing queue is missing an output_picture (and the queue is empty).
Signed-off-by: David Flynn <[email protected]> --- schroedinger/schrodecoder.c | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/schroedinger/schrodecoder.c b/schroedinger/schrodecoder.c index 762d548..b3f4c83 100644 --- a/schroedinger/schrodecoder.c +++ b/schroedinger/schrodecoder.c @@ -592,7 +592,12 @@ schro_decoder_get_status_locked (SchroDecoder *decoder) } if (decoder->sequence_header_buffer && schro_queue_is_empty (decoder->output_queue)) { - return SCHRO_DECODER_NEED_FRAME; + int i; + for(i=0;i<decoder->picture_queue->n;i++){ + SchroPicture *picture = decoder->picture_queue->elements[i].data; + if (!picture->output_picture) + return SCHRO_DECODER_NEED_FRAME; + } } if (!schro_queue_is_full (decoder->picture_queue) && !decoder->flushing) { return SCHRO_DECODER_NEED_BITS; @@ -866,9 +871,6 @@ schro_decoder_iterate_picture (SchroDecoder *decoder, SchroBuffer *buffer, Schro picture->stages[SCHRO_DECODER_STAGE_DONE].is_done = TRUE; picture->stages[SCHRO_DECODER_STAGE_DONE].is_needed = TRUE; - } else { - picture->output_picture = schro_queue_pull (decoder->output_queue); - SCHRO_ASSERT(picture->output_picture); } schro_async_lock (decoder->async); @@ -1072,8 +1074,14 @@ schro_decoder_async_schedule (SchroDecoder *decoder, } else if (TODO(SCHRO_DECODER_STAGE_COMBINE) && picture->stages[SCHRO_DECODER_STAGE_WAVELET_TRANSFORM].is_done && picture->stages[SCHRO_DECODER_STAGE_MOTION_RENDER].is_done && render_ok) { - func = schro_decoder_x_combine; - stage = SCHRO_DECODER_STAGE_COMBINE; + if (!picture->output_picture) { + /* NB, this may fail */ + picture->output_picture = schro_queue_pull (decoder->output_queue); + } + if (picture->output_picture) { + func = schro_decoder_x_combine; + stage = SCHRO_DECODER_STAGE_COMBINE; + } } if (func) { -- 1.5.6.5 ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Schrodinger-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/schrodinger-devel
