mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock Fixes Ticket2927 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
da54ad9a72
commit
29ffeef5e7
@ -3621,7 +3621,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
|
assert(h0->cur_pic_ptr->reference != DELAYED_PIC_REF);
|
||||||
|
|
||||||
/* Mark old field/frame as completed */
|
/* Mark old field/frame as completed */
|
||||||
if (!last_pic_droppable && h0->cur_pic_ptr->tf.owner == h0->avctx) {
|
if (h0->cur_pic_ptr->tf.owner == h0->avctx) {
|
||||||
ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
|
ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
|
||||||
last_pic_structure == PICT_BOTTOM_FIELD);
|
last_pic_structure == PICT_BOTTOM_FIELD);
|
||||||
}
|
}
|
||||||
@ -3630,7 +3630,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
|
if (!FIELD_PICTURE(h) || h->picture_structure == last_pic_structure) {
|
||||||
/* Previous field is unmatched. Don't display it, but let it
|
/* Previous field is unmatched. Don't display it, but let it
|
||||||
* remain for reference if marked as such. */
|
* remain for reference if marked as such. */
|
||||||
if (!last_pic_droppable && last_pic_structure != PICT_FRAME) {
|
if (last_pic_structure != PICT_FRAME) {
|
||||||
ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
|
ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
|
||||||
last_pic_structure == PICT_TOP_FIELD);
|
last_pic_structure == PICT_TOP_FIELD);
|
||||||
}
|
}
|
||||||
@ -3640,7 +3640,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
* different frame_nums. Consider this field first in
|
* different frame_nums. Consider this field first in
|
||||||
* pair. Throw away previous field except for reference
|
* pair. Throw away previous field except for reference
|
||||||
* purposes. */
|
* purposes. */
|
||||||
if (!last_pic_droppable && last_pic_structure != PICT_FRAME) {
|
if (last_pic_structure != PICT_FRAME) {
|
||||||
ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
|
ff_thread_report_progress(&h0->cur_pic_ptr->tf, INT_MAX,
|
||||||
last_pic_structure == PICT_TOP_FIELD);
|
last_pic_structure == PICT_TOP_FIELD);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user