| 147 | } |
| 148 | |
| 149 | AVCodecContext *avcodec_alloc_context3(const AVCodec *codec) |
| 150 | { |
| 151 | AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); |
| 152 | |
| 153 | if (!avctx) |
| 154 | return NULL; |
| 155 | |
| 156 | if (init_context_defaults(avctx, codec) < 0) { |
| 157 | av_free(avctx); |
| 158 | return NULL; |
| 159 | } |
| 160 | |
| 161 | return avctx; |
| 162 | } |
| 163 | |
| 164 | void avcodec_free_context(AVCodecContext **pavctx) |
| 165 | { |