summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-31 22:16:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-01 21:43:44 +0100
commit9ba43e50efa2483fb3ca1e3f62a474db7dd3ac8d (patch)
tree556e27bfbd797268f0e8981ba6fcaaf9cbbc81a6 /libavcodec/h264.c
parentfba6777363eb74d926aa0eed281a77ff152a3ad5 (diff)
h264: Fix frame sync / random access handling.
It seems I have misunderstood the spec when I implemented this originally. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 27240e00d9..a9f15f44d9 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3906,13 +3906,13 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
(hx->nal_unit_type == NAL_IDR_SLICE);
if (h->recovery_frame == h->frame_num) {
- h->sync |= 1;
+ s->current_picture_ptr->sync |= 1;
h->recovery_frame = -1;
}
h->sync |= !!s->current_picture_ptr->f.key_frame;
h->sync |= 3*!!(s->flags2 & CODEC_FLAG2_SHOW_ALL);
- s->current_picture_ptr->sync = h->sync;
+ s->current_picture_ptr->sync |= h->sync;
if (h->current_slice == 1) {
if(!(s->flags2 & CODEC_FLAG2_CHUNKS)) {
@@ -4129,11 +4129,9 @@ not_extra:
field_end(h, 0);
*data_size = 0; /* Wait for second field. */
- if (h->next_output_pic && h->next_output_pic->sync) {
- if(h->sync>1 || h->next_output_pic->f.pict_type != AV_PICTURE_TYPE_B){
+ if (h->next_output_pic && (h->next_output_pic->sync || h->sync>1)) {
*data_size = sizeof(AVFrame);
*pict = *(AVFrame*)h->next_output_pic;
- }
}
}