Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[rbp/omxplayer] Apply latest commits from dvdplayer to omxplayer #3557

Merged
merged 15 commits into from

3 participants

@popcornmix
Collaborator

This picks up any changes to dvdplayer that haven't been applied to omxplayer.
This makes the diffs between omxplayer and dvdplayer pretty minimal.

popcornmix added some commits
@popcornmix popcornmix [rbp/omxplayer] remove resume players on CloseFile, fixes some small …
…portion of audio being played when stopping a paused video
0b6bf2e
@popcornmix popcornmix [rbp/omxplayer] Add external subs' details while updating stream deta…
…ils from player.
d1b1006
@popcornmix popcornmix [rbp/omxplayer] update current video settings when changing setting s…
…ubtitles stream to be sure we keep it synced (similiar to what we already do when we show/hide subtitles)
07d1a78
@popcornmix popcornmix [rbp/omxplayer] Use CUtil::GetExternalStreamDetailsFromFilename to de…
…termine external subtitles's details.

These are language, name and flag.
9c686a4
@popcornmix popcornmix [rbp/omxplayer] Allow the use of external subtitles for DVDs 9a09cba
@popcornmix popcornmix [rbp/omxplayer] allow external .sub subtitles next to text-based ones 102d925
@popcornmix popcornmix [rbp/omxplayer] allow setting the video's stereo scopic mode from vid…
…eo settings
4e288c6
@popcornmix popcornmix [rbp/omxplayer] Unpause (if applicable) when going to DVD menu 6e7ee38
@popcornmix popcornmix [rbp/omxplayer] Add busydialogdelayms advanced setting. 868a898
@popcornmix popcornmix [rbp/omxplayer] Take advantage of if evaluation order. 36489fb
@popcornmix popcornmix [rbp/omxplayer] Remove unnecessary NULL check. 3bf21f7
@popcornmix popcornmix [rbp/omxplayer] Set CMediaSettings::Get().GetCurrentVideoSettings().m…
…_AudioStream on open/set.
311c0e3
@popcornmix popcornmix [rbp/omxplayer] Save the subtitle number at the end of the OpenSubtit…
…leStream() method.

Regardless of whether the subtitle has been opened successfully or not.
8506813
@popcornmix popcornmix [rbp/omxplayer] prune from usage of DWORD and BYTE typedefs 65ca8c0
@popcornmix popcornmix [rbp/omxplayer] Fix (harmless) typo with video/audio fifo levels a66ac99
@huceke huceke merged commit c11b6b4 into xbmc:master
@popcornmix popcornmix deleted the popcornmix:update_dvdplayer branch
@elupus

This looks dangerous. time_offset is how you get from clock to the actual timestamps in file. If we detect a discontinuity in the timestamps, we will consume that and time_offset will be modified. Ie we will continue playing smooth, but clock will not represent time anymore.

Collaborator

Also for dvd's.. the clock have nothing to do with the actual playtime on screen.

@elupus
Collaborator

Then again, I'm dropping this function completely in #3565

Collaborator

This was just a copy of #3338.
Was the original PR wrong too?

Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 3, 2013
  1. @popcornmix

    [rbp/omxplayer] remove resume players on CloseFile, fixes some small …

    popcornmix authored
    …portion of audio being played when stopping a paused video
  2. @popcornmix
  3. @popcornmix

    [rbp/omxplayer] update current video settings when changing setting s…

    popcornmix authored
    …ubtitles stream to be sure we keep it synced (similiar to what we already do when we show/hide subtitles)
  4. @popcornmix

    [rbp/omxplayer] Use CUtil::GetExternalStreamDetailsFromFilename to de…

    popcornmix authored
    …termine external subtitles's details.
    
    These are language, name and flag.
  5. @popcornmix
  6. @popcornmix
  7. @popcornmix
  8. @popcornmix
  9. @popcornmix
  10. @popcornmix
  11. @popcornmix
  12. @popcornmix
  13. @popcornmix

    [rbp/omxplayer] Save the subtitle number at the end of the OpenSubtit…

    popcornmix authored
    …leStream() method.
    
    Regardless of whether the subtitle has been opened successfully or not.
  14. @popcornmix
  15. @popcornmix
