diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-02-20 19:47:51 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-03-02 21:32:00 +0100 |
commit | 432adca5fedcb277b9a715a723cfd40735ec58f8 (patch) | |
tree | 68bf173c1fce8c1b2255344f2daa605e59d2ba27 /libavcodec/rv10.c | |
parent | 79b40ff58c2e6f59d7a5e6d289243a10ff1dccb4 (diff) | |
download | ffmpeg-432adca5fedcb277b9a715a723cfd40735ec58f8.tar.gz |
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/rv10.c')
-rw-r--r-- | libavcodec/rv10.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 2233edfca5..bb1ead5002 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -587,10 +587,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n) { - if (avctx->slice_count) - return avctx->slice_offset[n]; - else - return AV_RL32(buf + n * 8); + return AV_RL32(buf + n * 8); } static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, @@ -610,21 +607,18 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, return 0; } - if (!avctx->slice_count) { - slice_count = (*buf++) + 1; - buf_size--; + slice_count = (*buf++) + 1; + buf_size--; - if (!slice_count || buf_size <= 8 * slice_count) { - av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n", - slice_count); - return AVERROR_INVALIDDATA; - } + if (!slice_count || buf_size <= 8 * slice_count) { + av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n", + slice_count); + return AVERROR_INVALIDDATA; + } - slices_hdr = buf + 4; - buf += 8 * slice_count; - buf_size -= 8 * slice_count; - } else - slice_count = avctx->slice_count; + slices_hdr = buf + 4; + buf += 8 * slice_count; + buf_size -= 8 * slice_count; for (i = 0; i < slice_count; i++) { unsigned offset = get_slice_offset(avctx, slices_hdr, i); |