---
libavcodec/options_table.h | 2 ++
libavcodec/utils.c | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 1006a86..498c38a 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -58,7 +58,9 @@ static const AVOption avcodec_options[] = {
{"pass1", "use internal 2-pass ratecontrol in first pass mode", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 =
CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
+#if FF_API_EMU_EDGE
{"emu_edge", "do not draw edges", 0, AV_OPT_TYPE_CONST, {.i64 =
CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"},
+#endif
{"psnr", "error[?] variables will be set during encoding", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
{"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_TRUNCATED },
INT_MIN, INT_MAX, 0, "flags"},
{"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.i64 =
CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c88b346..39bd6ba 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -343,10 +343,12 @@ static int update_frame_pool(AVCodecContext *avctx,
AVFrame *frame)
avcodec_align_dimensions2(avctx, &w, &h, pool->stride_align);
+#if FF_API_EMU_EDGE
if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
w += EDGE_WIDTH * 2;
h += EDGE_WIDTH * 2;
}
+#endif
do {
// NOTE: do not align linesizes individually, this breaks e.g.
assumptions
@@ -496,8 +498,12 @@ static int video_get_buffer(AVCodecContext *s, AVFrame
*pic)
if (!pic->buf[i])
goto fail;
+#if FF_API_EMU_EDGE
// no edge if EDGE EMU or not planar YUV
if ((s->flags & CODEC_FLAG_EMU_EDGE) || !pool->pools[2])
+#else
+ if (!pool->pools[2])
+#endif
pic->data[i] = pic->buf[i]->data;
else {
pic->data[i] = pic->buf[i]->data +
@@ -528,7 +534,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx,
AVFrame *frame, int flags
if ((ret = update_frame_pool(avctx, frame)) < 0)
return ret;
-#if FF_API_GET_BUFFER
+#if FF_API_GET_BUFFER && FF_API_AVFRAME_LAVC
FF_DISABLE_DEPRECATION_WARNINGS
frame->type = FF_BUFFER_TYPE_INTERNAL;
FF_ENABLE_DEPRECATION_WARNINGS
@@ -640,8 +646,10 @@ FF_DISABLE_DEPRECATION_WARNINGS
AVBufferRef *dummy_buf = NULL;
int planes, i, ret;
+#if FF_API_AVFRAME_LAVC
if (flags & AV_GET_BUFFER_FLAG_REF)
frame->reference = 1;
+#endif
ret = avctx->get_buffer(avctx, frame);
if (ret < 0)
--
1.8.3.4 (Apple Git-47)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel