From 4871002a37587beb2e9c24fcd9bac0c7a9ba6a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sat, 22 Jan 2011 23:14:57 +0100 Subject: Fix handling of H.264 end of sequence NAL unit for still images Currently a parsed picture was only decoded when the parser came across a NAL unit which started a new picture (aka access unit). An end of sequence NAL unit must be handled like the access unit delimiter NAL unit, as both terminate the current access unit. Handling the end of sequence NAL unit in this way fixes displaying of still images which end in an end of seqeunce NAL unit. Otherwise they were not decoded at all (in case of a still frame) or the second field was missing (in case of a still image which had been coded as a pair of fields). --- src/video_dec/libvdpau/h264_parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video_dec/libvdpau/h264_parser.c b/src/video_dec/libvdpau/h264_parser.c index 81621f070..d495bf483 100644 --- a/src/video_dec/libvdpau/h264_parser.c +++ b/src/video_dec/libvdpau/h264_parser.c @@ -1825,6 +1825,8 @@ int parse_nal(uint8_t *buf, int buf_len, struct h264_parser *parser, * we detect the start of a new access unit if * a non-vcl nal unit is received after a vcl * nal unit + * NAL_END_OF_SEQUENCE terminates the current + * access unit */ if (nal->nal_unit_type >= NAL_SLICE && nal->nal_unit_type <= NAL_SLICE_IDR) { @@ -1832,7 +1834,8 @@ int parse_nal(uint8_t *buf, int buf_len, struct h264_parser *parser, } else if ((parser->position == VCL && nal->nal_unit_type >= NAL_SEI && nal->nal_unit_type <= NAL_PPS) || - nal->nal_unit_type == NAL_AU_DELIMITER) { + nal->nal_unit_type == NAL_AU_DELIMITER || + nal->nal_unit_type == NAL_END_OF_SEQUENCE) { /* start of a new access unit! */ *completed_picture = parser->pic; parser->pic = create_coded_picture(); -- cgit v1.2.3