From: Julian S. <ju...@ju...> - 2010-03-30 17:01:13
|
# HG changeset patch # User Julian Scheel <ju...@ju...> # Date 1269965066 -7200 # Node ID f8524daa6eec1e4c456451ad18f2a974e1bf0817 # Parent ee3aa66f7b6c8335ca8314611760edbc21354562 fix potential deadlock on h264 playback - free vo_frames as early as possible to avoid dead-locks, due to unnecesarily locked frames - ensure that dpb does not exceed given max size diff --git a/src/video_dec/libvdpau/dpb.c b/src/video_dec/libvdpau/dpb.c --- a/src/video_dec/libvdpau/dpb.c +++ b/src/video_dec/libvdpau/dpb.c @@ -93,7 +93,10 @@ void free_decoded_picture(struct decoded_picture *pic) { - pic->img->free(pic->img); + if(pic->img != NULL) { + pic->img->free(pic->img); + } + free_coded_picture(pic->coded_pic[1]); free_coded_picture(pic->coded_pic[0]); pic->coded_pic[0] = NULL; @@ -363,6 +366,11 @@ return -1; outpic->delayed_output = 0; + if(outpic->img != NULL) { + outpic->img->free(outpic->img); + outpic->img = NULL; + } + if(!outpic->used_for_reference) dpb_remove_picture(dpb, outpic); @@ -458,6 +466,13 @@ last_pic = pic; } } while (pic != NULL && (pic = pic->next) != NULL); + + /* if all pictured in dpb are marked as delayed for output + * we need to drop a not yet drawn image. take the oldest one + */ + if(!discard_ref) { + discard_ref = dpb->pictures; + } } if(discard_ref != NULL) { |