summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Scheel <julian@jusst.de>2010-02-05 12:30:00 +0100
committerJulian Scheel <julian@jusst.de>2010-02-05 12:30:00 +0100
commitb261d83b69692cfa13aada3266f3c832861a48a8 (patch)
tree30e01a3ea0b86e25062e162d37cb28b27d8b4e0c
parent3c039d3b4c3bc24d26cb33c532c587c737564441 (diff)
downloadxine-lib-b261d83b69692cfa13aada3266f3c832861a48a8.tar.gz
xine-lib-b261d83b69692cfa13aada3266f3c832861a48a8.tar.bz2
Fix freeze/crash on seeking
When the parser was reset it did not forget about the last pts, which might cause metronom to freeze. On flush the cached vo_frame_t was kept in case the previously decode produced a 1st field and the decoder was waiting for 2nd field now. As on flush all images are released after drawing this could point to a invalid vo_frame_t
-rw-r--r--src/video_dec/libvdpau/h264_parser.c5
-rw-r--r--src/video_dec/libvdpau/vdpau_h264.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/video_dec/libvdpau/h264_parser.c b/src/video_dec/libvdpau/h264_parser.c
index d26d53f0c..30c793975 100644
--- a/src/video_dec/libvdpau/h264_parser.c
+++ b/src/video_dec/libvdpau/h264_parser.c
@@ -1562,6 +1562,11 @@ void reset_parser(struct h264_parser *parser)
parser->prev_top_field_order_cnt = 0;
parser->curr_pic_num = 0;
parser->flag_mask = 0;
+
+ if(parser->pic != NULL) {
+ free_coded_picture(parser->pic);
+ parser->pic = create_coded_picture();
+ }
}
void free_parser(struct h264_parser *parser)
diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c
index e20ac2ac9..28d455f39 100644
--- a/src/video_dec/libvdpau/vdpau_h264.c
+++ b/src/video_dec/libvdpau/vdpau_h264.c
@@ -702,6 +702,7 @@ static void vdpau_h264_flush (video_decoder_t *this_gen) {
"h264 flush, draw pts: %lld\n", decoded_pic->img->pts);
decoded_pic->img->draw(decoded_pic->img, this->stream);
dpb_set_output_picture(&(this->nal_parser->dpb), decoded_pic);
+ this->last_img = NULL;
}
dpb_free_all(&this->nal_parser->dpb);
this->reset = VO_NEW_SEQUENCE_FLAG;