Guest User

Untitled

a guest
Jul 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1. diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
  2. index 2ca2f23..82b5a0d 100644
  3. --- a/xbmc/cores/smpplayer/SMPPlayer.cpp
  4. +++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
  5. @@ -1560,7 +1560,7 @@ void CSMPPlayer::Process()
  6.  
  7. // get our initial status.
  8. GetAmpStatus();
  9. -
  10. +
  11. // restore system volume setting.
  12. SetVolume(g_settings.m_nVolumeLevel);
  13.  
  14. @@ -1570,48 +1570,11 @@ void CSMPPlayer::Process()
  15. // drop CGUIDialogBusy dialog and release the hold in OpenFile.
  16. m_ready.Set();
  17.  
  18. - // we are playing but hidden and all stream fields are valid.
  19. - // check for video in media content
  20. - GetAmpStatus();
  21. - if (m_video_count > 0 || m_dvd_mediatype)
  22. - {
  23. - // turn on/off subs
  24. - SetSubtitleVisible(m_subtitle_show);
  25. - SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
  26. -
  27. - // setup renderer for bypass. This tell it to get out of the way as
  28. - // amp will be doing the actual video rendering in a video plane
  29. - // that is under the GUI layer.
  30. - int width = GetPictureWidth();
  31. - int height = GetPictureHeight();
  32. - if (m_dvd_mediatype)
  33. - {
  34. - // this is not right but seems to work.
  35. - width = g_graphicsContext.GetWidth();
  36. - height = g_graphicsContext.GetHeight();
  37. - }
  38. - double fFrameRate = GetActualFPS();
  39. - unsigned int flags = 0;
  40. -
  41. - flags |= CONF_FLAGS_FORMAT_BYPASS;
  42. - flags |= CONF_FLAGS_FULLSCREEN;
  43. - CStdString formatstr = "BYPASS";
  44. - CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",
  45. - __FUNCTION__, width, height, fFrameRate, formatstr.c_str());
  46. - g_renderManager.IsConfigured();
  47. - if(!g_renderManager.Configure(width, height, width, height, fFrameRate, flags, 0))
  48. - {
  49. - CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__);
  50. - }
  51. - if (!g_renderManager.IsStarted())
  52. - {
  53. - CLog::Log(LOGERROR, "%s - renderer not started", __FUNCTION__);
  54. - }
  55. - }
  56. -
  57. if (m_options.identify == false)
  58. m_callback.OnPlayBackStarted();
  59.  
  60. + bool video_configured = false;
  61. +
  62. while (!m_bStop && !m_StopPlaying)
  63. {
  64. // AMP monitoring loop for automatic playback termination (250ms wait)
  65. @@ -1621,8 +1584,53 @@ void CSMPPlayer::Process()
  66. DFBEvent event;
  67. m_amp_event->GetEvent(m_amp_event, &event);
  68.  
  69. - if (GetAmpStatus() && m_amp_media->CheckEOS())
  70. - break;
  71. + if (GetAmpStatus())
  72. + {
  73. + // we are playing but hidden and all stream fields are valid.
  74. + // check for video in media content
  75. + if (!video_configured && (m_video_count > 0 || m_dvd_mediatype))
  76. + {
  77. + // turn on/off subs
  78. + SetSubtitleVisible(m_subtitle_show);
  79. + SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
  80. +
  81. + // setup renderer for bypass. This tell it to get out of the way as
  82. + // amp will be doing the actual video rendering in a video plane
  83. + // that is under the GUI layer.
  84. + int width = GetPictureWidth();
  85. + int height = GetPictureHeight();
  86. + if (m_dvd_mediatype)
  87. + {
  88. + // this is not right but seems to work.
  89. + width = g_graphicsContext.GetWidth();
  90. + height = g_graphicsContext.GetHeight();
  91. + }
  92. + double fFrameRate = GetActualFPS();
  93. + unsigned int flags = 0;
  94. +
  95. + flags |= CONF_FLAGS_FORMAT_BYPASS;
  96. + flags |= CONF_FLAGS_FULLSCREEN;
  97. + CStdString formatstr = "BYPASS";
  98. + CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",
  99. + __FUNCTION__, width, height, fFrameRate, formatstr.c_str());
  100. + g_renderManager.IsConfigured();
  101. + if(!g_renderManager.Configure(width, height, width, height, fFrameRate, flags, 0))
  102. + {
  103. + CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__);
  104. + }
  105. + if (!g_renderManager.IsStarted())
  106. + {
  107. + CLog::Log(LOGERROR, "%s - renderer not started", __FUNCTION__);
  108. + }
  109. +
  110. + video_configured = true;
  111. + }
  112. +
  113. + // Check for EOS
  114. + if (m_amp_media->CheckEOS())
  115. + break;
  116. + }
  117. +
  118. }
  119. else
  120. {
  121. @@ -1630,7 +1638,7 @@ void CSMPPlayer::Process()
  122. Sleep(250);
  123. }
  124. }
  125. -
  126. +
  127. // have to stop if playing before CloseMedia or bad things happen.
  128. if (m_amp_media->GetStatusState() != SMP_STOPPED)
  129. {
Add Comment
Please, Sign In to add comment