summaryrefslogtreecommitdiff
path: root/modules/avcodec/decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/avcodec/decode.c')
-rw-r--r--modules/avcodec/decode.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/avcodec/decode.c b/modules/avcodec/decode.c
index 9b24586..6416662 100644
--- a/modules/avcodec/decode.c
+++ b/modules/avcodec/decode.c
@@ -57,9 +57,18 @@ static int init_decoder(struct viddec_state *st, const char *name)
if (codec_id == AV_CODEC_ID_NONE)
return EINVAL;
- st->codec = avcodec_find_decoder(codec_id);
- if (!st->codec)
- return ENOENT;
+ /*
+ * Special handling of H.264 decoder
+ */
+ if (codec_id == AV_CODEC_ID_H264 && avcodec_h264dec) {
+ st->codec = avcodec_h264dec;
+ info("avcodec: h264 decoder activated\n");
+ }
+ else {
+ st->codec = avcodec_find_decoder(codec_id);
+ if (!st->codec)
+ return ENOENT;
+ }
#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(92<<8)+0)
st->ctx = avcodec_alloc_context3(st->codec);
@@ -212,6 +221,10 @@ static int ffdecode(struct viddec_state *st, struct vidframe *frame,
frame->fmt = VID_FMT_YUV420P;
break;
+ case AV_PIX_FMT_NV12:
+ frame->fmt = VID_FMT_NV12;
+ break;
+
default:
warning("avcodec: decode: bad pixel format"
" (%i) (%s)\n",