svn path=/trunk/kdenlive/; revision=3449
m_view.clip_fps->setText(props.value("fps"));
if (props.contains("aspect_ratio"))
m_view.clip_ratio->setText(props.value("aspect_ratio"));
m_view.clip_fps->setText(props.value("fps"));
if (props.contains("aspect_ratio"))
m_view.clip_ratio->setText(props.value("aspect_ratio"));
-
- QPixmap pix = m_clip->thumbProducer()->getImage(url, m_clip->getClipThumbFrame(), 240, 180);
+ int width = 180.0 * KdenliveSettings::project_display_ratio();
+ if (width % 2 == 1) width++;
+ QPixmap pix = m_clip->thumbProducer()->getImage(url, m_clip->getClipThumbFrame(), width, 180);
m_view.clip_thumb->setPixmap(pix);
if (t == IMAGE || t == VIDEO) m_view.tabWidget->removeTab(AUDIOTAB);
} else {
m_view.clip_thumb->setPixmap(pix);
if (t == IMAGE || t == VIDEO) m_view.tabWidget->removeTab(AUDIOTAB);
} else {
delete[] tmp;
if (producer->is_blank() == false) {
delete[] tmp;
if (producer->is_blank() == false) {
- pix = KThumb::getFrame(producer, 0, 60, 45);
+ int width = 45.0 * profile.dar();
+ if (width % 2 == 1) width++;
+ pix = KThumb::getFrame(producer, 0, width, 45);
item->setIcon(0, pix);
int playTime = producer->get_playtime();
item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
item->setIcon(0, pix);
int playTime = producer->get_playtime();
item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
delete[] tmp;
if (producer->is_blank() == false) {
delete[] tmp;
if (producer->is_blank() == false) {
- //pix = KThumb::getFrame(producer, 0, 180, 135);
+ //pix = KThumb::getFrame(producer, 0, 135 * profile.dar(), 135);
//item->setIcon(0, pix);
item->setText(1, Timecode::getStringTimecode(producer->get_playtime(), profile.fps()));
}
//item->setIcon(0, pix);
item->setText(1, Timecode::getStringTimecode(producer->get_playtime(), profile.fps()));
}
//static
QPixmap KThumb::getImage(KUrl url, int frame, int width, int height)
{
//static
QPixmap KThumb::getImage(KUrl url, int frame, int width, int height)
{
- Mlt::Profile profile((char*) KdenliveSettings::current_profile().data());
+ char *tmp = Render::decodedString(KdenliveSettings::current_profile());
+ Mlt::Profile profile(tmp);
+ delete[] tmp;
QPixmap pix(width, height);
if (url.isEmpty()) return pix;
QPixmap pix(width, height);
if (url.isEmpty()) return pix;
- char *tmp = Render::decodedString(url.path());
+ tmp = Render::decodedString(url.path());
//"<mlt><playlist><producer resource=\"" + url.path() + "\" /></playlist></mlt>");
//Mlt::Producer producer(profile, "xml-string", tmp);
Mlt::Producer *producer = new Mlt::Producer(profile, tmp);
//"<mlt><playlist><producer resource=\"" + url.path() + "\" /></playlist></mlt>");
//Mlt::Producer producer(profile, "xml-string", tmp);
Mlt::Producer *producer = new Mlt::Producer(profile, tmp);
//char *tmp = doc.toString().toUtf8().data();
m_producer = new Mlt::Producer(*m_profile, "xml-string", doc.toString().toUtf8().data());
//delete[] tmp;
//char *tmp = doc.toString().toUtf8().data();
m_producer = new Mlt::Producer(*m_profile, "xml-string", doc.toString().toUtf8().data());
//delete[] tmp;
-
- QPixmap p((int)(100 * m_dar), 100);
+ int width = 100.0 * m_dar;
+ if (width % 2 == 1) width++;
+ QPixmap p(width, 100);
QString colour = clip->getProperty("colour");
switch (m_clip->clipType()) {
case VIDEO:
QString colour = clip->getProperty("colour");
switch (m_clip->clipType()) {
case VIDEO:
connect(this, SIGNAL(updateThumb()), m_previewTimer, SLOT(start()));
case IMAGE:
case TEXT:
connect(this, SIGNAL(updateThumb()), m_previewTimer, SLOT(start()));
case IMAGE:
case TEXT:
- p = KThumb::getFrame(m_producer, t.time().frames(m_fps), (int)(100 * m_dar), 100);
+ p = KThumb::getFrame(m_producer, t.time().frames(m_fps), width, 100);
break;
case COLOR:
colour = colour.replace(0, 2, "#");
break;
case COLOR:
colour = colour.replace(0, 2, "#");
{
m_previewTimer->stop();
int pos = m_tc.getFrameCount(m_view.marker_position->text(), m_fps);
{
m_previewTimer->stop();
int pos = m_tc.getFrameCount(m_view.marker_position->text(), m_fps);
- QPixmap p = KThumb::getFrame(m_producer, pos, (int)(100 * m_dar), 100);
+ int width = 100.0 * m_dar;
+ if (width % 2 == 1) width++;
+ QPixmap p = KThumb::getFrame(m_producer, pos, width, 100);
if (!p.isNull()) m_view.clip_thumb->setPixmap(p);
else kDebug() << "!!!!!!!!!!! ERROR CREATING THUMB";
}
if (!p.isNull()) m_view.clip_thumb->setPixmap(p);
else kDebug() << "!!!!!!!!!!! ERROR CREATING THUMB";
}
if (width == -1) {
width = renderWidth();
height = renderHeight();
if (width == -1) {
width = renderWidth();
height = renderHeight();
+ } else if (width % 2 == 1) width++;
QPixmap pix(width, height);
if (!m_mltProducer) {
pix.fill(Qt::black);
QPixmap pix(width, height);
if (!m_mltProducer) {
pix.fill(Qt::black);