Commit e5d0b088 authored by Dean Liao's avatar Dean Liao Committed by Commit Bot

media/base: Fix VideoFrame::WrapVideoFrame().

WrapVideoFrame() currenlty copy data() regardless if source frame is
mappable or not. This is incorrect, it should copy data() when source
frame is mappable.

BUG=None
TEST=None

Change-Id: I2f6005114bbaef78c6facc20d431940a77780e81
Reviewed-on: https://chromium-review.googlesource.com/c/1352126Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Shuo-Peng Liao <deanliao@google.com>
Cr-Commit-Position: refs/heads/master@{#612107}
parent 3b3750ef
...@@ -599,9 +599,11 @@ scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame( ...@@ -599,9 +599,11 @@ scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame(
// Copy all metadata to the wrapped frame. // Copy all metadata to the wrapped frame.
wrapping_frame->metadata()->MergeMetadataFrom(frame->metadata()); wrapping_frame->metadata()->MergeMetadataFrom(frame->metadata());
if (frame->IsMappable()) {
for (size_t i = 0; i < NumPlanes(format); ++i) { for (size_t i = 0; i < NumPlanes(format); ++i) {
wrapping_frame->data_[i] = frame->data(i); wrapping_frame->data_[i] = frame->data(i);
} }
}
#if defined(OS_LINUX) #if defined(OS_LINUX)
// If there are any |dmabuf_fds_| plugged in, we should duplicate them. // If there are any |dmabuf_fds_| plugged in, we should duplicate them.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment