summaryrefslogtreecommitdiff
path: root/src/libvdpau/h264_parser.c
diff options
context:
space:
mode:
authorJulian Scheel <julian@jusst.de>2009-03-23 18:03:45 +0000
committerJulian Scheel <julian@jusst.de>2009-03-23 18:03:45 +0000
commita31ee4e35b7a67deb5d2158ab07fce98c33ec35f (patch)
tree2e1af9b0b79e7df363bfcbd959b050b03948f694 /src/libvdpau/h264_parser.c
parent0edcaa5cbcf431bc3c3029aecb2dcc810ef67a82 (diff)
downloadxine-lib-a31ee4e35b7a67deb5d2158ab07fce98c33ec35f.tar.gz
xine-lib-a31ee4e35b7a67deb5d2158ab07fce98c33ec35f.tar.bz2
Another fix for split nal boundaries.
Diffstat (limited to 'src/libvdpau/h264_parser.c')
-rw-r--r--src/libvdpau/h264_parser.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libvdpau/h264_parser.c b/src/libvdpau/h264_parser.c
index 14e1b735a..c5dfbb373 100644
--- a/src/libvdpau/h264_parser.c
+++ b/src/libvdpau/h264_parser.c
@@ -1287,17 +1287,24 @@ int parse_frame(struct nal_parser *parser, uint8_t *inbuf, int inbuf_len,
* sequences and strip incomplete start seq parts from the buffer
* before.
*/
+
if(parsed_len > 0) {
static const uint8_t start_seq[3] = { 0x00, 0x00, 0x01 };
parser->prebuf_len -= start_seq_len - parsed_len;
- /* loop this until the start_seq was really parsed, else it might
- * be dropped in case we are just at a frame boundary
+ /* if we are just at a frame boundary the sequence wouldn't
+ * be taken over but we would just be notified about a new
+ * completed frame.
+ * so in this case we have to send the start sequence another
+ * time to get it into the prebuf again.
*/
- int int_parsed = 0;
- do {
- int_parsed += parse_frame(parser, start_seq, start_seq_len, ret_buf, ret_len, ret_slice_cnt);
- } while(int_parsed < 3);
+ uint8_t *tmp_ret_buf;
+ uint32_t tmp_ret_len;
+ uint32_t tmp_slice_cnt;
+
+ if(parse_frame(parser, start_seq, start_seq_len, ret_buf, ret_len, ret_slice_cnt) == 0)
+ parse_frame(parser, start_seq, start_seq_len, &tmp_ret_buf, &tmp_ret_len, &tmp_slice_cnt);
+
return parsed_len;
}
}