mirror of
https://github.com/wang-bin/QtAV.git
synced 2026-10-29 11:36:51 +08:00
misc
This commit is contained in:
+10
-5
@@ -32,10 +32,9 @@ typedef QApplication ZApplication;
|
||||
#include <QtAV/AVPlayer.h>
|
||||
#include <QtAV/WidgetRenderer.h>
|
||||
#include <QtAV/GraphicsItemRenderer.h>
|
||||
//#include <QtAV/GLWidgetRenderer.h>
|
||||
using namespace QtAV;
|
||||
|
||||
|
||||
|
||||
FILE *log = 0;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
@@ -87,14 +86,20 @@ int main(int argc, char *argv[])
|
||||
s.setSceneRect(0, 0, 800, 600);
|
||||
QGraphicsView w(&s);
|
||||
w.showMaximized();
|
||||
//QGLWidget gw;
|
||||
//v.setViewport(&gw); //may flick
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
QGLWidget *glw = new QGLWidget(QGLFormat(QGL::SampleBuffers));
|
||||
glw->setAutoFillBackground(false);
|
||||
w.setCacheMode(QGraphicsView::CacheNone);
|
||||
w.setViewport(glw);
|
||||
#else
|
||||
setCacheMode(QGraphicsView::CacheBackground);
|
||||
#endif
|
||||
GraphicsItemRenderer renderer;
|
||||
renderer.resizeVideo(800, 600);
|
||||
s.addItem(&renderer);
|
||||
#else
|
||||
WidgetRenderer renderer;
|
||||
WidgetRenderer renderer;
|
||||
renderer.show();
|
||||
renderer.setWindowTitle("QtAV " QTAV_VERSION_STR_LONG);
|
||||
//renderer.resize(800, 600);
|
||||
|
||||
@@ -110,6 +110,7 @@ void AudioThread::run()
|
||||
qDebug("Audio output not available! msleep(%lu)", (unsigned long)((qreal)chunk/(qreal)csf * 1000));
|
||||
sWarn_no_ao = false;
|
||||
}
|
||||
//TODO: avoid acummulative error. External clock?
|
||||
msleep((unsigned long)((qreal)chunk/(qreal)csf * 1000.0));
|
||||
}
|
||||
decodedPos += chunk;
|
||||
@@ -122,6 +123,7 @@ void AudioThread::run()
|
||||
dt = 0;
|
||||
}
|
||||
//qDebug("sleep %f", dt);
|
||||
//TODO: avoid acummulative error. External clock?
|
||||
msleep((unsigned long)(dt*1000.0));
|
||||
}
|
||||
d.last_pts = d.clock->value(); //not pkt.pts! the delay is updated!
|
||||
|
||||
Reference in New Issue
Block a user