[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive/frameworks] /: Fix stupid crash with custom transcoding params
From:       Jean-Baptiste Mardelle <jb () kdenlive ! org>
Date:       2015-01-31 22:46:13
Message-ID: E1YHgnt-0004nz-AY () scm ! kde ! org
[Download RAW message or body]

Git commit 84856a039c66d4ecdbffb68c2d17cff9b1fd540c by Jean-Baptiste Mardelle.
Committed on 31/01/2015 at 22:46.
Pushed by mardelle into branch 'frameworks'.

Fix stupid crash with custom transcoding params

M  +1    -0    data/kdenlivetranscodingrc
M  +10   -1    src/bin/bin.cpp
M  +4    -1    src/project/dialogs/slideshowclip.cpp

http://commits.kde.org/kdenlive/84856a039c66d4ecdbffb68c2d17cff9b1fd540c

diff --git a/data/kdenlivetranscodingrc b/data/kdenlivetranscodingrc
index 852a308..87359cb 100644
--- a/data/kdenlivetranscodingrc
+++ b/data/kdenlivetranscodingrc
@@ -16,6 +16,7 @@ DNxHD 720p 59.94 fps 145 Mb/s=-s 1280x720 -r 60000/1001 -vb 145000k \
-threads 2 -  Fix MPEG-1=-sameq -acodec copy -vcodec mpeg1video %1.mpg;Fix unplayable \
MPEG-1 files;;vcodec=mpeg1video  Fix Ogg Theora=-sameq -vcodec libtheora -acodec copy \
%1.ogv;Fix unplayable OGG Theora files;;vcodec=theora  Remux MPEG-2 PS/VOB=-vcodec \
copy -acodec copy %1.mpg;Fix audio sync in MPEG-2 vob files;;vcodec=mpeg2video +Remux \
MPEG-2 PS/VOB=-vcodec copy -acodec copy %1.mpg;Fix audio sync in MPEG-2 vob files 2;  \
Lossless Matroska=-sn -vcodec huffyuv -acodec flac %1.mkv;High quality lossless \
encoding  Wav 48000Hz=-vn -ar 48000 %1.wav;Extract audio as WAV file;audio
 Remux with MKV=-vcodec copy -acodec copy -sn %1.mkv
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index 2736489..70f8df2 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -911,9 +911,18 @@ void Bin::contextMenuEvent(QContextMenuEvent *event)
                     QString condition;
                     QString audioCodec = clip->codec(true);
                     QString videoCodec = clip->codec(false);
+                    bool skipCondition = false;
+                    if (audioCodec.isEmpty() && videoCodec.isEmpty()) {
+                        skipCondition = true;
+                    }
                     for (int i = 0; i < transcodeActions.count(); ++i) {
+                        if (skipCondition) {
+                            // No audio / video codec, this is an MLT clip, skip \
conditions +                            transcodeActions.at(i)->setEnabled(true);
+                            continue;
+                        }
                         data = transcodeActions.at(i)->data().toStringList();
-                        if (data.count() > 3) {
+                        if (data.count() > 4) {
                             condition = data.at(4);
                             if (condition.startsWith("vcodec"))
                                 \
                transcodeActions.at(i)->setEnabled(condition.section('=', 1, 1) == \
                videoCodec);
diff --git a/src/project/dialogs/slideshowclip.cpp \
b/src/project/dialogs/slideshowclip.cpp index 0ad22e0..a03c1b8 100644
--- a/src/project/dialogs/slideshowclip.cpp
+++ b/src/project/dialogs/slideshowclip.cpp
@@ -288,7 +288,10 @@ QString SlideshowClip::selectedPath(const QUrl &url, bool \
isMime, QString extens  {
     QString folder;
     if (isMime) {
-        folder = url.path() + QDir::separator();
+        folder = url.path();
+        if (!folder.endsWith(QDir::separator())) {
+            folder.append(QDir::separator());
+        }
 	// Check how many files we have
         QDir dir(folder);
 	QStringList filters;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic