mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 01:25:25 +00:00
8svx: remove useless rounding code.
samples_size and samples_idx are supposed to be multiple of channels at all time. If they are, the division is exact; if they are not, something is very wrong in the code.
This commit is contained in:
parent
1c98781837
commit
5caea648d4
@ -37,6 +37,7 @@
|
||||
* http://aminet.net/mods/smpl/
|
||||
*/
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "avcodec.h"
|
||||
|
||||
/** decoder context */
|
||||
@ -150,7 +151,8 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
esc->frame.nb_samples = (FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx) +avctx->channels-1) / avctx->channels;
|
||||
av_assert1(!(esc->samples_size % avctx->channels || esc->samples_idx % avctx->channels));
|
||||
esc->frame.nb_samples = FFMIN(MAX_FRAME_SIZE, esc->samples_size - esc->samples_idx) / avctx->channels;
|
||||
if ((ret = avctx->get_buffer(avctx, &esc->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user