Skip to content
Permalink
Browse files

Revert "temp"

This reverts commit 470371e.
  • Loading branch information
popcornmix committed Apr 20, 2016
1 parent 470371e commit 7c5a50da19003ca0b49b0b03e71f9038d1d576bc
@@ -74,7 +74,6 @@ OMXPlayerAudio::OMXPlayerAudio(OMXClock *av_clock, CDVDMessageQueue& parent, CPr
m_pAudioCodec = NULL;
m_speed = DVD_PLAYSPEED_NORMAL;
m_started = false;
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_stalled = false;
m_audioClock = DVD_NOPTS_VALUE;
m_buffer_empty = false;
@@ -137,7 +136,6 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec)
m_audioClock = DVD_NOPTS_VALUE;
m_silence = false;
m_started = false;
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_flush = false;
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
m_format = GetDataFormat(m_hints);
@@ -332,11 +330,9 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket, bool bTrickPlay)

// signal to our parent that we have initialized
if(m_started == false && !bDropPacket && settings_changed)
// if(m_syncState == IDVDStreamPlayer::SYNC_STARTING && !bDropPacket && settings_changed)
{
m_started = true;
m_sync = false;
m_syncState = IDVDStreamPlayer::SYNC_WAITSYNC;
SStartMsg msg;
msg.player = VideoPlayer_AUDIO;
msg.cachetotal = DVD_SEC_TO_TIME(m_omxAudio.GetCacheTotal());
@@ -361,14 +357,12 @@ void OMXPlayerAudio::Process()
int priority = 1;
//Do we want a new audio frame?
if (m_started == false || /* when not started */
// if (m_syncState == IDVDStreamPlayer::SYNC_STARTING || /* when not started */
m_speed == DVD_PLAYSPEED_NORMAL || /* when playing normally */
m_speed < DVD_PLAYSPEED_PAUSE || /* when rewinding */
(m_speed > DVD_PLAYSPEED_NORMAL && m_audioClock < m_av_clock->GetClock())) /* when behind clock in ff */
priority = 0;

if (m_started && !m_sync)
// if (m_syncState == IDVDStreamPlayer::SYNC_WAITSYNC)
priority = 1;

// consider stream stalled if queue is empty
@@ -399,7 +393,7 @@ void OMXPlayerAudio::Process()

if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER))
CLog::Log(LOGINFO, "Audio: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d,%d", pPacket->dts, pPacket->pts,
(int)pPacket->iSize, m_syncState, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate);
(int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, (int)m_omxAudio.GetAudioRenderingLatency(), (int)m_hints_current.samplerate);
if(Decode(pPacket, bPacketDrop, m_speed > DVD_PLAYSPEED_NORMAL || m_speed < 0))
{
// we are not running until something is cached in output device
@@ -424,26 +418,21 @@ void OMXPlayerAudio::Process()

m_audioClock = pts;
m_sync = true;
m_syncState = IDVDStreamPlayer::SYNC_INSYNC;
}
else if (pMsg->IsType(CDVDMsg::GENERAL_RESET))
{
CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::GENERAL_RESET");
if (m_pAudioCodec)
m_pAudioCodec->Reset();
m_started = false;
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_audioClock = DVD_NOPTS_VALUE;
}
else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH))
{
bool sync = static_cast<CDVDMsgBool*>(pMsg)->m_value;
CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::GENERAL_FLUSH(%d)", sync);
CLog::Log(LOGDEBUG, "COMXPlayerAudio - CDVDMsg::GENERAL_FLUSH");
m_omxAudio.Flush();
m_stalled = true;
m_started = false;
if (sync)
m_syncState = IDVDStreamPlayer::SYNC_STARTING;

if (m_pAudioCodec)
m_pAudioCodec->Reset();
@@ -56,7 +56,6 @@ class OMXPlayerAudio : public CThread, public IDVDStreamPlayerAudio
bool m_stalled;
bool m_started;
bool m_sync;
IDVDStreamPlayer::ESyncState m_syncState;

BitstreamStats m_audioStats;

@@ -103,7 +103,6 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock,
m_display_stereo_mode = RENDER_STEREO_MODE_OFF;
m_StereoInvert = false;
m_started = false;
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_iCurrentPts = DVD_NOPTS_VALUE;
m_nextOverlay = DVD_NOPTS_VALUE;
m_flush = false;
@@ -122,7 +121,6 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints)
m_hints = hints;
m_hdmi_clock_sync = (CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF);
m_started = false;
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_flush = false;
m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0;
m_nextOverlay = DVD_NOPTS_VALUE;
@@ -237,7 +235,6 @@ void OMXPlayerVideo::ProcessOverlays(double pts)
{
// remove any overlays that are out of time
if (m_started)
// if (m_syncState == IDVDStreamPlayer::SYNC_INSYNC)
m_pOverlayContainer->CleanUp(pts - m_iSubtitleDelay);

VecOverlays overlays;
@@ -339,10 +336,8 @@ void OMXPlayerVideo::Process()
{
int iQueueTimeOut = (int)(m_stalled ? frametime / 4 : frametime * 10) / 1000;
int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0;
// int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_syncState == IDVDStreamPlayer::SYNC_INSYNC) ? 1 : 0;

if (m_started && !m_sync)
// if (m_syncState == IDVDStreamPlayer::SYNC_WAITSYNC)
iPriority = 1;

CDVDMsg* pMsg;
@@ -379,7 +374,6 @@ void OMXPlayerVideo::Process()
m_nextOverlay = DVD_NOPTS_VALUE;
m_iCurrentPts = DVD_NOPTS_VALUE;
m_sync = true;
m_syncState = IDVDStreamPlayer::SYNC_INSYNC;

CLog::Log(LOGDEBUG, "CVideoPlayerVideo - CDVDMsg::GENERAL_RESYNC(%f)", pts);
}
@@ -392,18 +386,14 @@ void OMXPlayerVideo::Process()
{
CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_RESET");
m_started = false;
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_nextOverlay = DVD_NOPTS_VALUE;
m_iCurrentPts = DVD_NOPTS_VALUE;
}
else if (pMsg->IsType(CDVDMsg::GENERAL_FLUSH)) // private message sent by (COMXPlayerVideo::Flush())
{
bool sync = static_cast<CDVDMsgBool*>(pMsg)->m_value;
CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_FLUSH(%d)", sync);
CLog::Log(LOGDEBUG, "COMXPlayerVideo - CDVDMsg::GENERAL_FLUSH");
m_stalled = true;
m_started = false;
if (sync)
m_syncState = IDVDStreamPlayer::SYNC_STARTING;
m_nextOverlay = DVD_NOPTS_VALUE;
m_iCurrentPts = DVD_NOPTS_VALUE;
m_omxVideo.Reset();
@@ -435,7 +425,7 @@ void OMXPlayerVideo::Process()

if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER))
CLog::Log(LOGINFO, "Video: dts:%.0f pts:%.0f size:%d (s:%d f:%d d:%d l:%d) s:%d %d/%d late:%d\n", pPacket->dts, pPacket->pts,
(int)pPacket->iSize, m_syncState, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0);
(int)pPacket->iSize, m_started, m_flush, bPacketDrop, m_stalled, m_speed, 0, 0, 0);

