diff options
author | Julian Scheel <julian@jusst.de> | 2010-01-15 17:01:07 +0100 |
---|---|---|
committer | Julian Scheel <julian@jusst.de> | 2010-01-15 17:01:07 +0100 |
commit | bf3c4913014b78598b021c61b7275d72ab947cdb (patch) | |
tree | 894701baf0c1c5cf2cc1b9493827db40dd2c25c9 /src/video_dec/libvdpau/h264_parser.c | |
parent | e3fe265b0651f3544326a2e010db646957f3be55 (diff) | |
download | xine-lib-bf3c4913014b78598b021c61b7275d72ab947cdb.tar.gz xine-lib-bf3c4913014b78598b021c61b7275d72ab947cdb.tar.bz2 |
Fix seeking
Do not discard the parser, but reset fields that won't be valid after a decoder reset (ie seek) anymore
Diffstat (limited to 'src/video_dec/libvdpau/h264_parser.c')
-rw-r--r-- | src/video_dec/libvdpau/h264_parser.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/video_dec/libvdpau/h264_parser.c b/src/video_dec/libvdpau/h264_parser.c index 6bad1ac4d..505891caf 100644 --- a/src/video_dec/libvdpau/h264_parser.c +++ b/src/video_dec/libvdpau/h264_parser.c @@ -1549,9 +1549,31 @@ struct h264_parser* init_parser(xine_t *xine) return parser; } +void reset_parser(struct h264_parser *parser) +{ + parser->position = NON_VCL; + parser->buf_len = parser->prebuf_len = 0; + parser->next_nal_position = 0; + parser->last_nal_res = 0; + + if(parser->last_vcl_nal) { + release_nal_unit(parser->last_vcl_nal); + } + parser->last_vcl_nal = NULL; + + parser->prev_pic_order_cnt_msb = 1 << 16; + parser->prev_pic_order_cnt_lsb = 0; + parser->frame_num_offset = 0; + parser->prev_top_field_order_cnt = 0; + parser->curr_pic_num = 0; + parser->flag_mask = 0; +} + void free_parser(struct h264_parser *parser) { dpb_free_all(&parser->dpb); + free_nal_buffer(parser->pps_buffer); + free_nal_buffer(parser->sps_buffer); free(parser); } |