This page is out of date. Refresh to see the latest.
View
75 xbmc/cores/omxplayer/OMXPlayer.cpp
@@ -517,7 +517,7 @@ bool COMXPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
#endif
Create();
- if(!m_ready.WaitMSec(100))
+ if(!m_ready.WaitMSec(g_advancedSettings.m_videoBusyDialogDelay_ms))
{
CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
if(dialog)
@@ -546,9 +546,6 @@ bool COMXPlayer::CloseFile()
{
CLog::Log(LOGDEBUG, "COMXPlayer::CloseFile");
- // unpause the player
- SetPlaySpeed(DVD_PLAYSPEED_NORMAL);
-
// set the abort request so that other threads can finish up
m_bAbortRequest = true;
@@ -814,10 +811,9 @@ bool COMXPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream)
{
// check if we should read from subtitle demuxer
- if(m_dvdPlayerSubtitle.AcceptsData() && m_pSubtitleDemuxer)
+ if( m_pSubtitleDemuxer && m_dvdPlayerSubtitle.AcceptsData() )
{
- if(m_pSubtitleDemuxer)
- packet = m_pSubtitleDemuxer->Read();
+ packet = m_pSubtitleDemuxer->Read();
if(packet)
{
@@ -2970,6 +2966,7 @@ void COMXPlayer::GetSubtitleStreamInfo(int index, SPlayerSubtitleStreamInfo &inf
void COMXPlayer::SetSubtitle(int iStream)
{
+ CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream = iStream;
m_messenger.Put(new CDVDMsgPlayerSetSubtitleStream(iStream));
}
@@ -3007,6 +3004,7 @@ int COMXPlayer::GetAudioStream()
void COMXPlayer::SetAudioStream(int iStream)
{
+ CMediaSettings::Get().GetCurrentVideoSettings().m_AudioStream = iStream;
m_messenger.Put(new CDVDMsgPlayerSetAudioStream(iStream));
SynchronizeDemuxer(100);
}
@@ -3135,7 +3133,7 @@ bool COMXPlayer::OpenAudioStream(int iStream, int source, bool reset)
/* software decoding normaly consumes full cpu time so prio it */
m_omxPlayerAudio.SetPriority(GetPriority()+1);
-
+ CMediaSettings::Get().GetCurrentVideoSettings().m_AudioStream = m_SelectionStreams.IndexOf(STREAM_AUDIO, source, iStream);
return true;
}
@@ -3324,6 +3322,7 @@ bool COMXPlayer::OpenSubtitleStream(int iStream, int source)
m_CurrentSubtitle.stream = (void*)pStream;
m_CurrentSubtitle.started = false;
+ CMediaSettings::Get().GetCurrentVideoSettings().m_SubtitleStream = m_SelectionStreams.IndexOf(STREAM_SUBTITLE, source, iStream);
return true;
}
@@ -3591,10 +3590,10 @@ int COMXPlayer::OnDVDNavResult(void* pData, int iMessage)
m_dvd.iDVDStillStartTime = XbmcThreads::SystemClockMillis();
/* adjust for the output delay in the video queue */
- DWORD time = 0;
+ unsigned int time = 0;
if( m_CurrentVideo.stream && m_dvd.iDVDStillTime > 0 )
{
- time = (DWORD)(m_omxPlayerVideo.GetOutputDelay() / ( DVD_TIME_BASE / 1000 ));
+ time = (unsigned int)(m_omxPlayerVideo.GetOutputDelay() / ( DVD_TIME_BASE / 1000 ));
if( time < 10000 && time > 0 )
m_dvd.iDVDStillTime += time;
}
@@ -3608,7 +3607,7 @@ int COMXPlayer::OnDVDNavResult(void* pData, int iMessage)
break;
case DVDNAV_SPU_CLUT_CHANGE:
{
- m_dvdPlayerSubtitle.SendMessage(new CDVDMsgSubtitleClutChange((BYTE*)pData));
+ m_dvdPlayerSubtitle.SendMessage(new CDVDMsgSubtitleClutChange((uint8_t*)pData));
}
break;
case DVDNAV_SPU_STREAM_CHANGE:
@@ -3797,6 +3796,11 @@ bool COMXPlayer::OnAction(const CAction &action)
THREAD_ACTION(action);
CLog::Log(LOGDEBUG, " - go to menu");
pMenus->OnMenu();
+ if (m_playSpeed == DVD_PLAYSPEED_PAUSE)
+ {
+ SetPlaySpeed(DVD_PLAYSPEED_NORMAL);
+ m_callback.OnPlayBackResumed();
+ }
// send a message to everyone that we've gone to the menu
CGUIMessage msg(GUI_MSG_VIDEO_MENU_STARTED, 0, 0);
g_windowManager.SendThreadMessage(msg);
@@ -3999,9 +4003,9 @@ bool COMXPlayer::HasMenu()
bool COMXPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
{
- double pts = m_clock.GetClock();
+ double pts = m_clock.GetClock() + m_State.time_offset;
- if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD))
+ if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD) && m_CurrentSubtitle.source != STREAM_SOURCE_TEXT && m_CurrentSubtitle.source != STREAM_SOURCE_DEMUX_SUB)
return false;
m_dvdPlayerSubtitle.GetCurrentSubtitle(strSubtitle, pts - m_omxPlayerVideo.GetSubtitleDelay());
@@ -4075,8 +4079,8 @@ int COMXPlayer::GetCacheLevel() const
double COMXPlayer::GetQueueTime()
{
- int a = m_omxPlayerVideo.GetLevel();
- int v = m_omxPlayerAudio.GetLevel();
+ int a = m_omxPlayerAudio.GetLevel();
+ int v = m_omxPlayerVideo.GetLevel();
return max(a, v) * 8000.0 / 100;
}
@@ -4090,10 +4094,9 @@ void COMXPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info)
info.videoCodecName = retVal;
info.videoAspectRatio = g_renderManager.GetAspectRatio();
g_renderManager.GetVideoRect(info.SrcRect, info.DestRect);
- if (m_CurrentVideo.hint.stereo_mode == "mono")
+ info.stereoMode = m_omxPlayerVideo.GetStereoMode();
+ if (info.stereoMode == "mono")
info.stereoMode = "";
- else
- info.stereoMode = m_CurrentVideo.hint.stereo_mode;
}
int COMXPlayer::GetSourceBitrate()
@@ -4153,6 +4156,17 @@ int COMXPlayer::AddSubtitleFile(const std::string& filename, const std::string&
int index = m_SelectionStreams.IndexOf(STREAM_SUBTITLE, m_SelectionStreams.Source(STREAM_SOURCE_DEMUX_SUB, filename), 0);
m_SelectionStreams.Get(STREAM_SUBTITLE, index).flags = flags;
m_SelectionStreams.Get(STREAM_SUBTITLE, index).filename2 = vobsubfile;
+ ExternalStreamInfo info;
+ CUtil::GetExternalStreamDetailsFromFilename(m_filename, vobsubfile, info);
+ m_SelectionStreams.Get(STREAM_SUBTITLE, index).name = info.name;
+ if (m_SelectionStreams.Get(STREAM_SUBTITLE, index).language.empty())
+ m_SelectionStreams.Get(STREAM_SUBTITLE, index).language = info.language;
+
+ if (static_cast<CDemuxStream::EFlags>(info.flag) == CDemuxStream::FLAG_NONE)
+ m_SelectionStreams.Get(STREAM_SUBTITLE, index).flags = flags;
+ else
+ m_SelectionStreams.Get(STREAM_SUBTITLE, index).flags = static_cast<CDemuxStream::EFlags>(info.flag);
+
return index;
}
if(ext == ".sub")
@@ -4166,8 +4180,15 @@ int COMXPlayer::AddSubtitleFile(const std::string& filename, const std::string&
s.type = STREAM_SUBTITLE;
s.id = 0;
s.filename = filename;
- s.name = URIUtils::GetFileName(filename);
- s.flags = flags;
+ ExternalStreamInfo info;
+ CUtil::GetExternalStreamDetailsFromFilename(m_filename, filename, info);
+ s.name = info.name;
+ s.language = info.language;
+ if (static_cast<CDemuxStream::EFlags>(info.flag) == CDemuxStream::FLAG_NONE)
+ s .flags = flags;
+ else
+ s.flags = static_cast<CDemuxStream::EFlags>(info.flag);
+
m_SelectionStreams.Update(s);
return m_SelectionStreams.IndexOf(STREAM_SUBTITLE, s.source, s.id);
}
@@ -4371,7 +4392,19 @@ bool COMXPlayer::GetStreamDetails(CStreamDetails &details)
{
if (m_pDemuxer)
{
- bool result = CDVDFileInfo::DemuxerToStreamDetails(m_pInputStream, m_pDemuxer, details);
+ std::vector<OMXSelectionStream> subs = m_SelectionStreams.Get(STREAM_SUBTITLE);
+ std::vector<CStreamDetailSubtitle> extSubDetails;
+ for (unsigned int i = 0; i < subs.size(); i++)
+ {
+ if (subs[i].filename == m_filename)
+ continue;
+
+ CStreamDetailSubtitle p;
+ p.m_strLanguage = subs[i].language;
+ extSubDetails.push_back(p);
+ }
+
+ bool result = CDVDFileInfo::DemuxerToStreamDetails(m_pInputStream, m_pDemuxer, extSubDetails, details);
if (result && details.GetStreamCount(CStreamDetail::VIDEO) > 0) // this is more correct (dvds in particular)
{
/*
View
16 xbmc/cores/omxplayer/OMXPlayerVideo.cpp
@@ -259,6 +259,22 @@ void OMXPlayerVideo::ProcessOverlays(double pts)
}
}
+std::string OMXPlayerVideo::GetStereoMode()
+{
+ std::string stereo_mode;
+
+ switch(CMediaSettings::Get().GetCurrentVideoSettings().m_StereoMode)
+ {
+ case RENDER_STEREO_MODE_SPLIT_VERTICAL: stereo_mode = "left_right"; break;
+ case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: stereo_mode = "top_bottom"; break;
+ default: stereo_mode = m_hints.stereo_mode; break;
+ }
+
+ if(CMediaSettings::Get().GetCurrentVideoSettings().m_StereoInvert)
+ stereo_mode = GetStereoModeInvert(stereo_mode);
+ return stereo_mode;
+}
+
void OMXPlayerVideo::Output(double pts, bool bDropPacket)
{
if (!g_renderManager.IsStarted()) {
View
1  xbmc/cores/omxplayer/OMXPlayerVideo.h
@@ -113,6 +113,7 @@ class OMXPlayerVideo : public CThread
void SetSpeed(int iSpeed);
std::string GetPlayerInfo();
int GetVideoBitrate();
+ std::string GetStereoMode();
double GetOutputDelay();
double GetSubtitleDelay() { return m_iSubtitleDelay; }
void SetSubtitleDelay(double delay) { m_iSubtitleDelay = delay; }
Something went wrong with that request. Please try again.