Browse Source

g726dec: add flush() function to reset state when seeking

tags/n0.9
Justin Ruggles 14 years ago
parent
commit
da24963725
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavcodec/g726.c

+ 7
- 0
libavcodec/g726.c View File

@@ -460,6 +460,12 @@ static int g726_decode_frame(AVCodecContext *avctx,
return buf_size; return buf_size;
} }


static void g726_decode_flush(AVCodecContext *avctx)
{
G726Context *c = avctx->priv_data;
g726_reset(c);
}

AVCodec ff_adpcm_g726_decoder = { AVCodec ff_adpcm_g726_decoder = {
.name = "g726", .name = "g726",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
@@ -467,6 +473,7 @@ AVCodec ff_adpcm_g726_decoder = {
.priv_data_size = sizeof(G726Context), .priv_data_size = sizeof(G726Context),
.init = g726_decode_init, .init = g726_decode_init,
.decode = g726_decode_frame, .decode = g726_decode_frame,
.flush = g726_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
}; };
#endif #endif

Loading…
Cancel
Save