diff options
author | Roman Shaposhnik <roman@shaposhnik.org> | 2004-02-10 20:48:09 +0000 |
---|---|---|
committer | Roman Shaposhnik <roman@shaposhnik.org> | 2004-02-10 20:48:09 +0000 |
commit | 826ca10408ff30f014426092274424b1a13419ea (patch) | |
tree | 012a1b0400ac7283a6f20b1b6bef55bb0bc284de /libavcodec | |
parent | 8a36717afcb99e63535c2c6ad1459c7222365a9f (diff) | |
download | ffmpeg-826ca10408ff30f014426092274424b1a13419ea.tar.gz |
* gotta setup coded_frame for encoding. avcodec.h says that for decoding
lavc is supposed to set it up as well and I don't think I see any
reason not to.
Originally committed as revision 2769 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/g726.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c index a630c2a3eb..c016f32cff 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -334,6 +334,17 @@ static int g726_init(AVCodecContext * avctx) c->bit_buffer = 0; c->bits_left = 0; + avctx->coded_frame = avcodec_alloc_frame(); + if (!avctx->coded_frame) + return -ENOMEM; + avctx->coded_frame->key_frame = 1; + + return 0; +} + +static int g726_close(AVCodecContext *avctx) +{ + av_freep(&avctx->coded_frame); return 0; } @@ -394,7 +405,7 @@ AVCodec adpcm_g726_encoder = { sizeof(AVG726Context), g726_init, g726_encode_frame, - NULL, + g726_close, NULL, }; #endif //CONFIG_ENCODERS @@ -406,6 +417,6 @@ AVCodec adpcm_g726_decoder = { sizeof(AVG726Context), g726_init, NULL, - NULL, + g726_close, g726_decode_frame, }; |