comparison wmadec.c @ 11062:a8e640f4f388 libavcodec

Flush the bitreservour. Fixes issue1716
author michael
date Sat, 30 Jan 2010 21:55:18 +0000
parents 2dbb341a14ba
children 964d01b50f17
comparison
equal deleted inserted replaced
11061:40b84645b089 11062:a8e640f4f388
918 /* when error, we reset the bit reservoir */ 918 /* when error, we reset the bit reservoir */
919 s->last_superframe_len = 0; 919 s->last_superframe_len = 0;
920 return -1; 920 return -1;
921 } 921 }
922 922
923 static av_cold void flush(AVCodecContext *avctx)
924 {
925 WMACodecContext *s = avctx->priv_data;
926
927 s->last_bitoffset=
928 s->last_superframe_len= 0;
929 }
930
923 AVCodec wmav1_decoder = 931 AVCodec wmav1_decoder =
924 { 932 {
925 "wmav1", 933 "wmav1",
926 CODEC_TYPE_AUDIO, 934 CODEC_TYPE_AUDIO,
927 CODEC_ID_WMAV1, 935 CODEC_ID_WMAV1,
928 sizeof(WMACodecContext), 936 sizeof(WMACodecContext),
929 wma_decode_init, 937 wma_decode_init,
930 NULL, 938 NULL,
931 ff_wma_end, 939 ff_wma_end,
932 wma_decode_superframe, 940 wma_decode_superframe,
941 .flush=flush,
933 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), 942 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
934 }; 943 };
935 944
936 AVCodec wmav2_decoder = 945 AVCodec wmav2_decoder =
937 { 946 {
941 sizeof(WMACodecContext), 950 sizeof(WMACodecContext),
942 wma_decode_init, 951 wma_decode_init,
943 NULL, 952 NULL,
944 ff_wma_end, 953 ff_wma_end,
945 wma_decode_superframe, 954 wma_decode_superframe,
955 .flush=flush,
946 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), 956 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
947 }; 957 };