Commit c7f34d66 authored by heydowns's avatar heydowns

Fix brain-dead parts of r11216, specifically:

Actually unreference removed pics
And check for too many reference frames as originally intended, not equal
to max reference frames.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11218 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b5656524
...@@ -3612,8 +3612,7 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){ ...@@ -3612,8 +3612,7 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
s->current_picture_ptr->reference |= s->picture_structure; s->current_picture_ptr->reference |= s->picture_structure;
} }
if (h->sps.ref_frame_count && if (h->long_ref_count + h->short_ref_count > h->sps.ref_frame_count){
h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count){
/* We have too many reference frames, probably due to corrupted /* We have too many reference frames, probably due to corrupted
* stream. Need to discard one frame. Prevents overrun of the * stream. Need to discard one frame. Prevents overrun of the
...@@ -3629,10 +3628,13 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){ ...@@ -3629,10 +3628,13 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
break; break;
assert(i < 16); assert(i < 16);
pic = h->long_ref[i];
remove_long_at_index(h, i); remove_long_at_index(h, i);
} else { } else {
pic = h->short_ref[h->short_ref_count - 1];
remove_short_at_index(h, h->short_ref_count - 1); remove_short_at_index(h, h->short_ref_count - 1);
} }
unreference_pic(h, pic, 0);
} }
print_short_term(h); print_short_term(h);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment