summaryrefslogtreecommitdiff
path: root/libavcodec/rv34.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-02-20 19:47:51 +0100
committerAnton Khirnov <anton@khirnov.net>2023-03-02 21:32:00 +0100
commit432adca5fedcb277b9a715a723cfd40735ec58f8 (patch)
tree68bf173c1fce8c1b2255344f2daa605e59d2ba27 /libavcodec/rv34.c
parent79b40ff58c2e6f59d7a5e6d289243a10ff1dccb4 (diff)
lavc: disable an obsolete hack for real video
AVCodecContext.slice_{count,offset} are unneeded since 2007, commit 383b123ed37df4ff99010646f1fa5911ff1428cc and following. Deprecate those fields.
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r--libavcodec/rv34.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index be188edc47..45f64666f8 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1549,8 +1549,7 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte
static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n, int slice_count, int buf_size)
{
if (n < slice_count) {
- if(avctx->slice_count) return avctx->slice_offset[n];
- else return AV_RL32(buf + n*8 - 4) == 1 ? AV_RL32(buf + n*8) : AV_RB32(buf + n*8);
+ return AV_RL32(buf + n*8 - 4) == 1 ? AV_RL32(buf + n*8) : AV_RB32(buf + n*8);
} else
return buf_size;
}
@@ -1623,13 +1622,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict,
return 0;
}
- if(!avctx->slice_count){
- slice_count = (*buf++) + 1;
- slices_hdr = buf + 4;
- buf += 8 * slice_count;
- buf_size -= 1 + 8 * slice_count;
- }else
- slice_count = avctx->slice_count;
+ slice_count = (*buf++) + 1;
+ slices_hdr = buf + 4;
+ buf += 8 * slice_count;
+ buf_size -= 1 + 8 * slice_count;
offset = get_slice_offset(avctx, slices_hdr, 0, slice_count, buf_size);
//parse first slice header to check whether this frame can be decoded