decoder: h264: fix marking of non-reference picture into DPB.

Fix search for a picture in the DPB that has a lower POC value than
the current picture. The dpb_find_lowest_poc() function will return
a picture with the lowest POC in DPB and that is marked as "needed
for output", but an additional check against the actual POC value
of the current picture is needed.

This is a regression from 1c46990.

https://bugzilla.gnome.org/show_bug.cgi?id=732130
This commit is contained in:
Gwenole Beauchesne 2014-06-25 22:26:32 +02:00
parent 8db72147c7
commit bea0d07042

View file

@ -955,8 +955,10 @@ dpb_add(GstVaapiDecoderH264 *decoder, GstVaapiPictureH264 *picture)
if (!picture->output_flag && !StoreInterViewOnlyRefFlag)
return TRUE;
while (priv->dpb_count == priv->dpb_size) {
GstVaapiPictureH264 *found_picture;
if (!StoreInterViewOnlyRefFlag) {
if (dpb_find_lowest_poc(decoder, picture, NULL) < 0)
if (dpb_find_lowest_poc(decoder, picture, &found_picture) < 0 ||
found_picture->base.poc > picture->base.poc)
return dpb_output(decoder, NULL, picture);
}
if (!dpb_bump(decoder, picture))