| 214 | } |
| 215 | |
| 216 | static int decode_frame(AVCodecContext *avctx, vpx_codec_ctx_t *decoder, |
| 217 | const uint8_t *data, uint32_t data_sz) |
| 218 | { |
| 219 | if (vpx_codec_decode(decoder, data, data_sz, NULL, 0) != VPX_CODEC_OK) { |
| 220 | const char *error = vpx_codec_error(decoder); |
| 221 | const char *detail = vpx_codec_error_detail(decoder); |
| 222 | |
| 223 | av_log(avctx, AV_LOG_ERROR, "Failed to decode frame: %s\n", error); |
| 224 | if (detail) { |
| 225 | av_log(avctx, AV_LOG_ERROR, " Additional information: %s\n", |
| 226 | detail); |
| 227 | } |
| 228 | return AVERROR_INVALIDDATA; |
| 229 | } |
| 230 | return 0; |
| 231 | } |
| 232 | |
| 233 | static int vpx_decode(AVCodecContext *avctx, AVFrame *picture, |
| 234 | int *got_frame, AVPacket *avpkt) |