summaryrefslogtreecommitdiff
path: root/libavcodec/h264_refs.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-05-06 16:31:26 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2011-05-10 07:24:39 -0400
commite86fbe1751772a3b6790652ab382dcebaeec3aa8 (patch)
treefb4fa4d5b2826e6e508578a7849e99e35691c703 /libavcodec/h264_refs.c
parentd545cf804c4a246285d75aae48741da5d2344993 (diff)
h264: do not print "too many references" warning for intra-only.
Fixes issue 2679.
Diffstat (limited to 'libavcodec/h264_refs.c')
-rw-r--r--libavcodec/h264_refs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 13d43e6ebc..a025f7d352 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -621,15 +621,17 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
}
}
- if (h->long_ref_count + h->short_ref_count > h->sps.ref_frame_count){
+ if (h->long_ref_count + h->short_ref_count -
+ (h->short_ref[0] == s->current_picture_ptr) > h->sps.ref_frame_count){
/* We have too many reference frames, probably due to corrupted
* stream. Need to discard one frame. Prevents overrun of the
* short_ref and long_ref buffers.
*/
av_log(h->s.avctx, AV_LOG_ERROR,
- "number of reference frames exceeds max (probably "
- "corrupt input), discarding one\n");
+ "number of reference frames (%d+%d) exceeds max (%d; probably "
+ "corrupt input), discarding one\n",
+ h->long_ref_count, h->short_ref_count, h->sps.ref_frame_count);
if (h->long_ref_count && !h->short_ref_count) {
for (i = 0; i < 16; ++i)