Hi,

On Thu, Mar 22, 2012 at 4:35 PM, Luca Barbato <[email protected]> wrote:
> On 22/03/12 16:16, Ronald S. Bultje wrote:
>> On Fri, Mar 16, 2012 at 4:26 PM, Janne Grunau <[email protected]> wrote:
>>> On 2012-03-16 15:56:05 -0700, Ronald S. Bultje wrote:
>>>> Hi,
>>>>
>>>> On Fri, Mar 16, 2012 at 3:35 PM, Janne Grunau <[email protected]> 
>>>> wrote:
>>>>>     if(last && s->current_picture_ptr){
>>>>>         if(r->loop_filter)
>>>>>             r->loop_filter(r, s->mb_height - 1);
>>>>> -        ff_er_frame_end(s);
>>>>> -        ff_MPV_frame_end(s);
>>>>>
>>>>> -        if (HAVE_THREADS && (s->avctx->active_thread_type & 
>>>>> FF_THREAD_FRAME))
>>>>> -            ff_thread_report_progress(&s->current_picture_ptr->f, 
>>>>> INT_MAX, 0);
>>>>> -
>>>>> -        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
>>>>> -            *pict = s->current_picture_ptr->f;
>>>>> -        } else if (s->last_picture_ptr != NULL) {
>>>>> -            *pict = s->last_picture_ptr->f;
>>>>> -        }
>>>>> -
>>>>> -        if(s->last_picture_ptr || s->low_delay){
>>>>> -            *data_size = sizeof(AVFrame);
>>>>> -            ff_print_debug_info(s, pict);
>>>>> -        }
>>>>> -        s->current_picture_ptr = NULL; //so we can detect if frame_end 
>>>>> wasnt called (find some nicer solution...)
>>>>> +        *got_picture_ptr = finish_frame(avctx, pict);
>>>>>     }
>>>>
>>>> This will hang if last is not set for some reason, e.g. if
>>>> decode_slice() returned an error. You need to call finish_frame()
>>>> unconditionally.
>>>
>>> last can be not set with slices passed one by one to decode_frame()
>>> It will be marked as finished on the next decode_frame() call with a
>>> first slice.
>>
>> I'm thinking we should just commit this and move on from here, I see
>> tons of crashes in rv34-mt, so it'll take multiple finetuning
>> iterations to get this right. Feel free to commit and let's move on
>> from there. Is that a plan?
>>
>
> Sounds good to me.

One comment, Janne if you could incorporate the following change:

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 720997f..ef75665 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -606,6 +606,8 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
         }
     }

+    s->mb_num_left = s1->mb_num_left;
+
     return 0;
 }

Otherwise the n_threads'th (instead of the next) thread will "unlock"
the previously not-completely-decoded image, leading to deadlocks all
over the place.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to