Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
bcc47ac2
Commit
bcc47ac2
authored
Nov 08, 2019
by
Jean-Baptiste Mardelle
Browse files
Minor audio thumb fixes
parent
9a10e6c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/projectitemmodel.cpp
View file @
bcc47ac2
...
...
@@ -650,8 +650,8 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &descrip
if
(
res
)
{
int
loadJob
=
pCore
->
jobManager
()
->
startJob
<
LoadJob
>
({
id
},
-
1
,
QString
(),
description
,
std
::
bind
(
readyCallBack
,
id
));
int
thumbJob
=
pCore
->
jobManager
()
->
startJob
<
ThumbJob
>
({
id
},
loadJob
,
QString
(),
150
,
0
,
true
);
pCore
->
jobManager
()
->
startJob
<
CacheJob
>
({
id
},
thumbJob
,
QString
(),
150
);
pCore
->
jobManager
()
->
startJob
<
AudioThumbJob
>
({
id
},
loadJob
,
QString
());
pCore
->
jobManager
()
->
startJob
<
CacheJob
>
({
id
},
thumbJob
,
QString
(),
150
);
}
return
res
;
}
...
...
src/jobs/audiothumbjob.cpp
View file @
bcc47ac2
...
...
@@ -117,7 +117,12 @@ bool AudioThumbJob::computeWithFFMPEG()
args
<<
QString
(
"showwavespic=s=%1x%2:split_channels=1:scale=cbrt:colors=0xffdddd|0xddffdd"
).
arg
(
m_thumbSize
.
width
()).
arg
(
m_thumbSize
.
height
());
args
<<
QStringLiteral
(
"-frames:v"
)
<<
QStringLiteral
(
"1"
);
args
<<
m_binClip
->
getAudioThumbPath
(
true
);
connect
(
m_ffmpegProcess
.
get
(),
&
QProcess
::
readyReadStandardOutput
,
this
,
&
AudioThumbJob
::
updateFfmpegProgress
);
connect
(
m_ffmpegProcess
.
get
(),
&
QProcess
::
readyReadStandardOutput
,
this
,
&
AudioThumbJob
::
updateFfmpegProgress
,
Qt
::
UniqueConnection
);
connect
(
this
,
&
AudioThumbJob
::
jobCanceled
,
[
&
]
()
{
m_ffmpegProcess
->
kill
();
m_done
=
true
;
m_successful
=
false
;
}
m_ffmpegProcess
->
start
(
KdenliveSettings
::
ffmpegpath
(),
args
);
m_ffmpegProcess
->
waitForFinished
(
-
1
);
if
(
m_ffmpegProcess
->
exitStatus
()
!=
QProcess
::
CrashExit
)
{
...
...
@@ -126,12 +131,12 @@ bool AudioThumbJob::computeWithFFMPEG()
m_done
=
true
;
return
true
;
}
else
{
// Next Processin
ĝ
step can be long, already display audio thumb in monitor
// Next Processin
g
step can be long, already display audio thumb in monitor
m_binClip
->
audioThumbReady
();
}
}
}
if
(
!
m_dataInCache
)
{
if
(
!
m_dataInCache
&&
!
m_done
)
{
m_audioLevels
.
clear
();
std
::
vector
<
std
::
unique_ptr
<
QTemporaryFile
>>
channelFiles
;
for
(
int
i
=
0
;
i
<
m_channels
;
i
++
)
{
...
...
@@ -176,6 +181,9 @@ bool AudioThumbJob::computeWithFFMPEG()
<<
QStringLiteral
(
"-f"
)
<<
QStringLiteral
(
"data"
)
<<
channelFiles
[
size_t
(
i
)]
->
fileName
();
}
}
m_ffmpegProcess
.
reset
(
new
QProcess
);
connect
(
m_ffmpegProcess
.
get
(),
&
QProcess
::
readyReadStandardOutput
,
this
,
&
AudioThumbJob
::
updateFfmpegProgress
,
Qt
::
UniqueConnection
);
connect
(
this
,
&
AudioThumbJob
::
jobCanceled
,
m_ffmpegProcess
.
get
(),
&
QProcess
::
kill
,
Qt
::
DirectConnection
);
m_ffmpegProcess
->
start
(
KdenliveSettings
::
ffmpegpath
(),
args
);
m_ffmpegProcess
->
waitForFinished
(
-
1
);
if
(
m_ffmpegProcess
->
exitStatus
()
!=
QProcess
::
CrashExit
)
{
...
...
@@ -262,7 +270,6 @@ bool AudioThumbJob::startJob()
}
m_dataInCache
=
false
;
m_thumbInCache
=
false
;
m_thumbSize
=
QSize
(
1000
,
1000
/
pCore
->
getCurrentDar
());
m_binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
m_clipId
);
if
(
m_binClip
->
audioChannels
()
==
0
||
m_binClip
->
audioThumbCreated
())
{
// nothing to do
...
...
@@ -270,6 +277,7 @@ bool AudioThumbJob::startJob()
m_successful
=
true
;
return
true
;
}
m_thumbSize
=
QSize
(
1000
,
1000
/
pCore
->
getCurrentDar
());
m_prod
=
m_binClip
->
originalProducer
();
m_frequency
=
m_binClip
->
audioInfo
()
->
samplingRate
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment