mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/mediacodecdec_common: ensure current input buffer is always used correctly
The loop may mutate the input buffer, so re-fetch it to ensure the current one is always used. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
This commit is contained in:
parent
f821d19531
commit
ca613dcc38
@ -569,7 +569,6 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
|
|||||||
int offset = 0;
|
int offset = 0;
|
||||||
int need_draining = 0;
|
int need_draining = 0;
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
ssize_t index = s->current_input_buffer;
|
|
||||||
size_t size;
|
size_t size;
|
||||||
FFAMediaCodec *codec = s->codec;
|
FFAMediaCodec *codec = s->codec;
|
||||||
int status;
|
int status;
|
||||||
@ -591,6 +590,7 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (offset < pkt->size || (need_draining && !s->draining)) {
|
while (offset < pkt->size || (need_draining && !s->draining)) {
|
||||||
|
ssize_t index = s->current_input_buffer;
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
index = ff_AMediaCodec_dequeueInputBuffer(codec, input_dequeue_timeout_us);
|
index = ff_AMediaCodec_dequeueInputBuffer(codec, input_dequeue_timeout_us);
|
||||||
if (ff_AMediaCodec_infoTryAgainLater(codec, index)) {
|
if (ff_AMediaCodec_infoTryAgainLater(codec, index)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user