Browse files

Live TV: Ensure embedding is preserved through video re-initialisation.

There are still issues with both OpenGL and VDPAU playback embedding
when we transition from the live-tv dummy playback.

Refs #9573
  • Loading branch information...
1 parent feea745 commit 91e5d353b73113356272df2d5e944b0b82897385 Mark Kendall committed Mar 19, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 mythtv/libs/libmythtv/videooutbase.cpp
View
13 mythtv/libs/libmythtv/videooutbase.cpp
@@ -400,6 +400,14 @@ bool VideoOutput::Init(int width, int height, float aspect, WId winid,
(void)embedid;
video_codec_id = codec_id;
+ bool wasembedding = window.IsEmbedding();
+ QRect oldrect;
+ if (wasembedding)
+ {
+ oldrect = window.GetDisplayVisibleRect();
+ StopEmbedding();
+ }
+
bool mainSuccess = window.Init(
QSize(width, height), aspect,
QRect(winx, winy, winw, winh),
@@ -414,6 +422,11 @@ bool VideoOutput::Init(int width, int height, float aspect, WId winid,
adjustfill = db_adjustfill >= kAdjustFill_AutoDetect_DefaultOff ?
(AdjustFillMode) (db_adjustfill - kAdjustFill_AutoDetect_DefaultOff) : db_adjustfill;
*/
+ if (wasembedding)
+ {
+ VERBOSE(VB_PLAYBACK, LOC + "Restoring embedded playback");
+ EmbedInWidget(oldrect.x(), oldrect.y(), oldrect.width(), oldrect.height());
+ }
VideoAspectRatioChanged(aspect); // apply aspect ratio and letterbox mode

0 comments on commit 91e5d35

Please sign in to comment.