aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-09 13:50:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-17 15:20:29 +0200
commit9333ee7c0db1d360eb2fa84cd129e286df83b817 (patch)
tree1429c51fe71098a5304a521179a1ddf40ce2be1f
parent3e30424961202d098a44eccc2c13ac965bc359a2 (diff)
downloadffmpeg-9333ee7c0db1d360eb2fa84cd129e286df83b817.tar.gz
avcodec/h264: Be more tolerant to changing pps id between slices
Fixes Ticket4446 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 98d0c4236c7542c87f012228d3bc88aea67bddc2) Conflicts: libavcodec/h264.c (cherry picked from commit 0cd0fa9d0baabd2dc0442ed8b53ba65282733b61) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d7b146e5f2..42f24fe81f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1516,9 +1516,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
continue;
again:
- if ( (!(avctx->active_thread_type & FF_THREAD_FRAME) || nals_needed >= nal_index)
- && !h->current_slice)
- h->au_pps_id = -1;
/* Ignore per frame NAL unit type during extradata
* parsing. Decoding slices is not possible in codec init
* with frame-mt */
@@ -1570,6 +1567,10 @@ again:
hx->inter_gb_ptr = &hx->gb;
hx->data_partitioning = 0;
+ if ( nals_needed >= nal_index
+ || (!(avctx->active_thread_type & FF_THREAD_FRAME) && !context_count))
+ h->au_pps_id = -1;
+
if ((err = ff_h264_decode_slice_header(hx, h)))
break;