Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
655474c3
Commit
655474c3
authored
Jun 02, 2009
by
Hugo Beauzee-Luyssen
Browse files
Now the end of a track is correctly handled
parent
984ca291
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Workflow/ClipWorkflow.cpp
View file @
655474c3
...
...
@@ -116,8 +116,6 @@ void ClipWorkflow::unlock( ClipWorkflow* cw )
cw
->
m_usingBackBuffer
=
!
cw
->
m_usingBackBuffer
;
}
}
else
qDebug
()
<<
cw
->
m_state
;
cw
->
m_stateLock
->
unlock
();
cw
->
checkStateChange
();
}
...
...
src/Workflow/TrackWorkflow.cpp
View file @
655474c3
...
...
@@ -112,6 +112,11 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi
cw
->
getStateLock
()
->
unlock
();
cw
->
startRender
();
}
else
if
(
cw
->
getState
()
==
ClipWorkflow
::
EndReached
)
{
cw
->
getStateLock
()
->
unlock
();
//The stopClipWorkflow() method will take care of that.
}
else
{
// qDebug() << "Unexpected ClipWorkflow::State when rendering:" << cw->getState();
...
...
@@ -174,6 +179,16 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
}
}
bool
TrackWorkflow
::
checkEnd
(
qint64
currentFrame
)
const
{
if
(
m_clips
.
size
()
==
0
)
return
true
;
//This is the last video by chronological order :
QMap
<
qint64
,
ClipWorkflow
*>::
const_iterator
it
=
m_clips
.
end
()
-
1
;
//If it ends before the current frame, we reached end.
return
(
it
.
value
()
->
getClip
()
->
getLength
()
+
it
.
key
()
<
currentFrame
);
}
unsigned
char
*
TrackWorkflow
::
getOutput
(
qint64
currentFrame
)
{
unsigned
char
*
ret
=
TrackWorkflow
::
blackOutput
;
...
...
@@ -182,6 +197,11 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
static
qint64
lastFrame
=
0
;
bool
needRepositioning
;
if
(
checkEnd
(
currentFrame
)
==
true
)
{
emit
trackEndReached
();
//We continue, as there can be ClipWorkflow that required to be stopped.
}
needRepositioning
=
(
abs
(
currentFrame
-
lastFrame
)
>
1
)
?
true
:
false
;
while
(
it
!=
end
)
{
...
...
src/Workflow/TrackWorkflow.h
View file @
655474c3
...
...
@@ -58,6 +58,7 @@ class TrackWorkflow : public QObject
unsigned
char
*
renderClip
(
ClipWorkflow
*
cw
,
bool
needRepositioning
,
float
pos
);
void
preloadClip
(
ClipWorkflow
*
cw
);
void
stopClipWorkflow
(
ClipWorkflow
*
cw
);
bool
checkEnd
(
qint64
currentFrame
)
const
;
private:
QMap
<
qint64
,
ClipWorkflow
*>
m_clips
;
...
...
src/gui/RenderPreviewWidget.cpp
View file @
655474c3
...
...
@@ -79,7 +79,6 @@ void RenderPreviewWidget::stopPreview()
//This might be called multiple times, but this is due to Qt message loop
m_mediaPlayer
->
stop
();
m_isRendering
=
false
;
qDebug
()
<<
"Stopped"
;
}
void
RenderPreviewWidget
::
startPreview
(
Media
*
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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