svn path=/trunk/kdenlive/; revision=4358
void KThumb::doGetThumbs()
{
void KThumb::doGetThumbs()
{
- const int twidth = (int)(KdenliveSettings::trackheight() * m_dar);
const int theight = KdenliveSettings::trackheight();
const int theight = KdenliveSettings::trackheight();
+ const int twidth = (int)(theight * m_dar + 0.5);
while (!m_requestedThumbs.isEmpty()) {
int frame = m_requestedThumbs.takeFirst();
while (!m_requestedThumbs.isEmpty()) {
int frame = m_requestedThumbs.takeFirst();
painter->setPen(option.palette.highlightedText().color());
}
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
painter->setPen(option.palette.highlightedText().color());
}
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
- QPixmap pixmap = index.data(Qt::DecorationRole).value<QPixmap>();
+ QPixmap pixmap = qVariantValue<QPixmap>(index.data(Qt::DecorationRole));
if ((index.flags() & (Qt::ItemIsDragEnabled)) == false) {
KIcon icon("dialog-close");
QPainter p(&pixmap);
if ((index.flags() & (Qt::ItemIsDragEnabled)) == false) {
KIcon icon("dialog-close");
QPainter p(&pixmap);
- QPoint point(r1.left() + textMargin, r1.top() + (r1.height() - pixmap.height()) / 2);
- painter->drawPixmap(point, pixmap);
+ painter->drawPixmap(r1.left() + textMargin, r1.top() + (r1.height() - pixmap.height()) / 2, pixmap);
int decoWidth = pixmap.width() + 2 * textMargin;
QFont font = painter->font();
int decoWidth = pixmap.width() + 2 * textMargin;
QFont font = painter->font();
*/
int Render::renderWidth() const
{
*/
int Render::renderWidth() const
{
- return (int)(m_mltProfile->height() * m_mltProfile->dar());
+ return (int)(m_mltProfile->height() * m_mltProfile->dar() + 0.5);
}
int Render::renderHeight() const
}
int Render::renderHeight() const
char *tmp = decodedString("kdenlivetitle:" + xml.attribute("resource"));
producer = new Mlt::Producer(*m_mltProfile, 0, tmp);
delete[] tmp;
char *tmp = decodedString("kdenlivetitle:" + xml.attribute("resource"));
producer = new Mlt::Producer(*m_mltProfile, 0, tmp);
delete[] tmp;
- if (xml.hasAttribute("xmldata")) {
+ if (producer && xml.hasAttribute("xmldata")) {
char *tmp = decodedString(xml.attribute("xmldata"));
producer->set("xmldata", tmp);
delete[] tmp;
char *tmp = decodedString(xml.attribute("xmldata"));
producer->set("xmldata", tmp);
delete[] tmp;
- int width = (int)(imageHeight * m_mltProfile->dar());
+ int width = (int)(imageHeight * m_mltProfile->dar() + 0.5);
QMap < QString, QString > filePropertyMap;
QMap < QString, QString > metadataPropertyMap;
QMap < QString, QString > filePropertyMap;
QMap < QString, QString > metadataPropertyMap;
mlt_image_format format = mlt_image_rgb24a;
int frame_width = width;
int frame_height = imageHeight;
mlt_image_format format = mlt_image_rgb24a;
int frame_width = width;
int frame_height = imageHeight;
- QPixmap pix(width, imageHeight);
uint8_t *data = frame->get_image(format, frame_width, frame_height, 0);
QImage image((uchar *)data, frame_width, frame_height, QImage::Format_ARGB32);
uint8_t *data = frame->get_image(format, frame_width, frame_height, 0);
QImage image((uchar *)data, frame_width, frame_height, QImage::Format_ARGB32);
+ QPixmap pix(frame_width, frame_height);
if (!image.isNull()) {
pix = QPixmap::fromImage(image.rgbSwapped());
if (!image.isNull()) {
pix = QPixmap::fromImage(image.rgbSwapped());
filePropertyMap["type"] = "audio";
}
}
filePropertyMap["type"] = "audio";
}
}
// Retrieve audio / video codec name
// If there is a
// Retrieve audio / video codec name
// If there is a
producer->seek(0);
emit replyGetFileProperties(clipId, producer, filePropertyMap, metadataPropertyMap, replaceProducer);
kDebug() << "REquested fuile info for: " << url.path();
producer->seek(0);
emit replyGetFileProperties(clipId, producer, filePropertyMap, metadataPropertyMap, replaceProducer);
kDebug() << "REquested fuile info for: " << url.path();
// FIXME: should delete this to avoid a leak...
//delete producer;
}
// FIXME: should delete this to avoid a leak...
//delete producer;
}