*/
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
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;
return;
}
- int width = (int)(imageHeight * m_mltProfile->dar());
+ int width = (int)(imageHeight * m_mltProfile->dar() + 0.5);
QMap < QString, QString > filePropertyMap;
QMap < QString, QString > metadataPropertyMap;
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);
+ QPixmap pix(frame_width, frame_height);
if (!image.isNull()) {
pix = QPixmap::fromImage(image.rgbSwapped());
filePropertyMap["type"] = "audio";
}
}
-
+ delete frame;
// 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();
- delete frame;
// FIXME: should delete this to avoid a leak...
//delete producer;
}