Skip to content

Commit

Permalink
PiP: Add a dummy video sync sub-class for Picture in Picture.
Browse files Browse the repository at this point in the history
Video timing for PiP's is handled by the main player - hence no actual
video sync is required for the PiP players.
  • Loading branch information
Mark Kendall committed May 10, 2011
1 parent a90960c commit 7bd0b54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -2116,7 +2116,11 @@ void MythPlayer::VideoStart(void)
m_double_framerate = false;
m_scan_tracker = 2;

if (using_null_videoout)
if (player_ctx->IsPIP() && using_null_videoout)
{
videosync = new DummyVideoSync(videoOutput, fr_int, 0, false);
}
else if (using_null_videoout)
{
videosync = new USleepVideoSync(videoOutput, fr_int, 0, false);
}
Expand Down
14 changes: 13 additions & 1 deletion mythtv/libs/libmythtv/vsync.h
Expand Up @@ -192,7 +192,7 @@ class BusyWaitVideoSync : public VideoSync
* inaccurate on < Linux 2.6 kernels; not very accurate there either.
* Not phase-maintaining. Not tried automatically.
*
* This only used when NVP's 'disablevideo' is true (i.e. for
* This is only used when MythPlayer's 'disablevideo' is true (i.e. for
* commercial flagging and for transcoding), since it doesn't
* waste CPU cycles busy-waiting like BusyWaitVideoSync.
*/
Expand All @@ -208,4 +208,16 @@ class USleepVideoSync : public VideoSync
bool TryInit(void);
int WaitForFrame(int sync_delay);
};

class DummyVideoSync : public VideoSync
{
public:
DummyVideoSync(VideoOutput* vo, int fr, int ri, bool intl)
: VideoSync(vo, fr, ri, intl) { }
~DummyVideoSync() { }

QString getName(void) const { return QString("Dummy"); }
bool TryInit(void) { return true; }
int WaitForFrame(int sync_delay) { return 0; }
};
#endif /* VSYNC_H_INCLUDED */

0 comments on commit 7bd0b54

Please sign in to comment.