History

Merge commit 'eb800f120d2d42590fde2302fe828c847e41e773'

* commit 'eb800f120d2d42590fde2302fe828c847e41e773': libavcodec: set AVFrame colorspace fields on decoding Conflicts: libavcodec/utils.c

Michael Niedermayer committed 12 years ago

Commit 0ccfcb02 parents 6e8e9f1 eb800f11 file · +10 −4Browse files

Unified · Split

libavcodec/utils.c+10−4
@@ -785,15 +785,21 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) · 784 unmodified lines
785 }785 }
786 frame->reordered_opaque = avctx->reordered_opaque;786 frame->reordered_opaque = avctx->reordered_opaque;
787 787
788#if FF_API_AVFRAME_COLORSPACE
789 frame->color_primaries = avctx->color_primaries;
790 frame->color_trc = avctx->color_trc;
791 if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED)
792 av_frame_set_colorspace(frame, avctx->colorspace);
793 if (av_frame_get_color_range(frame) == AVCOL_RANGE_UNSPECIFIED)
794 av_frame_set_color_range(frame, avctx->color_range);
795 frame->chroma_location = avctx->chroma_sample_location;
796#endif
797
788 switch (avctx->codec->type) {798 switch (avctx->codec->type) {
789 case AVMEDIA_TYPE_VIDEO:799 case AVMEDIA_TYPE_VIDEO:
790 frame->format = avctx->pix_fmt;800 frame->format = avctx->pix_fmt;
791 if (!frame->sample_aspect_ratio.num)801 if (!frame->sample_aspect_ratio.num)
792 frame->sample_aspect_ratio = avctx->sample_aspect_ratio;802 frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
793 if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED)
794 av_frame_set_colorspace(frame, avctx->colorspace);
795 if (av_frame_get_color_range(frame) == AVCOL_RANGE_UNSPECIFIED)
796 av_frame_set_color_range(frame, avctx->color_range);
797 break;803 break;
798 case AVMEDIA_TYPE_AUDIO:804 case AVMEDIA_TYPE_AUDIO:
799 if (!frame->sample_rate)805 if (!frame->sample_rate)

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