From kde-commits Sat Jan 31 22:46:13 2015 From: Jean-Baptiste Mardelle Date: Sat, 31 Jan 2015 22:46:13 +0000 To: kde-commits Subject: [kdenlive/frameworks] /: Fix stupid crash with custom transcoding params Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=142274438421122 Git commit 84856a039c66d4ecdbffb68c2d17cff9b1fd540c by Jean-Baptiste Mardel= le. 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=3D-s 1280x720 -r 60000/1001= -vb 145000k -threads 2 - Fix MPEG-1=3D-sameq -acodec copy -vcodec mpeg1video %1.mpg;Fix unplayable = MPEG-1 files;;vcodec=3Dmpeg1video Fix Ogg Theora=3D-sameq -vcodec libtheora -acodec copy %1.ogv;Fix unplayab= le OGG Theora files;;vcodec=3Dtheora Remux MPEG-2 PS/VOB=3D-vcodec copy -acodec copy %1.mpg;Fix audio sync in M= PEG-2 vob files;;vcodec=3Dmpeg2video +Remux MPEG-2 PS/VOB=3D-vcodec copy -acodec copy %1.mpg;Fix audio sync in M= PEG-2 vob files 2; Lossless Matroska=3D-sn -vcodec huffyuv -acodec flac %1.mkv;High quality l= ossless encoding Wav 48000Hz=3D-vn -ar 48000 %1.wav;Extract audio as WAV file;audio Remux with MKV=3D-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 =3D clip->codec(true); QString videoCodec =3D clip->codec(false); + bool skipCondition =3D false; + if (audioCodec.isEmpty() && videoCodec.isEmpty()) { + skipCondition =3D true; + } for (int i =3D 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 =3D transcodeActions.at(i)->data().toStringLi= st(); - if (data.count() > 3) { + if (data.count() > 4) { condition =3D data.at(4); if (condition.startsWith("vcodec")) transcodeActions.at(i)->setEnabled(conditi= on.section('=3D', 1, 1) =3D=3D videoCodec); diff --git a/src/project/dialogs/slideshowclip.cpp b/src/project/dialogs/sl= ideshowclip.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, b= ool isMime, QString extens { QString folder; if (isMime) { - folder =3D url.path() + QDir::separator(); + folder =3D url.path(); + if (!folder.endsWith(QDir::separator())) { + folder.append(QDir::separator()); + } // Check how many files we have QDir dir(folder); QStringList filters;