mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 15:37:49 +00:00
xbmc-rpi: add patch to revert d8a02e0, thanks to Dom
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
1bdbd6435b
commit
acf6acf461
@ -0,0 +1,308 @@
|
|||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayer.cpp xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayer.cpp
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayer.cpp 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayer.cpp 2012-04-26 18:47:42.702153142 +0200
|
||||||
|
@@ -65,7 +65,7 @@
|
||||||
|
{
|
||||||
|
m_speed = 1;
|
||||||
|
m_paused = false;
|
||||||
|
- m_bAbortRequest = false;
|
||||||
|
+ m_StopPlaying = false;
|
||||||
|
m_hdmi_clock_sync = false;
|
||||||
|
m_av_clock = NULL;
|
||||||
|
}
|
||||||
|
@@ -110,7 +110,7 @@
|
||||||
|
|
||||||
|
m_item = file;
|
||||||
|
m_options = options;
|
||||||
|
- m_bAbortRequest = false;
|
||||||
|
+ m_StopPlaying = false;
|
||||||
|
|
||||||
|
m_elapsed_ms = 0;
|
||||||
|
m_duration_ms = 0;
|
||||||
|
@@ -175,7 +175,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
// Playback might have been stopped due to some error
|
||||||
|
- if (m_bStop || m_bAbortRequest)
|
||||||
|
+ if (m_bStop || m_StopPlaying)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
@@ -191,7 +191,7 @@
|
||||||
|
{
|
||||||
|
CLog::Log(LOGDEBUG, "COMXPlayer::CloseFile");
|
||||||
|
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
+ m_StopPlaying = true;
|
||||||
|
|
||||||
|
CLog::Log(LOGDEBUG, "COMXPlayer: waiting for threads to exit");
|
||||||
|
// wait for the main thread to finish up
|
||||||
|
@@ -854,6 +854,7 @@
|
||||||
|
|
||||||
|
CStdString COMXPlayer::GetPlayingTitle()
|
||||||
|
{
|
||||||
|
+ //return video_title;
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -872,7 +873,7 @@
|
||||||
|
// if we didn't stop playing, advance to the next item in xbmc's playlist
|
||||||
|
if(m_options.identify == false)
|
||||||
|
{
|
||||||
|
- if (m_bAbortRequest)
|
||||||
|
+ if (m_StopPlaying)
|
||||||
|
m_callback.OnPlayBackStopped();
|
||||||
|
else
|
||||||
|
m_callback.OnPlayBackEnded();
|
||||||
|
@@ -887,6 +888,7 @@
|
||||||
|
CLog::Log(LOGDEBUG, "COMXPlayer: SetThreadPriority failed");
|
||||||
|
|
||||||
|
struct timespec starttime, endtime;
|
||||||
|
+ bool got_eof = false;
|
||||||
|
OMXPacket *omx_pkt = NULL;
|
||||||
|
|
||||||
|
//CLog::Log(LOGDEBUG, "COMXPlayer: Thread started");
|
||||||
|
@@ -897,10 +899,7 @@
|
||||||
|
m_stats = false;
|
||||||
|
|
||||||
|
if(!m_omx_reader.Open(m_filename, false))
|
||||||
|
- {
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
goto do_exit;
|
||||||
|
- }
|
||||||
|
|
||||||
|
m_video_count = m_omx_reader.VideoStreamCount();
|
||||||
|
m_audio_count = m_omx_reader.AudioStreamCount();
|
||||||
|
@@ -914,10 +913,7 @@
|
||||||
|
|
||||||
|
m_av_clock = new OMXClock();
|
||||||
|
if(!m_av_clock->OMXInitialize(m_video_count, m_audio_count))
|
||||||
|
- {
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
goto do_exit;
|
||||||
|
- }
|
||||||
|
|
||||||
|
if(m_hdmi_clock_sync && !m_av_clock->HDMIClockSync())
|
||||||
|
goto do_exit;
|
||||||
|
@@ -926,10 +922,7 @@
|
||||||
|
|
||||||
|
if(m_video_count && !m_player_video.Open(m_hints_video, m_av_clock, deinterlace,
|
||||||
|
m_bMpeg, m_hdmi_clock_sync, m_thread_player))
|
||||||
|
- {
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
goto do_exit;
|
||||||
|
- }
|
||||||
|
|
||||||
|
CStdString deviceString;
|
||||||
|
if(m_use_passthrough)
|
||||||
|
@@ -939,10 +932,7 @@
|
||||||
|
|
||||||
|
if(m_audio_count && !m_player_audio.Open(m_hints_audio, m_av_clock, &m_omx_reader, deviceString,
|
||||||
|
m_use_passthrough, m_use_hw_audio, m_thread_player))
|
||||||
|
- {
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
goto do_exit;
|
||||||
|
- }
|
||||||
|
|
||||||
|
RESOLUTION res = g_graphicsContext.GetVideoResolution();
|
||||||
|
int video_width = g_settings.m_ResInfo[res].iWidth;
|
||||||
|
@@ -1022,7 +1012,7 @@
|
||||||
|
CSingleLock lock(m_csection);
|
||||||
|
m_csection.unlock();
|
||||||
|
|
||||||
|
- while (!m_bAbortRequest)
|
||||||
|
+ while (!m_bStop && !m_StopPlaying)
|
||||||
|
{
|
||||||
|
if(m_paused)
|
||||||
|
{
|
||||||
|
@@ -1043,10 +1033,7 @@
|
||||||
|
m_player_video.Close();
|
||||||
|
if(m_video_count && !m_player_video.Open(m_hints_video, m_av_clock, deinterlace,
|
||||||
|
m_bMpeg, m_hdmi_clock_sync, m_thread_player))
|
||||||
|
- {
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
goto do_exit;
|
||||||
|
- }
|
||||||
|
|
||||||
|
m_flush = false;
|
||||||
|
}
|
||||||
|
@@ -1135,10 +1122,7 @@
|
||||||
|
|
||||||
|
/* player emergency exit */
|
||||||
|
if(m_player_audio.Error())
|
||||||
|
- {
|
||||||
|
- m_bAbortRequest = true;
|
||||||
|
goto do_exit;
|
||||||
|
- }
|
||||||
|
|
||||||
|
if(m_stats)
|
||||||
|
{
|
||||||
|
@@ -1158,8 +1142,10 @@
|
||||||
|
m_csection.unlock();
|
||||||
|
|
||||||
|
if(m_omx_reader.IsEof())
|
||||||
|
+ {
|
||||||
|
+ got_eof = true;
|
||||||
|
break;
|
||||||
|
-
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
@@ -1171,22 +1157,12 @@
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
- if(m_omx_reader.IsEof())
|
||||||
|
+ if(got_eof && !m_StopPlaying)
|
||||||
|
{
|
||||||
|
- bool running = true;
|
||||||
|
-
|
||||||
|
- while(running)
|
||||||
|
- {
|
||||||
|
- if(m_bAbortRequest)
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- if(m_audio_count)
|
||||||
|
- running = m_player_audio.WaitCompletion();
|
||||||
|
- else if(m_video_count)
|
||||||
|
- running = m_player_video.WaitCompletion();
|
||||||
|
-
|
||||||
|
- OMXClock::OMXSleep(50);
|
||||||
|
- }
|
||||||
|
+ if(m_audio_count)
|
||||||
|
+ m_player_audio.WaitCompletion();
|
||||||
|
+ else if(m_video_count)
|
||||||
|
+ m_player_video.WaitCompletion();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_av_clock)
|
||||||
|
@@ -1203,6 +1179,8 @@
|
||||||
|
OMXReader::FreePacket(omx_pkt);
|
||||||
|
omx_pkt = NULL;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ m_StopPlaying = true;
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayer.h xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayer.h
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayer.h 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayer.h 2012-04-26 18:47:42.790154893 +0200
|
||||||
|
@@ -170,7 +170,7 @@
|
||||||
|
|
||||||
|
int m_speed;
|
||||||
|
bool m_paused;
|
||||||
|
- bool m_bAbortRequest;
|
||||||
|
+ bool m_StopPlaying;
|
||||||
|
CEvent m_ready;
|
||||||
|
CFileItem m_item;
|
||||||
|
CPlayerOptions m_options;
|
||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerAudio.cpp xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerAudio.cpp
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerAudio.cpp 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerAudio.cpp 2012-04-26 18:47:43.003159130 +0200
|
||||||
|
@@ -674,22 +674,24 @@
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-bool OMXPlayerAudio::WaitCompletion()
|
||||||
|
+void OMXPlayerAudio::WaitCompletion()
|
||||||
|
{
|
||||||
|
if(!m_decoder)
|
||||||
|
- return false;
|
||||||
|
+ return;
|
||||||
|
|
||||||
|
- Lock();
|
||||||
|
- if(m_packets.empty())
|
||||||
|
+ while(true)
|
||||||
|
{
|
||||||
|
+ Lock();
|
||||||
|
+ if(m_packets.empty())
|
||||||
|
+ {
|
||||||
|
+ UnLock();
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
UnLock();
|
||||||
|
- return true;
|
||||||
|
+ OMXClock::OMXSleep(50);
|
||||||
|
}
|
||||||
|
- UnLock();
|
||||||
|
|
||||||
|
m_decoder->WaitCompletion();
|
||||||
|
-
|
||||||
|
- return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OMXPlayerAudio::RegisterAudioCallback(IAudioCallback *pCallback)
|
||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerAudio.h xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerAudio.h
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerAudio.h 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerAudio.h 2012-04-26 18:47:43.561170233 +0200
|
||||||
|
@@ -122,7 +122,7 @@
|
||||||
|
double GetDelay();
|
||||||
|
double GetCacheTime();
|
||||||
|
double GetCurrentPTS() { return m_iCurrentPts; };
|
||||||
|
- bool WaitCompletion();
|
||||||
|
+ void WaitCompletion();
|
||||||
|
unsigned int GetCached() { return m_cached_size; };
|
||||||
|
void RegisterAudioCallback(IAudioCallback* pCallback);
|
||||||
|
void UnRegisterAudioCallback();
|
||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerVideo.cpp xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerVideo.cpp
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerVideo.cpp 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerVideo.cpp 2012-04-26 18:47:44.088180715 +0200
|
||||||
|
@@ -560,22 +560,24 @@
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
-bool OMXPlayerVideo::WaitCompletion()
|
||||||
|
+void OMXPlayerVideo::WaitCompletion()
|
||||||
|
{
|
||||||
|
if(!m_decoder)
|
||||||
|
- return false;
|
||||||
|
+ return;
|
||||||
|
|
||||||
|
- Lock();
|
||||||
|
- if(m_packets.empty())
|
||||||
|
+ while(true)
|
||||||
|
{
|
||||||
|
+ Lock();
|
||||||
|
+ if(m_packets.empty())
|
||||||
|
+ {
|
||||||
|
+ UnLock();
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
UnLock();
|
||||||
|
- return true;
|
||||||
|
+ OMXClock::OMXSleep(50);
|
||||||
|
}
|
||||||
|
- UnLock();
|
||||||
|
|
||||||
|
m_decoder->WaitCompletion();
|
||||||
|
-
|
||||||
|
- return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OMXPlayerVideo::SetSpeed(int speed)
|
||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerVideo.h xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerVideo.h
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXPlayerVideo.h 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXPlayerVideo.h 2012-04-26 18:47:44.325185435 +0200
|
||||||
|
@@ -116,7 +116,7 @@
|
||||||
|
double GetCurrentPTS() { return m_pts; };
|
||||||
|
double GetFPS() { return m_fps; };
|
||||||
|
unsigned int GetCached() { return m_cached_size; };
|
||||||
|
- bool WaitCompletion();
|
||||||
|
+ void WaitCompletion();
|
||||||
|
void SetDelay(double delay) { m_iVideoDelay = delay; }
|
||||||
|
double GetDelay() { return m_iVideoDelay; }
|
||||||
|
void SetSpeed(int iSpeed);
|
||||||
|
diff -Naur xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXVideo.cpp xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXVideo.cpp
|
||||||
|
--- xbmc-rpi-c2c161c/xbmc/cores/omxplayer/OMXVideo.cpp 2012-04-26 16:26:58.000000000 +0200
|
||||||
|
+++ xbmc-rpi-c2c161c.patch/xbmc/cores/omxplayer/OMXVideo.cpp 2012-04-26 18:47:44.579190487 +0200
|
||||||
|
@@ -1079,7 +1079,7 @@
|
||||||
|
if(m_omx_render.IsEOS())
|
||||||
|
break;
|
||||||
|
clock_gettime(CLOCK_REALTIME, &endtime);
|
||||||
|
- if((endtime.tv_sec - starttime.tv_sec) > 2)
|
||||||
|
+ if((endtime.tv_sec - starttime.tv_sec) > 5)
|
||||||
|
{
|
||||||
|
CLog::Log(LOGERROR, "%s::%s - wait for eos timed out\n", CLASSNAME, __func__);
|
||||||
|
break;
|
Loading…
x
Reference in New Issue
Block a user