Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-20 19:15:39 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-06-20 19:15:39 +0400
commitc2b1225c16f14a23a89c3eedbae51e6bc5667bc8 (patch)
tree9583a2d158a75ff29105beb85388c4cc01157d40 /libavcodec/dvenc.c
parentafa7ab557a801d54a4c3dbab38350f858efbbd5f (diff)
parent778111592bf5f38630858ee6dfcfd097cd6c6da9 (diff)
Merge commit '778111592bf5f38630858ee6dfcfd097cd6c6da9'
* commit '778111592bf5f38630858ee6dfcfd097cd6c6da9': dvenc: initialize the profile only once, at init Conflicts: libavcodec/dvenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvenc.c')
-rw-r--r--libavcodec/dvenc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 052b631863..06acf18e76 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -35,7 +35,11 @@
static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
{
- if (!avpriv_dv_codec_profile(avctx)) {
+ DVVideoContext *s = avctx->priv_data;
+ int ret;
+
+ s->sys = avpriv_dv_codec_profile(avctx);
+ if (!s->sys) {
av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. "
"Valid DV profiles are:\n",
avctx->width, avctx->height, av_get_pix_fmt_name(avctx->pix_fmt));
@@ -46,6 +50,11 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "DVCPRO HD encoding is not supported.\n");
return AVERROR_PATCHWELCOME;
}
+ ret = ff_dv_init_dynamic_tables(s->sys);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Error initializing work tables.\n");
+ return ret;
+ }
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
@@ -665,9 +674,6 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
DVVideoContext *s = c->priv_data;
int ret;
- s->sys = avpriv_dv_codec_profile(c);
- if (!s->sys || ff_dv_init_dynamic_tables(s->sys))
- return -1;
if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size)) < 0)
return ret;