History

lavu/frame: fix inconsistent qp_table_buf deprecation

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.

wm4 committed 8 years ago

Commit 36855ab1 parent f19b0c62 files · +5 −3Browse files

Unified · Split

2 files
  1. libavutil/frame.c +4 −3
  2. libavutil/frame.h +1 −0
libavutil/frame.c+4−3
@@ -48,11 +48,10 @@ MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range) · 47 unmodified lines
4848 #if FF_API_FRAME_QP
4949 int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
5050 {
51+FF_DISABLE_DEPRECATION_WARNINGS
5152 av_buffer_unref(&f->qp_table_buf);
5253
5354 f->qp_table_buf = buf;
54−
55−FF_DISABLE_DEPRECATION_WARNINGS
5655 f->qscale_table = buf->data;
5756 f->qstride = stride;
5857 f->qscale_type = qp_type;
@@ -66,12 +65,12 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type) · 7 unmodified lines
6665 FF_DISABLE_DEPRECATION_WARNINGS
6766 *stride = f->qstride;
6867 *type = f->qscale_type;
69−FF_ENABLE_DEPRECATION_WARNINGS
7068
7169 if (!f->qp_table_buf)
7270 return NULL;
7371
7472 return f->qp_table_buf->data;
73+FF_ENABLE_DEPRECATION_WARNINGS
7574 }
7675 #endif
7776
@@ -520,7 +519,9 @@ void av_frame_unref(AVFrame *frame) · 442 unmodified lines
520519 av_freep(&frame->extended_buf);
521520 av_dict_free(&frame->metadata);
522521 #if FF_API_FRAME_QP
522+FF_DISABLE_DEPRECATION_WARNINGS
523523 av_buffer_unref(&frame->qp_table_buf);
524+FF_ENABLE_DEPRECATION_WARNINGS
524525 #endif
525526
526527 av_buffer_unref(&frame->hw_frames_ctx);
libavutil/frame.h+1−0
@@ -529,6 +529,7 @@ typedef struct AVFrame { · 528 unmodified lines
529529 attribute_deprecated
530530 int qscale_type;
531531
532+ attribute_deprecated
532533 AVBufferRef *qp_table_buf;
533534 #endif
534535 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t