[mythtv-commits] Ticket #1079: frame corruption in preview playbackbox
MythTV
mythtv at cvs.mythtv.org
Wed Jan 25 17:31:55 UTC 2006
#1079: frame corruption in preview playbackbox
----------------------------------------+-----------------------------------
Reporter: jwestfall at surrealistic.net | Owner: ijr
Type: defect | Status: reopened
Priority: minor | Milestone: 0.20
Component: mythtv | Version: head
Severity: low | Resolution:
----------------------------------------+-----------------------------------
Changes (by jwestfall at surrealistic.net):
* resolution: worksforme =>
* status: closed => reopened
Comment:
The issue is with the video preview not the static pixmap. The code in
PlaybackBox::updateVideo is doing
{{{
VideoFrame *frame = nvp->GetCurrentFrame(w, h);
if (w == 0 || h == 0 || !frame || !(frame->buf))
{
nvp->ReleaseCurrentFrame(frame);
return;
}
unsigned char *yuv_buf = frame->buf;
if (conv_rgba_size.width() != w || conv_rgba_size.height() != h)
{
if (conv_rgba_buf)
delete [] conv_rgba_buf;
conv_rgba_buf = new unsigned char[w * h * 4];
conv_rgba_size = QSize(w, h);
}
conv_yuv2rgba(conv_rgba_buf,
yuv_buf, yuv_buf + (w * h), yuv_buf + (w * h * 5 /
4),
w, h, w * 4, w, w / 2, 0);
nvp->ReleaseCurrentFrame(frame);
QImage img(conv_rgba_buf, w, h, 32, NULL, 65536 * 65536,
QImage::LittleEndian);
img = img.scale(videoRect.width(), videoRect.height());
p->drawImage(videoRect.x(), videoRect.y(), img);
}
}}}
for each frame to be displayed in the preview video box. There is no
locking on the frame and frame->buf is being passed to conv_yuv2rgba().
This leaves the decoder thread open to overwrite frame->buf while its
being processed by yuv2rgba(). It may not be noticeable in the mmx
version of yuv2rgba(), but you can definitely see the issue in the c
version which is ultra slow.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/1079>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list