Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
50ad682e
Commit
50ad682e
authored
Sep 21, 2009
by
Hugo Beauzee-Luyssen
Browse files
Solving a repositionning bug when begin is != 0
parent
a2cfb26c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/LibVLCpp/VLCInstance.cpp
View file @
50ad682e
...
...
@@ -30,7 +30,7 @@ Instance::Instance()
{
char
const
*
argv
[]
=
{
"-vvvvv"
,
//
"-vvvvv",
"--no-skip-frames"
,
// "--intf", "dummy",
"--text-renderer"
,
"dummy"
,
...
...
src/LibVLCpp/VLCMediaPlayer.cpp
View file @
50ad682e
...
...
@@ -153,6 +153,7 @@ qint64 MediaPlayer::getTime()
void
MediaPlayer
::
setTime
(
qint64
time
)
{
qDebug
()
<<
"Setting time:"
<<
time
;
libvlc_media_player_set_time
(
m_internalPtr
,
time
,
m_ex
);
CheckVlcppException
(
m_ex
);
}
...
...
src/Workflow/ClipWorkflow.cpp
View file @
50ad682e
...
...
@@ -162,29 +162,27 @@ void ClipWorkflow::initialize()
m_mediaPlayer
->
setMedia
(
m_vlcMedia
);
qDebug
()
<<
"Associating media to media player"
;
connect
(
m_mediaPlayer
,
SIGNAL
(
playing
()
),
this
,
SLOT
(
setPosition
AfterPlayback
()
),
Qt
::
DirectConnection
);
connect
(
m_mediaPlayer
,
SIGNAL
(
playing
()
),
this
,
SLOT
(
pause
AfterPlayback
Started
()
),
Qt
::
DirectConnection
);
connect
(
m_mediaPlayer
,
SIGNAL
(
endReached
()
),
this
,
SLOT
(
clipEndReached
()
),
Qt
::
DirectConnection
);
qDebug
()
<<
"Starting playback"
;
m_mediaPlayer
->
play
();
}
//FIXME: this step is probably useless, due to modification in the TrackWorkflow
void
ClipWorkflow
::
setPositionAfterPlayback
()
{
disconnect
(
m_mediaPlayer
,
SIGNAL
(
playing
()
),
this
,
SLOT
(
setPositionAfterPlayback
()
)
);
connect
(
m_mediaPlayer
,
SIGNAL
(
timeChanged
()
),
this
,
SLOT
(
pauseAfterPlaybackStarted
()
),
Qt
::
DirectConnection
);
m_mediaPlayer
->
setTime
(
m_clip
->
getBegin
()
);
}
//
void ClipWorkflow::setPositionAfterPlayback()
//
{
//
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( setPositionAfterPlayback() ) );
//
connect( m_mediaPlayer, SIGNAL( timeChanged() ), this, SLOT( pauseAfterPlaybackStarted() ), Qt::DirectConnection );
//
//
m_mediaPlayer->setTime( m_clip->getBegin() );
//
}
void
ClipWorkflow
::
pauseAfterPlaybackStarted
()
{
disconnect
(
m_mediaPlayer
,
SIGNAL
(
timeChanged
()
),
this
,
SLOT
(
pauseAfterPlaybackStarted
()
)
);
//FIXME: it seems that this signal is never connected :o
// disconnect( m_mediaPlayer, SIGNAL( timeChanged() ), this, SLOT( pauseAfterPlaybackStarted() ) );
disconnect
(
m_mediaPlayer
,
SIGNAL
(
playing
()
),
this
,
SLOT
(
pauseAfterPlaybackStarted
()
)
);
connect
(
m_mediaPlayer
,
SIGNAL
(
paused
()
),
this
,
SLOT
(
initializedMediaPlayer
()
),
Qt
::
DirectConnection
);
qDebug
()
<<
"Media player position changed"
;
m_mediaPlayer
->
pause
();
}
...
...
src/Workflow/ClipWorkflow.h
View file @
50ad682e
...
...
@@ -210,7 +210,7 @@ class ClipWorkflow : public QObject
private
slots
:
void
pauseAfterPlaybackStarted
();
void
initializedMediaPlayer
();
void
setPositionAfterPlayback
();
//
void setPositionAfterPlayback();
void
pausedMediaPlayer
();
void
unpausedMediaPlayer
();
...
...
src/Workflow/TrackWorkflow.cpp
View file @
50ad682e
...
...
@@ -564,7 +564,8 @@ void TrackWorkflow::clear()
void
TrackWorkflow
::
adjustClipTime
(
qint64
currentFrame
,
qint64
start
,
ClipWorkflow
*
cw
)
{
qint64
nbMs
=
(
currentFrame
-
start
)
/
cw
->
getClip
()
->
getParent
()
->
getFps
()
*
1000
;
qint64
startFrame
=
cw
->
getClip
()
->
getBegin
()
+
nbMs
;
qint64
beginInMs
=
cw
->
getClip
()
->
getBegin
()
/
cw
->
getClip
()
->
getParent
()
->
getFps
()
*
1000
;
qint64
startFrame
=
beginInMs
+
nbMs
;
cw
->
setTime
(
startFrame
);
}
...
...
Write
Preview
Markdown
is supported
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