This allows for simpler timestamp handling of decoded frames.
---
libavcodec/libspeexdec.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c
index a63d394..a142c4a 100644
--- a/libavcodec/libspeexdec.c
+++ b/libavcodec/libspeexdec.c
@@ -103,7 +103,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx,
void *data,
int buf_size = avpkt->size;
LibSpeexContext *s = avctx->priv_data;
int16_t *output;
- int ret, consumed = 0;
+ int ret;
/* get output buffer */
s->frame.nb_samples = s->frame_size;
@@ -124,7 +124,6 @@ static int libspeex_decode_frame(AVCodecContext *avctx,
void *data,
}
/* set new buffer */
speex_bits_read_from(&s->bits, buf, buf_size);
- consumed = buf_size;
}
/* decode a single frame */
@@ -139,7 +138,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx,
void *data,
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
- return consumed;
+ return speex_bits_remaining(&s->bits) < 43 ? buf_size : 0;
}
static av_cold int libspeex_decode_close(AVCodecContext *avctx)
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel