]> git.sesse.net Git - kdenlive/commitdiff
Fix display of aspect ratio in clip properties for mlt playlists
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 30 Sep 2012 17:18:22 +0000 (19:18 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 30 Sep 2012 17:18:22 +0000 (19:18 +0200)
src/clipproperties.cpp
src/renderer.cpp

index ad2b0c427795e0e3ed718f60c7a68c4072d59755..b0b957093871f26f662cd2dc256dd880e823c82b 100644 (file)
@@ -258,6 +258,9 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
         m_view.clip_force_vindex->setEnabled(false);
     }
 
+    if (t == PLAYLIST)
+       m_view.tabWidget->setTabText(VIDEOTAB, i18n("Playlist"));
+
     if (t == IMAGE) {
         m_view.tabWidget->removeTab(SLIDETAB);
         m_view.tabWidget->removeTab(COLORTAB);
@@ -435,7 +438,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
         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);
+        if (t == IMAGE || t == VIDEO || t == PLAYLIST) m_view.tabWidget->removeTab(AUDIOTAB);
     } else {
         m_view.tabWidget->removeTab(IMAGETAB);
         m_view.tabWidget->removeTab(SLIDETAB);
index a51ef5d4b3c11252c63f2b1c61fcfb5ad3404f04..adf391b36c74680cff70a24cea8aa1c730cddbf6 100644 (file)
@@ -885,6 +885,7 @@ void Render::processFileProperties()
            filePropertyMap["progressive"] = QString::number(original_profile->progressive());
            filePropertyMap["colorspace"] = QString::number(original_profile->colorspace());
            filePropertyMap["fps"] = QString::number(original_profile->fps());
+           filePropertyMap["aspect_ratio"] = QString::number(original_profile->sar());
            delete tmpProd;
            delete original_profile;
        }
@@ -931,10 +932,10 @@ void Render::processFileProperties()
             filePropertyMap["frame_size"] = QString::number(frame->get_int("width")) + 'x' + QString::number(frame->get_int("height"));
             filePropertyMap["frequency"] = QString::number(frame->get_int("frequency"));
             filePropertyMap["channels"] = QString::number(frame->get_int("channels"));
-            filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio");
+            if (!filePropertyMap.contains("aspect_ratio")) filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio");
 
             if (frame->get_int("test_image") == 0) {
-                if (url.path().endsWith(".mlt") || url.path().endsWith(".westley") || url.path().endsWith(".kdenlive")) {
+                if (mltService == "xml" || mltService == "consumer") {
                     filePropertyMap["type"] = "playlist";
                     metadataPropertyMap["comment"] = QString::fromUtf8(producer->get("title"));
                 } else if (frame->get_int("test_audio") == 0)