Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #313 by catching when unhide occurs and explicitly re-opening video player #326

Merged
merged 1 commit into from Mar 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions omxplayer.cpp
Expand Up @@ -1505,8 +1505,24 @@ int main(int argc, char *argv[])
if (m_omx_reader.IsEof())
goto do_exit;

if(m_has_video && !m_player_video.Reset())
goto do_exit;
// Depending on what caused the seek either do a quick reset or full re-open
// of the video player. When the unhide video action is taken (m_new_win_pos
// is true) do a full re-open because the player was already closed. However
// for all other seeks (like looping or an explicit seek), do a quick reset
// to reduce stuttering.
if (!m_new_win_pos)
{
// Quick reset to reduce delay during loop & seek.
if (m_has_video && !m_player_video.Reset())
goto do_exit;
}
else
{
// Full re-open because video player was closed.
if (m_has_video && !m_player_video.Open(m_hints_video, m_av_clock, DestRect, m_Deinterlace ? VS_DEINTERLACEMODE_FORCE:m_NoDeinterlace ? VS_DEINTERLACEMODE_OFF:VS_DEINTERLACEMODE_AUTO,
m_anaglyph, m_hdmi_clock_sync, m_thread_player, m_display_aspect, m_display, m_layer, video_queue_size, video_fifo_size))
goto do_exit;
}

CLog::Log(LOGDEBUG, "Seeked %.0f %.0f %.0f\n", DVD_MSEC_TO_TIME(seek_pos), startpts, m_av_clock->OMXMediaTime());

Expand Down