diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/012v.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/012v.c')
| -rw-r--r-- | ffmpeg/libavcodec/012v.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ffmpeg/libavcodec/012v.c b/ffmpeg/libavcodec/012v.c index 58e3cd6..c2b6a35 100644 --- a/ffmpeg/libavcodec/012v.c +++ b/ffmpeg/libavcodec/012v.c @@ -49,6 +49,12 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n"); return AVERROR_INVALIDDATA; } + + if ( avctx->codec_tag == MKTAG('0', '1', '2', 'v') + && avpkt->size % avctx->height == 0 + && avpkt->size / avctx->height * 3 >= width * 8) + stride = avpkt->size / avctx->height; + if (avpkt->size < avctx->height * stride) { av_log(avctx, AV_LOG_ERROR, "Packet too small: %d instead of %d\n", avpkt->size, avctx->height * stride); @@ -144,10 +150,10 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data, AVCodec ff_zero12v_decoder = { .name = "012v", + .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_012V, .init = zero12v_decode_init, .decode = zero12v_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), }; |
