summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-01 13:35:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-01 13:39:31 +0200
commit0ccfcb0638be99d1fc2c2c1dea6850b3b257ae01 (patch)
tree704e2d18e4ba8862bd143cd625f4f605ac550727 /libavcodec
parent6e8e9f1e517ee52fe439f3e8ca762f09d235f21e (diff)
parenteb800f120d2d42590fde2302fe828c847e41e773 (diff)
Merge commit 'eb800f120d2d42590fde2302fe828c847e41e773'
* commit 'eb800f120d2d42590fde2302fe828c847e41e773': libavcodec: set AVFrame colorspace fields on decoding Conflicts: libavcodec/utils.c See: a80e622924c89df69fb1c225ba432fe12fe6648e Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 641d3c4c67..e1301b0875 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -785,15 +785,21 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
}
frame->reordered_opaque = avctx->reordered_opaque;
+#if FF_API_AVFRAME_COLORSPACE
+ frame->color_primaries = avctx->color_primaries;
+ frame->color_trc = avctx->color_trc;
+ if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED)
+ av_frame_set_colorspace(frame, avctx->colorspace);
+ if (av_frame_get_color_range(frame) == AVCOL_RANGE_UNSPECIFIED)
+ av_frame_set_color_range(frame, avctx->color_range);
+ frame->chroma_location = avctx->chroma_sample_location;
+#endif
+
switch (avctx->codec->type) {
case AVMEDIA_TYPE_VIDEO:
frame->format = avctx->pix_fmt;
if (!frame->sample_aspect_ratio.num)
frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
- if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED)
- av_frame_set_colorspace(frame, avctx->colorspace);
- if (av_frame_get_color_range(frame) == AVCOL_RANGE_UNSPECIFIED)
- av_frame_set_color_range(frame, avctx->color_range);
break;
case AVMEDIA_TYPE_AUDIO:
if (!frame->sample_rate)