mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
libgsm: add flush function to reset the decoder state when seeking
This commit is contained in:
parent
480324e7ca
commit
20e081dddc
@ -194,6 +194,11 @@ static int libgsm_decode_frame(AVCodecContext *avctx,
|
||||
return avctx->block_align;
|
||||
}
|
||||
|
||||
static void libgsm_flush(AVCodecContext *avctx) {
|
||||
gsm_destroy(avctx->priv_data);
|
||||
avctx->priv_data = gsm_create();
|
||||
}
|
||||
|
||||
AVCodec ff_libgsm_decoder = {
|
||||
.name = "libgsm",
|
||||
.type = AVMEDIA_TYPE_AUDIO,
|
||||
@ -201,6 +206,7 @@ AVCodec ff_libgsm_decoder = {
|
||||
.init = libgsm_decode_init,
|
||||
.close = libgsm_decode_close,
|
||||
.decode = libgsm_decode_frame,
|
||||
.flush = libgsm_flush,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
|
||||
};
|
||||
|
||||
@ -211,5 +217,6 @@ AVCodec ff_libgsm_ms_decoder = {
|
||||
.init = libgsm_decode_init,
|
||||
.close = libgsm_decode_close,
|
||||
.decode = libgsm_decode_frame,
|
||||
.flush = libgsm_flush,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user