summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libvdpau/dpb.c3
-rw-r--r--src/libvdpau/vdpau_h264.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libvdpau/dpb.c b/src/libvdpau/dpb.c
index 8ea9fd069..d27611e64 100644
--- a/src/libvdpau/dpb.c
+++ b/src/libvdpau/dpb.c
@@ -20,7 +20,8 @@ struct decoded_picture* init_decoded_picture(struct nal_unit *src_nal,
copy_nal_unit(pic->nal, src_nal);
pic->top_is_reference = pic->nal->slc->field_pic_flag
? (pic->nal->slc->bottom_field_flag ? 0 : 1) : 1;
- pic->bottom_is_reference = 0;
+ pic->bottom_is_reference = pic->nal->slc->field_pic_flag
+ ? (pic->nal->slc->bottom_field_flag ? 1 : 0) : 1;
pic->surface = surface;
pic->img = img;
pic->next = NULL;
diff --git a/src/libvdpau/vdpau_h264.c b/src/libvdpau/vdpau_h264.c
index e4faf5969..7b9299dae 100644
--- a/src/libvdpau/vdpau_h264.c
+++ b/src/libvdpau/vdpau_h264.c
@@ -353,6 +353,7 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
// FIXME: do we really hit all cases here?
if(((uint8_t*)vdp_buffer.bitstream) != NULL) {
+ free(vdp_buffer.bitstream);
}
if(status != VDP_STATUS_OK)
@@ -364,11 +365,11 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
img->bad_frame = 0;
if(pic.is_reference) {
- if(!this->wait_for_bottom_field) {
+ if(!slc->field_pic_flag || !this->wait_for_bottom_field) {
struct decoded_picture *pic = init_decoded_picture(this->nal_parser->current_nal, surface, img);
this->last_ref_pic = pic;
dpb_add_picture(&(this->nal_parser->dpb), pic, sps->num_ref_frames);
- } else {
+ } else if(slc->field_pic_flag && this->wait_for_bottom_field) {
if(this->last_ref_pic) {
this->last_ref_pic->bottom_is_reference = 1;
}