diff mbox

[FFmpeg-devel,1/2] lavu/frame: fix inconsistent qp_table_buf deprecation

Message ID 20180301155822.30477-1-nfxjfg@googlemail.com
State Accepted
Commit 36855abc0eb96d5caa992304f3417a0f8a62960c
Headers show

Commit Message

wm4 March 1, 2018, 3:58 p.m. UTC
Everything related to the QP data is deprecated, with qp_table_buf being
an inconsistent exception. Some parts were under the deprecation guards,
some not. It probably didn't even compile.
---
 libavutil/frame.c | 7 ++++---
 libavutil/frame.h | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 662a7e5ab5..3ecd739317 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -53,11 +53,10 @@  MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range)
 #if FF_API_FRAME_QP
 int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
 {
+FF_DISABLE_DEPRECATION_WARNINGS
     av_buffer_unref(&f->qp_table_buf);
 
     f->qp_table_buf = buf;
-
-FF_DISABLE_DEPRECATION_WARNINGS
     f->qscale_table = buf->data;
     f->qstride      = stride;
     f->qscale_type  = qp_type;
@@ -71,12 +70,12 @@  int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
 FF_DISABLE_DEPRECATION_WARNINGS
     *stride = f->qstride;
     *type   = f->qscale_type;
-FF_ENABLE_DEPRECATION_WARNINGS
 
     if (!f->qp_table_buf)
         return NULL;
 
     return f->qp_table_buf->data;
+FF_ENABLE_DEPRECATION_WARNINGS
 }
 #endif
 
@@ -523,7 +522,9 @@  void av_frame_unref(AVFrame *frame)
     av_freep(&frame->extended_buf);
     av_dict_free(&frame->metadata);
 #if FF_API_FRAME_QP
+FF_DISABLE_DEPRECATION_WARNINGS
     av_buffer_unref(&frame->qp_table_buf);
+FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
     av_buffer_unref(&frame->hw_frames_ctx);
diff --git a/libavutil/frame.h b/libavutil/frame.h
index d54bd9a354..4c3225b8bd 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -529,6 +529,7 @@  typedef struct AVFrame {
     attribute_deprecated
     int qscale_type;
 
+    attribute_deprecated
     AVBufferRef *qp_table_buf;
 #endif
     /**