summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-07 20:56:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-16 13:28:52 +0200
commit7eae8cd87054713cbef51b22b93f3a0eb5036c90 (patch)
tree892b1c7d5f2f7f77a60fb6379c683f2a25be4bc5 /libavcodec/h264.c
parent9025072e6c25ffd4507f0268b53743f9c4d52cd6 (diff)
avcodec/h264: fix frame skip code
Fixes Ticket3475 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 49e512de87..a266718ead 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1617,14 +1617,7 @@ again:
ff_vdpau_h264_picture_start(h);
}
- if (hx->redundant_pic_count == 0 &&
- (avctx->skip_frame < AVDISCARD_NONREF ||
- hx->nal_ref_idc) &&
- (avctx->skip_frame < AVDISCARD_BIDIR ||
- hx->slice_type_nos != AV_PICTURE_TYPE_B) &&
- (avctx->skip_frame < AVDISCARD_NONINTRA ||
- hx->slice_type_nos == AV_PICTURE_TYPE_I) &&
- avctx->skip_frame < AVDISCARD_ALL) {
+ if (hx->redundant_pic_count == 0) {
if (avctx->hwaccel) {
ret = avctx->hwaccel->decode_slice(avctx,
&buf[buf_index - consumed],
@@ -1655,7 +1648,7 @@ again:
hx->intra_gb_ptr =
hx->inter_gb_ptr = NULL;
- if ((err = ff_h264_decode_slice_header(hx, h)) < 0) {
+ if ((err = ff_h264_decode_slice_header(hx, h))) {
/* make sure data_partitioning is cleared if it was set
* before, so we don't try decoding a slice without a valid
* slice header later */
@@ -1730,8 +1723,9 @@ again:
context_count = 0;
}
- if (err < 0) {
- av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
+ if (err < 0 || err == SLICE_SKIPED) {
+ if (err < 0)
+ av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
h->ref_count[0] = h->ref_count[1] = h->list_count = 0;
} else if (err == 1) {
/* Slice could not be decoded in parallel mode, copy down