if (m_messageQueue.GetDataSize() == 0
|| m_speed < 0)
@@ -463,8 +453,7 @@ void OMXPlayerVideo::Process()

if (m_stalled)
{
if(m_syncState == IDVDStreamPlayer::SYNC_INSYNC)
CLog::Log(LOGINFO, "COMXPlayerVideo - Stillframe left, switching to normal playback");
CLog::Log(LOGINFO, "COMXPlayerVideo - Stillframe left, switching to normal playback");
m_stalled = false;
}

@@ -488,12 +477,10 @@ void OMXPlayerVideo::Process()
m_iCurrentPts = pts;

if (m_started == false && !bRequestDrop && settings_changed)
// if (m_syncState == IDVDStreamPlayer::SYNC_STARTING && !bRequestDrop && settings_changed)
{
m_codecname = m_omxVideo.GetDecoderName();
m_started = true;
m_sync = false;
m_syncState = IDVDStreamPlayer::SYNC_WAITSYNC;
SStartMsg msg;
msg.player = VideoPlayer_VIDEO;
msg.cachetime = DVD_MSEC_TO_TIME(50); // TODO
@@ -55,7 +55,6 @@ class OMXPlayerVideo : public CThread, public IDVDStreamPlayerVideo
bool m_stalled;
bool m_started;
bool m_sync;
IDVDStreamPlayer::ESyncState m_syncState;
bool m_flush;
std::string m_codecname;
int m_width;

0 comments on commit 7c5a50d

Please sign in to comment.
You can’t perform that action at this time.