Commit 71ee79d6 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Improving the way pts are given to the imem module.

It doesn't hang render anymore.
parent 9ffe9ce4
......@@ -30,7 +30,7 @@ Instance::Instance()
{
char const *argv[] =
{
"-vvvvv",
// "-vvvvv",
"--no-skip-frames",
// "--intf", "dummy",
"--text-renderer", "dummy",
......
......@@ -63,6 +63,7 @@ WorkflowRenderer::WorkflowRenderer() :
sprintf( buffer, ":height=%i", VIDEOHEIGHT );
m_media->addOption( buffer );
m_media->addOption( ":imem-cat=2" );
m_media->addOption( ":imem-caching=0" );
m_condMutex = new QMutex;
m_waitCond = new QWaitCondition;
......@@ -115,7 +116,8 @@ int WorkflowRenderer::lockVideo( void *datas, int64_t *pts, size_t *bufferSi
self->m_videoBuffSize = (*(ret->video))->nboctets;
self->m_renderAudioSample = ret->audio;
}
*pts = ( self->m_mainWorkflow->getCurrentFrame() * 1000000 ) / OUTPUT_FPS;
*pts = ( self->m_pts * 1000000 ) / OUTPUT_FPS;
++self->m_pts;
*buffer = self->m_renderVideoFrame;
*bufferSize = self->m_videoBuffSize;
return 0;
......@@ -181,10 +183,11 @@ void WorkflowRenderer::startPreview()
m_mainWorkflow->setFullSpeedRender( false );
m_mainWorkflow->startRender();
m_mediaPlayer->play();
m_isRendering = true;
m_paused = false;
m_stopping = false;
m_pts = 0;
m_mediaPlayer->play();
}
void WorkflowRenderer::setPosition( float newPos )
......
......@@ -84,6 +84,11 @@ class WorkflowRenderer : public GenericRenderer
bool m_unpauseAsked;
QMutex* m_condMutex;
QWaitCondition* m_waitCond;
/**
* \brief This isn't exactly the current PTS.
* It's the number of frame rendered since the render has started.
*/
qint64 m_pts;
public slots:
virtual void setClip( Clip* ){}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment