diff options
author | Tomas Härdin <Tomas.hardin@codemill.se> | 2009-12-12 02:56:49 +0300 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2009-12-12 02:56:49 +0300 |
commit | 6d01a97c864a1d7e087b7669caf1df0a6e2caf99 (patch) | |
tree | 584caa2ce703d04ac3548e95708945dc4ed6f404 /libavcodec/dv.c | |
parent | 47a81dad922c8c434087de4901306530a99dbaea (diff) |
Fail earlier for unsupported resolutions or pixel formats when encoding
dv.
Patch by Tomas Härdin, tomas D hardin A codemill D se
Originally committed as revision 20803 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dv.c')
-rw-r--r-- | libavcodec/dv.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 91b1c80522..1219bf1070 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -398,6 +398,17 @@ static av_cold int dvvideo_init(AVCodecContext *avctx) return 0; } +static av_cold int dvvideo_init_encoder(AVCodecContext *avctx) +{ + if (!ff_dv_codec_profile(avctx)) { + av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video\n", + avctx->width, avctx->height, avcodec_get_pix_fmt_name(avctx->pix_fmt)); + return -1; + } + + return dvvideo_init(avctx); +} + // #define VLC_DEBUG // #define printf(...) av_log(NULL, AV_LOG_ERROR, __VA_ARGS__) @@ -1326,7 +1337,7 @@ AVCodec dvvideo_encoder = { CODEC_TYPE_VIDEO, CODEC_ID_DVVIDEO, sizeof(DVVideoContext), - dvvideo_init, + dvvideo_init_encoder, dvvideo_encode_frame, .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), |