@@ -185,7 +185,7 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
ff_vdpau_h264_picture_complete(h);
#endif
- if (!in_setup && !h->droppable)
+ if (!in_setup && !h->droppable && h->has_slice)
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
h->picture_structure == PICT_BOTTOM_FIELD);
emms_c();
@@ -607,6 +607,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
int idr_cleared=0;
int i, ret = 0;
+ h->has_slice = 0;
h->nal_unit_type= 0;
h->max_contexts = h->nb_slice_ctx;
@@ -672,6 +673,7 @@ again:
h->has_recovery_point = 1;
case H264_NAL_SLICE:
sl->gb = nal->gb;
+ h->has_slice = 1;
if ((err = ff_h264_decode_slice_header(h, sl, nal)))
break;
@@ -839,7 +841,7 @@ end:
}
#endif /* CONFIG_ERROR_RESILIENCE */
/* clean up */
- if (h->cur_pic_ptr && !h->droppable) {
+ if (h->cur_pic_ptr && !h->droppable && h->has_slice) {
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
h->picture_structure == PICT_BOTTOM_FIELD);
}
@@ -541,6 +541,8 @@ typedef struct H264Context {
int has_recovery_point;
+ int has_slice;
+
int missing_fields;
/* for frame threading, this is set to 1
Found-by: ubitux Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/h264_picture.c | 2 +- libavcodec/h264dec.c | 4 +++- libavcodec/h264dec.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-)