vrplayer fixes
This commit is contained in:
parent
88be8505a9
commit
6daec38c65
@ -312,6 +312,8 @@ void MainWindow::onMediaDurationInSeconds(int duration)
|
||||
int secs = 0;
|
||||
char buf[20];
|
||||
|
||||
//return;
|
||||
|
||||
/* setup progress bar */
|
||||
slider->setMinimum(0);
|
||||
slider->setMaximum(duration * 100); /* in hundredth of a sec */
|
||||
|
@ -2,4 +2,7 @@
|
||||
|
||||
MediaPacket::MediaPacket()
|
||||
{
|
||||
av_pkt = 0;
|
||||
delay_in_us = 0;
|
||||
seq = 0;
|
||||
}
|
||||
|
@ -62,8 +62,8 @@ label1:
|
||||
sendMutex->lock();
|
||||
send_audio_pkt(channel, stream_id, pkt->av_pkt);
|
||||
sendMutex->unlock();
|
||||
delete pkt;
|
||||
usleep(pkt->delay_in_us);
|
||||
delete pkt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ PlayVideo::PlayVideo(QObject *parent,
|
||||
void PlayVideo::play()
|
||||
{
|
||||
MediaPacket *pkt;
|
||||
int usl;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@ -78,20 +79,24 @@ label1:
|
||||
|
||||
if (videoQueue->isEmpty())
|
||||
{
|
||||
qDebug() << "PlayVideo::play: GOT EMPTY";
|
||||
usleep(1000 * 100);
|
||||
continue;
|
||||
}
|
||||
|
||||
pkt = videoQueue->dequeue();
|
||||
sendMutex->lock();
|
||||
send_video_pkt(channel, stream_id, pkt->av_pkt);
|
||||
sendMutex->unlock();
|
||||
usl = pkt->delay_in_us;
|
||||
if (usl < 0)
|
||||
{
|
||||
usl = 0;
|
||||
}
|
||||
if (usl > 100 * 1000)
|
||||
{
|
||||
usl = 100 * 1000;
|
||||
}
|
||||
usleep(usl);
|
||||
delete pkt;
|
||||
usleep(pkt->delay_in_us);
|
||||
|
||||
updateMediaPos();
|
||||
|
||||
if (elapsedTime == 0)
|
||||
elapsedTime = av_gettime();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user