diff -uNr 7400/mediaportal/Core/Player/PlaneScene.cs 7401/mediaportal/Core/Player/PlaneScene.cs
--- 7400/mediaportal/Core/Player/PlaneScene.cs	2006-05-25 23:50:29.000000000 +0200
+++ 7401/mediaportal/Core/Player/PlaneScene.cs	2006-05-25 23:57:32.000000000 +0200
@@ -105,6 +105,7 @@
     static bool _reEntrant = false;
     bool _drawVideoAllowed = true;
     int _debugStep = 0;
+      Texture blackTexture;
     #endregion
 
     #region ctor
@@ -120,6 +121,24 @@
                                     4, GUIGraphicsContext.DX9Device,
                                     0, CustomVertex.TransformedColoredTextured.Format,
                                     Pool.Managed);
+
+      float _texUoff, _texVoff, _texUmax, _texVmax;
+      int _textureWidth, _textureHeight;
+      int _packedTextureNo;
+
+      if (GUITextureManager.GetPackedTexture("black.bmp", out _texUoff, out _texVoff, out _texUmax, out _texVmax, out _textureWidth, out _textureHeight, out blackTexture, out _packedTextureNo))
+      {
+          return;
+      }
+
+      int iImages = GUITextureManager.Load("black.bmp", 1, 15,15);
+      if (0 == iImages)
+      {
+          blackTexture = null;// unable to load texture
+          return;
+      }
+      CachedTexture.Frame frame = GUITextureManager.GetTexture("black.bmp", 0, out _textureWidth, out _textureHeight);
+      blackTexture = frame.Image;
     }
     #endregion
 
@@ -223,19 +242,29 @@
     /// </summary>
     public void Deinit()
     {
+
       GUILayerManager.UnRegisterLayer(this);
       if (_renderTarget != null)
       {
-        //VMR9 changes the directx 9 render target. Thats why we set it back to what it was
-        GUIGraphicsContext.DX9Device.SetRenderTarget(0, _renderTarget);
+          //VMR9 changes the directx 9 render target. Thats why we set it back to what it was
+          if (!_renderTarget.Disposed)
+              GUIGraphicsContext.DX9Device.SetRenderTarget(0, _renderTarget);
         _renderTarget.Dispose();
         _renderTarget = null;
       }
       if (_vertexBuffer != null)
       {
-        _vertexBuffer.Dispose();
+          _vertexBuffer.Dispose();
         _vertexBuffer = null;
       }
+      if (blackTexture != null)
+      {
+          if (GUITextureManager.IsTemporary("black.bmp"))
+          {
+              GUITextureManager.ReleaseTexture("black.bmp");
+          }
+          blackTexture = null;
+      }
     }
 
     /// <summary>
@@ -404,7 +433,6 @@
       if (GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.STOPPING) return;
       if (!_isEnabled) return;
       if (_stopPainting) return;
-      //			Log.Write("scene.repaint");
       try
       {
 
@@ -441,7 +469,7 @@
     {
       try
       {
-        _textureAddress = pTex;
+          _textureAddress = pTex;
         if (pTex == 0)
         {
           //Log.Write("PlaneScene: dispose surfaces");
@@ -506,6 +534,7 @@
 
     private void InternalPresentImage(int width, int height, int arWidth, int arHeight, bool isRepaint)
     {
+
       if (_reEntrant)
       {
         Log.WriteFile(Log.LogType.Log, true, "PlaneScene: re-entrancy in presentimage");
@@ -686,7 +715,13 @@
 
         _debugStep = 5;
         //clear screen
-        GUIGraphicsContext.DX9Device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);
+        try
+        {
+            GUIGraphicsContext.DX9Device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);
+        }
+        catch (Exception)
+        {
+        }
         _debugStep = 6;
         GUIGraphicsContext.DX9Device.BeginScene();
         _debugStep = 7;
@@ -783,16 +818,28 @@
     #region IRenderLayer members
     public void RenderLayer(float timePassed)
     {
-      //Render video texture
-      if (_renderTexture == false) return;
-      if (_surfaceAdress != 0)
-      {
-        DrawSurface(_surfaceAdress, _fx, _fy, _nw, _nh, _uoff, _voff, _umax, _vmax, _diffuseColor);
-      }
-      if (_textureAddress != 0)
-      {
-        DrawTexture(_textureAddress, _fx, _fy, _nw, _nh, _uoff, _voff, _umax, _vmax, _diffuseColor);
-      }
+        if (VideoRendererStatistics.VideoState == VideoRendererStatistics.State.VideoPresent)
+        {
+            //Render video texture
+            if (_renderTexture == false) return;
+            if (_surfaceAdress != 0)
+            {
+                DrawSurface(_surfaceAdress, _fx, _fy, _nw, _nh, _uoff, _voff, _umax, _vmax, _diffuseColor);
+            }
+            if (_textureAddress != 0)
+            {
+                DrawTexture(_textureAddress, _fx, _fy, _nw, _nh, _uoff, _voff, _umax, _vmax, _diffuseColor);
+            }
+        }
+        else
+        {
+            IntPtr ptr = DShowNET.Helper.DirectShowUtil.GetUnmanagedTexture(blackTexture);
+            uint _blackTextureAddress = (uint)ptr.ToInt32();
+            if (_blackTextureAddress != 0)
+            {
+                DrawTexture(_blackTextureAddress, _fx, _fy, _nw, _nh, _uoff, _voff, _umax, _vmax, _diffuseColor);
+            }
+        }
     }
     public bool ShouldRenderLayer()
     {
diff -uNr 7400/mediaportal/Core/guilib/GUIWindowManager.cs 7401/mediaportal/Core/guilib/GUIWindowManager.cs
--- 7400/mediaportal/Core/guilib/GUIWindowManager.cs	2006-05-25 23:50:25.000000000 +0200
+++ 7401/mediaportal/Core/guilib/GUIWindowManager.cs	2006-05-25 23:57:32.000000000 +0200
@@ -864,9 +864,9 @@
     {
 			try
 			{
-				if (_activeWindowIndex >=0) 
+				if (ActiveWindowEx >=0) 
 				{
-					GUIWindow pWindow=_listWindows[_activeWindowIndex];
+					GUIWindow pWindow=GetWindow(ActiveWindowEx);
 					if (null!=pWindow) 
 					{
 						pWindow.Process();
diff -uNr 7400/mediaportal/Dialogs/Dialogs/GUIDialogMenu.cs 7401/mediaportal/Dialogs/Dialogs/GUIDialogMenu.cs
--- 7400/mediaportal/Dialogs/Dialogs/GUIDialogMenu.cs	2006-05-25 23:49:54.000000000 +0200
+++ 7401/mediaportal/Dialogs/Dialogs/GUIDialogMenu.cs	2006-05-25 23:57:32.000000000 +0200
@@ -53,6 +53,8 @@
     bool m_bPrevOverlay = false;
     //bool needRefresh = false;
     DateTime vmr7UpdateTimer = DateTime.Now;
+    DateTime keyTimer = DateTime.Now;
+    string keySelection = string.Empty;
 
     public GUIDialogMenu()
     {
@@ -76,7 +78,7 @@
     public override void OnAction(Action action)
     {
       //      needRefresh = true;
-      int iSelection;
+      char key = (char)0;
       if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU || action.wID == Action.ActionType.ACTION_CONTEXT_MENU)
       {
         Close();
@@ -86,37 +88,64 @@
       // if we have a keypress or a remote button press
       if ((action.wID == Action.ActionType.ACTION_KEY_PRESSED) || ((Action.ActionType.REMOTE_0 <= action.wID) && (Action.ActionType.REMOTE_9 >= action.wID)))
       {
-        iSelection = -1;
         if (action.m_key != null)
         {
-          if (action.m_key.KeyChar > '0' && action.m_key.KeyChar <= '9')
+          if (action.m_key.KeyChar >= '0' && action.m_key.KeyChar <= '9')
           {
             // Get offset to item
-            iSelection = action.m_key.KeyChar - '1';
+            key = (char)action.m_key.KeyChar;
           }
         }
         else
         {
-          iSelection = (action.wID - Action.ActionType.REMOTE_1);
+          key = ((char)('0'+ action.wID - Action.ActionType.REMOTE_0));
         }
-
-        if (iSelection >= 0 && iSelection < listItems.Count)
+        if (key == (char)0) return;
+        keySelection += key;
+        if (keySelection.Length == listItems.Count.ToString().Length)
         {
-          // Select dialog item
-          GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SETFOCUS, GetID, 0, listView.GetID, 0, 0, null);
-          OnMessage(msg);
-          msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GetID, 0, listView.GetID, iSelection, 0, null);
-          OnMessage(msg);
-          msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, GetID, listView.GetID, 0, 0, 0, null);
-          OnMessage(msg);
+            selectOpcion(keySelection);
+            keySelection = string.Empty;
+            return;
         }
+        keyTimer = DateTime.Now;
         return;
-
-
       }
 
       base.OnAction(action);
     }
+      public void selectOpcion(string keySelected)
+      {
+          int selected;
+          try
+          {
+              selected = int.Parse(keySelected)-1;
+          }
+          catch (Exception)
+          {
+              selected = -1;
+          }
+          if (selected >= 0 && selected < listItems.Count)
+          {
+              // Select dialog item
+              GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SETFOCUS, GetID, 0, listView.GetID, 0, 0, null);
+              OnMessage(msg);
+              msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GetID, 0, listView.GetID, selected, 0, null);
+              OnMessage(msg);
+              msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, GetID, listView.GetID, 0, 0, 0, null);
+              OnMessage(msg);
+          }
+      }
+      public override void Process()
+      {
+          if (keySelection == string.Empty) return;
+          TimeSpan ts = DateTime.Now - keyTimer;
+          if (ts.TotalMilliseconds>= 1000)
+          {
+              selectOpcion(keySelection);
+              keySelection = string.Empty;
+          }
+      }
  
     void Close()
     {
@@ -245,7 +274,7 @@
     {
       int iItemIndex = listItems.Count + 1;
       GUIListItem pItem = new GUIListItem();
-      if (iItemIndex < 10 && showQuickNumbers)
+      if (showQuickNumbers)
         pItem.Label = iItemIndex.ToString() + " " + strLabel;
       else
         pItem.Label = strLabel;
@@ -257,7 +286,7 @@
     public void Add(GUIListItem pItem)
     {
       int iItemIndex = listItems.Count + 1;
-      if (iItemIndex < 10 && showQuickNumbers)
+      if (showQuickNumbers)
         pItem.Label = iItemIndex.ToString() + " " + pItem.Label;
       else
         pItem.Label = pItem.Label;
@@ -274,15 +303,16 @@
     public void AddLocalizedString(int iLocalizedString)
     {
       int iItemIndex = listItems.Count + 1;
+      GUIListItem pItem = new GUIListItem();
       if (showQuickNumbers)
       {
-        GUIListItem pItem = new GUIListItem(iItemIndex.ToString() + " " + GUILocalizeStrings.Get(iLocalizedString));
+        pItem.Label = iItemIndex.ToString() + " " + GUILocalizeStrings.Get(iLocalizedString);
         pItem.ItemId = iLocalizedString;
         listItems.Add(pItem);
       }
       else
       {
-        GUIListItem pItem = new GUIListItem(GUILocalizeStrings.Get(iLocalizedString));
+        pItem.Label = GUILocalizeStrings.Get(iLocalizedString);
         pItem.ItemId = iLocalizedString;
         listItems.Add(pItem);
       }
diff -uNr 7400/mediaportal/Dialogs/Dialogs/GUIDialogMenuBottomRight.cs 7401/mediaportal/Dialogs/Dialogs/GUIDialogMenuBottomRight.cs
--- 7400/mediaportal/Dialogs/Dialogs/GUIDialogMenuBottomRight.cs	2006-05-25 23:49:54.000000000 +0200
+++ 7401/mediaportal/Dialogs/Dialogs/GUIDialogMenuBottomRight.cs	2006-05-25 23:57:32.000000000 +0200
@@ -60,6 +60,10 @@
     string selectedItemLabel = String.Empty;
     ArrayList listItems = new ArrayList();
     bool m_bPrevOverlay = false;
+      bool showQuickNumbers = true;
+      DateTime keyTimer = DateTime.Now;
+      string keySelection = string.Empty;
+
 
     public GUIDialogMenuBottomRight()
     {
@@ -83,43 +87,75 @@
     public override void OnAction(Action action)
     {
       //needRefresh = true;
-      int iSelection;
+      char key = (char)0;
       if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU || action.wID == Action.ActionType.ACTION_CONTEXT_MENU)
       {
         Close();
         return;
       }
 
-      if (action.wID == Action.ActionType.ACTION_KEY_PRESSED)
+      if ((action.wID == Action.ActionType.ACTION_KEY_PRESSED) || ((Action.ActionType.REMOTE_0 <= action.wID) && (Action.ActionType.REMOTE_9 >= action.wID)))
       {
-        if (action.m_key != null)
-        {
-          if (action.m_key.KeyChar > '0' && action.m_key.KeyChar <= '9')
-          {
-            // Get offset to item
-            iSelection = action.m_key.KeyChar - '1';
-            if (iSelection < listItems.Count)
+            if (action.m_key != null)
             {
-              // Select dialog item
-              GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SETFOCUS, GetID, 0, listView.GetID, 0, 0, null);
-              OnMessage(msg);
-              msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GetID, 0, listView.GetID, iSelection, 0, null);
-              OnMessage(msg);
-              msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, GetID, listView.GetID, 0, 0, 0, null);
-              OnMessage(msg);
+              if (action.m_key.KeyChar >= '0' && action.m_key.KeyChar <= '9')
+              {
+                // Get offset to item
+                key = (char)action.m_key.KeyChar;
+              }
             }
             else
             {
-              // Exit dialog box
-              Close();
+              key = (char)('0'+action.wID - Action.ActionType.REMOTE_0);
+            }
+            if (key == (char)0) return;
+            keySelection += key;
+            if (keySelection.Length == listItems.Count.ToString().Length)
+            {
+                selectOpcion(keySelection);
+                keySelection = string.Empty;
+                return;
             }
+            keyTimer = DateTime.Now;
             return;
-          }
-        }
       }
 
       base.OnAction(action);
     }
+      public void selectOpcion(string keySelected)
+      {
+          int selected;
+          try
+          {
+              selected = int.Parse(keySelected) - 1;
+          }
+          catch (Exception)
+          {
+              selected = -1;
+          }
+
+          if (selected >= 0 && selected < listItems.Count)
+          {
+              // Select dialog item
+              GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SETFOCUS, GetID, 0, listView.GetID, 0, 0, null);
+              OnMessage(msg);
+              msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GetID, 0, listView.GetID, selected, 0, null);
+              OnMessage(msg);
+              msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_CLICKED, GetID, listView.GetID, 0, 0, 0, null);
+              OnMessage(msg);
+          }
+      }
+      public override void Process()
+      {
+          if (keySelection == string.Empty) return;
+          TimeSpan ts = DateTime.Now - keyTimer;
+          if (ts.TotalMilliseconds >= 1000)
+          {
+              selectOpcion(keySelection);
+              keySelection = string.Empty;
+          }
+      }
+
 
     #region Base Dialog Members
 
@@ -260,12 +296,14 @@
       timeoutInSeconds = -1;
       selectedItemIndex = -1;
       listItems.Clear();
+      showQuickNumbers = true;
+
     }
 
     public void Add(GUIListItem pItem)
     {
       int iItemIndex = listItems.Count + 1;
-      if (iItemIndex < 10)
+      if (showQuickNumbers)
         pItem.Label = iItemIndex.ToString() + " " + pItem.Label;
       else
         pItem.Label = pItem.Label;
@@ -277,18 +315,38 @@
     public void Add(string strLabel)
     {
       int iItemIndex = listItems.Count + 1;
-      GUIListItem pItem = new GUIListItem(iItemIndex.ToString() + " " + strLabel);
+      GUIListItem pItem = new GUIListItem();
+      if (showQuickNumbers)
+          pItem.Label = iItemIndex.ToString() + " " + strLabel;
+      else
+          pItem.Label = strLabel;
       pItem.ItemId = iItemIndex;
       listItems.Add(pItem);
     }
 
     public void AddLocalizedString(int iLocalizedString)
     {
-      int iItemIndex = listItems.Count + 1;
-      GUIListItem pItem = new GUIListItem(iItemIndex.ToString() + " " + GUILocalizeStrings.Get(iLocalizedString));
-      pItem.ItemId = iLocalizedString;
-      listItems.Add(pItem);
+        int iItemIndex = listItems.Count + 1;
+        GUIListItem pItem = new GUIListItem();
+        if (showQuickNumbers)
+        {
+            pItem.Label = iItemIndex.ToString() + " " + GUILocalizeStrings.Get(iLocalizedString);
+            pItem.ItemId = iLocalizedString;
+            listItems.Add(pItem);
+        }
+        else
+        {
+            pItem.Label = GUILocalizeStrings.Get(iLocalizedString);
+            pItem.ItemId = iLocalizedString;
+            listItems.Add(pItem);
+        }
     }
+      public bool ShowQuickNumbers
+      {
+          get { return showQuickNumbers; }
+          set { showQuickNumbers = value; }
+      }
+
 
     public int SelectedLabel
     {
diff -uNr 7400/mediaportal/Dialogs/Dialogs/GUIDialogNotify.cs 7401/mediaportal/Dialogs/Dialogs/GUIDialogNotify.cs
--- 7400/mediaportal/Dialogs/Dialogs/GUIDialogNotify.cs	2006-05-25 23:49:54.000000000 +0200
+++ 7401/mediaportal/Dialogs/Dialogs/GUIDialogNotify.cs	2006-05-25 23:57:32.000000000 +0200
@@ -50,8 +50,10 @@
 
     bool m_bPrevOverlay = false;
     int timeOutInSeconds = 8;
-    //bool needRefresh = false;
     DateTime vmr7UpdateTimer = DateTime.Now;
+    bool m_bNeedRefresh = false;
+      string logoUrl = string.Empty;
+
 
     public GUIDialogNotify()
     {
@@ -173,6 +175,11 @@
             base.OnMessage(message);
             GUIGraphicsContext.Overlay = base.IsOverlayAllowed;
             GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog);
+            if (imgLogo != null)
+            {
+                SetImage(logoUrl);
+            }
+
           }
           return true;
 
@@ -187,8 +194,8 @@
       AllocResources();
       InitControls();
       timeOutInSeconds = 5;
+      logoUrl = string.Empty;
     }
-
     public void SetHeading(string strLine)
     {
       LoadSkin();
@@ -211,13 +218,28 @@
     }
     public void SetImage(string filename)
     {
-
-      imgLogo.FreeResources();
-      imgLogo.SetFileName(filename);
-      imgLogo.AllocResources();
+        logoUrl = filename;
+        if (System.IO.File.Exists(filename))
+        {
+            if (imgLogo != null)
+            {
+                imgLogo.SetFileName(filename);
+                m_bNeedRefresh = true;
+                imgLogo.IsVisible = true;
+            }
+        }
+        else
+        {
+            if (imgLogo != null)
+            {
+                imgLogo.IsVisible = false;
+                m_bNeedRefresh = true;
+            }
+        }
     }
     public void SetImageDimensions(Size size, bool keepAspectRatio,bool centered)
     {
+      if (imgLogo == null) return;
       imgLogo.Width = size.Width;
       imgLogo.Height = size.Height;
       imgLogo.KeepAspectRatio = keepAspectRatio;
@@ -236,6 +258,16 @@
       }
 
     }
+      public override bool NeedRefresh()
+      {
+          if (m_bNeedRefresh)
+          {
+              m_bNeedRefresh = false;
+              return true;
+          }
+          return false;
+      }
+
     #region IRenderLayer
     public bool ShouldRenderLayer()
     {
diff -uNr 7400/mediaportal/TVCapture/DVBDemuxer.cs 7401/mediaportal/TVCapture/DVBDemuxer.cs
--- 7400/mediaportal/TVCapture/DVBDemuxer.cs	2006-05-25 23:50:08.000000000 +0200
+++ 7401/mediaportal/TVCapture/DVBDemuxer.cs	2006-05-25 23:57:32.000000000 +0200
@@ -197,7 +197,6 @@
     // card
     static int _currentDVBCard = 0;
     static NetworkType _currentNetworkType;
-    bool _packetsReceived = false;
     //DVBSectionHeader m_sectionHeader=new DVBSectionHeader();
     bool _grabTeletext = false;
 
@@ -285,7 +284,8 @@
 
     public void SetChannelData(int audio, int video, int ac3,int teletext, int subtitle, string channelName, int pmtPid, int programnumber)
     {
-      _packetsReceived = false;
+      _isReceivingPackets = false;
+      _numberOfPacketsReceived = 0;
       _programNumber = -1;
       if (programnumber > 0)
         _programNumber = programnumber;
@@ -337,7 +337,7 @@
         channelName, _pidMp2Audio, _pidVideo, _pidTeletext, _pidPmt, _pidSubtitle, _programNumber);
 
     }
-    public bool RecevingPackets
+    public bool ReceivingPackets
     {
       get { return _isReceivingPackets; }
     }
@@ -364,34 +364,24 @@
     }
     public void Process()
     {
-      TimeSpan ts = DateTime.Now - _packetTimer;
-      if (!_isReceivingPackets && _numberOfPacketsReceived > 0)
-      {
-        _isReceivingPackets = true;
-        Log.Write("DVBDemuxer:receiving DVB packets");
-      }
-      if (ts.TotalMilliseconds >= 1000)
-      {
-        if (_isReceivingPackets && _numberOfPacketsReceived == 0)
+        if (_isReceivingPackets)
         {
-          _isReceivingPackets = false;
-          Log.Write("DVBDemuxer:stopped receiving DVB packets");
+            TimeSpan ts = DateTime.Now - _packetTimer;
+            if (ts.TotalMilliseconds >= 1000)
+            {
+                _isReceivingPackets = false;
+                _numberOfPacketsReceived = 0;
+                Log.Write("DVBDemuxer:stopped receiving DVB packets");
+            }
         }
-
-        //Log.Write("DVBDemuxer: receiving:{0} #:{1}", _isReceivingPackets,_numberOfPacketsReceived);
-
-        _numberOfPacketsReceived = 0;
-        _packetTimer = DateTime.Now;
-      }
-
-			if (_ac3Present)
-			{
-				ts = DateTime.Now - _ac3Timer;
-				if (ts.TotalSeconds >= 2)
-				{
-					_ac3Present=false;
-				}
-			}
+        if (_ac3Present)
+        {
+	        TimeSpan ts = DateTime.Now - _ac3Timer;
+	        if (ts.TotalSeconds >= 2)
+	        {
+		        _ac3Present=false;
+	        }
+	    }
     }
 
     #endregion
@@ -668,8 +658,6 @@
     public void ProcessPacket(IntPtr ptr)
     {
       if (ptr == IntPtr.Zero) return;
-      _numberOfPacketsReceived++;
-
       _packetHeader = m_tsHelper.GetHeader((IntPtr)ptr);
       if (_packetHeader.SyncByte != 0x47)
       {
@@ -701,7 +689,6 @@
         }
       }
 
-      _numberOfPacketsReceived++;
       // teletext
       if (_grabTeletext)
       {
@@ -711,10 +698,12 @@
         }
       }
 
-      if (_packetsReceived == false)
+      if (!_isReceivingPackets)
       {
-        _packetsReceived = true;
+        _isReceivingPackets = true;
       }
+      _numberOfPacketsReceived++;
+      _packetTimer = DateTime.Now;
 
     }
 
diff -uNr 7400/mediaportal/TVCapture/DVBGraphBDA.cs 7401/mediaportal/TVCapture/DVBGraphBDA.cs
--- 7400/mediaportal/TVCapture/DVBGraphBDA.cs	2006-05-25 23:50:08.000000000 +0200
+++ 7401/mediaportal/TVCapture/DVBGraphBDA.cs	2006-05-25 23:57:32.000000000 +0200
@@ -272,11 +272,11 @@
     bool _isUsingAC3 = false;
     bool _isOverlayVisible = true;
     DateTime _signalLostTimer = DateTime.Now;
-    DateTime _signalLostTimer2 = DateTime.Now;
     int _pmtRetyCount = 0;
     int _signalQuality;
     int _signalLevel;
     bool _signalPresent;
+    bool _tunerLocked;
     DateTime _pmtTimer;
     //bool										_graphIsPaused;
 
@@ -2065,6 +2065,20 @@
     {
       return _signalPresent;
     }
+    /// <summary>
+    /// returns true if tuner is locked to a frequency and signalstrength/quality is > 0
+    /// </summary>
+    /// <returns>
+    /// true: tuner has a signal and is locked
+    /// false: tuner is not locked
+    /// </returns>
+    /// <remarks>
+    /// Graph should be created and GetTunerSignalStatistics() should be called
+    /// </remarks>
+    public bool TunerLocked()
+    {
+        return _tunerLocked;
+    }
 
     void UpdateSignalPresent()
     {
@@ -2147,13 +2161,16 @@
         {
           //Log.WriteFile(Log.LogType.Log, true, "DVBGraphBDA:UpdateSignalPresent() quality :{0}", ex.Message);
         }
-
-        if (GUIGraphicsContext.DX9Device == null)
-          Log.WriteFile(Log.LogType.Capture, "  #{0}  locked:{1} present:{2} quality:{3}", i, isLocked, isPresent, quality);
+        //Log.WriteFile(Log.LogType.Log, "  #{0}  locked:{1} present:{2} quality:{3} strength:{4}", i, isLocked, isPresent, quality, strength);
       }
-
-      _signalQuality = (int)signalQuality;
-      _signalLevel = (int)signalStrength;
+      if (_tunerStatistics.Count>0) {
+          _signalQuality = (int)signalQuality / _tunerStatistics.Count;
+          _signalLevel = (int)signalStrength / _tunerStatistics.Count;
+      }
+      if (isTunerLocked)
+          _tunerLocked = true;
+      else
+          _tunerLocked = false;
 
       //some devices give different results about signal status
       //on some signalpresent is only true when tuned to a channel
@@ -2166,20 +2183,15 @@
           _signalPresent = true;
         else
           _signalPresent = false;
-        return;
       }
-      if (GUIGraphicsContext.DX9Device == null)
-        Log.WriteFile(Log.LogType.Capture, "  locked:{0} present:{1} quality:{2}", isTunerLocked, isSignalPresent, signalQuality);
-      if (isTunerLocked || isSignalPresent || (_signalQuality > 0))
-      {
-        _signalPresent = true;
-        if (GUIGraphicsContext.DX9Device == null)
-          Log.WriteFile(Log.LogType.Log, "DVBGraphBDA:UpdateSignalPresent() signal=present");
-        return;
+      else if (isTunerLocked || isSignalPresent || (_signalQuality > 0))
+      {
+          _signalPresent = true;
+      }
+      else
+      {
+          _signalPresent = false;
       }
-      if (GUIGraphicsContext.DX9Device == null)
-        Log.WriteFile(Log.LogType.Log, "DVBGraphBDA:UpdateSignalPresent() signal=not present");
-      _signalPresent = false;
     }//public bool SignalPresent()
 
     public int SignalQuality()
@@ -3529,39 +3541,44 @@
     {
       bool isViewing = Recorder.IsCardViewing(_cardId);
       if (!isViewing) return;
-      TimeSpan ts = DateTime.Now - _signalLostTimer;
-
-      if (ts.TotalSeconds < 10)
-      {
-        VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
-        _signalLostTimer2 = DateTime.Now;
-        return;
-      }
-      //check if this card is used for watching tv
-      ts = DateTime.Now - _signalLostTimer2;
-      if (ts.TotalSeconds < 2) return;
-      _signalLostTimer2 = DateTime.Now;
-
-      //Log.Write("packets:{0} pmt:{1:X}  vmr9:{2} fps:{3} locked:{4} quality:{5} level:{6}",
-      //	_streamDemuxer.RecevingPackets,_lastPMTVersion,GUIGraphicsContext.Vmr9Active ,GUIGraphicsContext.Vmr9FPS,SignalPresent(), SignalQuality(), SignalStrength());
+//      Log.Write("packets:{0} pmt:{1:X}  vmr9:{2} fps:{3} locked:{4} quality:{5} level:{6}",
+  //      _streamDemuxer.ReceivingPackets, _lastPMTVersion, GUIGraphicsContext.Vmr9Active, GUIGraphicsContext.Vmr9FPS, TunerLocked(), SignalQuality(), SignalStrength());
 
       // do we receive any packets?
-      if (!_streamDemuxer.RecevingPackets)
+      if (!_streamDemuxer.ReceivingPackets)
       {
-        //no, then state = no signal
-        VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+          TimeSpan ts = DateTime.Now - _signalLostTimer;
+          if (ts.TotalSeconds < 5)
+          {
+            VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+            return;
+          }
+          //no, then state = no signal
+          VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+          return;
       }
-      else
+      else  if (_streamDemuxer.IsScrambled)
       {
-        // we receive packets, got a PMT.
-        // is channel scrambled ?
-        if (_streamDemuxer.IsScrambled)
-        {
           VideoRendererStatistics.VideoState = VideoRendererStatistics.State.Scrambled;
-        }
-        else
-          VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+          _signalLostTimer = DateTime.Now;
+          return;
+      } 
+      else if (GUIGraphicsContext.Vmr9Active && GUIGraphicsContext.Vmr9FPS < 1f)
+      {
+            if ((g_Player.Playing && !g_Player.Paused) || (!g_Player.Playing))
+            {
+                TimeSpan ts = DateTime.Now - _signalLostTimer;
+                if (ts.TotalSeconds < 5)
+                {
+                    VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+                    return;
+                }
+                VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+                return;
+            }
       }
+      VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+      _signalLostTimer = DateTime.Now;
     }
 
     public void Process()
@@ -3569,13 +3586,6 @@
       if (_graphState == State.None) return;
 
 
-      if (_graphState == State.Viewing)
-      {
-        if (GUIGraphicsContext.Vmr9Active && _vmr9 != null)
-        {
-          _vmr9.Process();
-        }
-      }
 
       UpdateSignalPresent();
       if (_graphState == State.Created) return;
@@ -3601,6 +3611,13 @@
       {
         UpdateVideoState();
 
+        if (_graphState == State.Viewing)
+        {
+            if (GUIGraphicsContext.Vmr9Active && _vmr9 != null)
+            {
+                _vmr9.Process();
+            }
+        }
 
         TimeSpan ts = DateTime.Now - _updateTimer;
 
@@ -4008,10 +4025,8 @@
                                             _currentTuningObject.VideoPid, _currentTuningObject.PMTPid,
                                             _currentTuningObject.AC3Pid, _currentTuningObject.TeletextPid);
 
-
         SendPMT();
         _refreshPmtTable = true;
-
         _lastPMTVersion = -1;
         _pmtRetyCount = 0;
         _analyzerInterface.ResetParser();
@@ -4019,15 +4034,12 @@
         Log.WriteFile(Log.LogType.Capture, false, "DVBGraphBDA:set mpeg2demuxer video:0x{0:x} audio:0x{1:X} ac3:0x{2:X}",
                         _currentTuningObject.VideoPid, _currentTuningObject.AudioPid, _currentTuningObject.AC3Pid);
         SetupDemuxer(_pinDemuxerVideo, _currentTuningObject.VideoPid, _pinDemuxerAudio, _currentTuningObject.AudioPid, _pinAC3Out, _currentTuningObject.AC3Pid);
-
         if (_streamDemuxer != null)
         {
-          _streamDemuxer.OnTuneNewChannel();
-          _streamDemuxer.SetChannelData(_currentTuningObject.AudioPid, _currentTuningObject.VideoPid, _currentTuningObject.AC3Pid, _currentTuningObject.TeletextPid, _currentTuningObject.Audio3, _currentTuningObject.ServiceName, _currentTuningObject.PMTPid, _currentTuningObject.ProgramNumber);
-
+            _streamDemuxer.SetChannelData(_currentTuningObject.AudioPid, _currentTuningObject.VideoPid, _currentTuningObject.AC3Pid, _currentTuningObject.TeletextPid, _currentTuningObject.Audio3, _currentTuningObject.ServiceName, _currentTuningObject.PMTPid, _currentTuningObject.ProgramNumber);
+            _streamDemuxer.OnTuneNewChannel();
         }
-
-      }
+    }
       finally
       {
 #if USEMTSWRITER
diff -uNr 7400/mediaportal/TVCapture/DVBGraphSS2.cs 7401/mediaportal/TVCapture/DVBGraphSS2.cs
--- 7400/mediaportal/TVCapture/DVBGraphSS2.cs	2006-05-25 23:50:08.000000000 +0200
+++ 7401/mediaportal/TVCapture/DVBGraphSS2.cs	2006-05-25 23:57:32.000000000 +0200
@@ -292,8 +292,7 @@
     int _aspectRatioY = 1;
     bool _isUsingAc3 = false;
     int _lastPmtVersion = -1;
-    DateTime _timerSignalLost;
-    DateTime _timerSignalLost2;
+    DateTime _signalLostTimer;
 
     DateTime _timeDisplayed = DateTime.Now;
 
@@ -1859,7 +1858,7 @@
       finally
       {
         if (_vmr9 != null) _vmr9.Enable(true);
-        _timerSignalLost = DateTime.Now;
+        _signalLostTimer = DateTime.Now;
         if (_interfaceStreamBufferSink != null)
         {
           long refTime = 0;
@@ -2345,38 +2344,44 @@
       //check if this card is used for watching tv
       bool isViewing = Recorder.IsCardViewing(_cardId);
       if (!isViewing) return;
-      TimeSpan ts = DateTime.Now - _timerSignalLost;
-
-      if (ts.TotalSeconds < 10)
-      {
-        VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
-        _timerSignalLost2 = DateTime.Now;
-        return;
-      }
-      ts = DateTime.Now - _timerSignalLost2;
-      if (ts.TotalSeconds < 2) return;
-      _timerSignalLost2 = DateTime.Now;
-
-      //			Log.Write("demuxer:{0} signal:{1} fps:{2}",_dvbDemuxer.RecevingPackets,SignalPresent() ,GUIGraphicsContext._vmr9FPS);
 
       // do we receive any packets?
-      if (!_dvbDemuxer.RecevingPackets)
+      if (!_dvbDemuxer.ReceivingPackets)
       {
-        //no, then state = no signal
-        VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+          TimeSpan ts = DateTime.Now - _signalLostTimer;
+          if (ts.TotalSeconds < 5)
+          {
+              VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+              return;
+          }
+          //no, then state = no signal
+          VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+          return;
       }
-      else
+      else if (_dvbDemuxer.IsScrambled)
       {
-        // we receive packets, got a PMT.
-        // is channel scrambled ?
-        if (_dvbDemuxer.IsScrambled)
-        {
           VideoRendererStatistics.VideoState = VideoRendererStatistics.State.Scrambled;
-        }
-        else
-          VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+          _signalLostTimer = DateTime.Now;
+          return;
       }
-    }
+      else if (GUIGraphicsContext.Vmr9Active && GUIGraphicsContext.Vmr9FPS < 1f)
+      {
+          if ((g_Player.Playing && !g_Player.Paused) || (!g_Player.Playing))
+          {
+              TimeSpan ts = DateTime.Now - _signalLostTimer;
+              if (ts.TotalSeconds < 5)
+              {
+                  VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+                  return;
+              }
+
+              VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+              return;
+          }
+      }
+      VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+      _signalLostTimer = DateTime.Now;
+  }
 
     public void Process()
     {
diff -uNr 7400/mediaportal/TVCapture/Scanning/AnalogTVTuning.cs 7401/mediaportal/TVCapture/Scanning/AnalogTVTuning.cs
--- 7400/mediaportal/TVCapture/Scanning/AnalogTVTuning.cs	2006-05-25 23:50:07.000000000 +0200
+++ 7401/mediaportal/TVCapture/Scanning/AnalogTVTuning.cs	2006-05-25 23:57:32.000000000 +0200
@@ -110,24 +110,16 @@
                 float percent = (((float)currentChannel)-(float)minChannel) / ((float)maxChannel-(float)minChannel);
                 percent *= 100.0f;
                 callback.OnProgress((int)percent);
-                TuneChannel();
                 float frequency = (float)captureCard.VideoFrequency();
-                if (frequency != lastFrequency)
-                {
-                    lastFrequency = frequency;
-                    frequency /= 1000000f;
-                    string description = String.Format("channel:{0} frequency:{1:###.##} MHz.", currentChannel, frequency);
-                    callback.OnStatus(description);
-                    callback.OnSignal(captureCard.SignalQuality, captureCard.SignalStrength);
-                    if (captureCard.SignalPresent())
-                    {
-                        callback.OnNewChannel();
-                        return;
-                    }
-                }
-                else
+                frequency /= 1000000f;
+                string description = String.Format("channel:{0} frequency:{1:###.##} MHz.", currentChannel, frequency);
+                callback.OnStatus(description);
+                TuneChannel();
+                callback.OnSignal(captureCard.SignalQuality, captureCard.SignalStrength);
+                if (captureCard.SignalPresent())
                 {
-                    callback.OnSignal(0, 0);
+                    callback.OnNewChannel();
+                    return;
                 }
                 Continue();
             }
diff -uNr 7400/mediaportal/TVCapture/SinkGraph.cs 7401/mediaportal/TVCapture/SinkGraph.cs
--- 7400/mediaportal/TVCapture/SinkGraph.cs	2006-05-25 23:50:08.000000000 +0200
+++ 7401/mediaportal/TVCapture/SinkGraph.cs	2006-05-25 23:57:32.000000000 +0200
@@ -79,7 +79,6 @@
     protected VideoProcAmp _videoProcAmpHelper = null;
     protected VMR9Util _vmr9 = null;
     DateTime _signalLostTimer;
-    DateTime _signalLostTimer2;
     protected string _cardName;
     ArrayList _listAudioPids = new ArrayList();
     int _selectedAudioLanguage = 11;
@@ -964,30 +963,37 @@
       //check if this card is used for watching tv
       bool isViewing = Recorder.IsCardViewing(_cardId);
       if (!isViewing) return;
-      TimeSpan ts = DateTime.Now - _signalLostTimer;
-      if (ts.TotalSeconds < 10)
-      {
-        VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
-        return;
-      }
-      ts = DateTime.Now - _signalLostTimer2;
-      if (ts.TotalSeconds < 5) return;
-      _signalLostTimer2 = DateTime.Now;
 
-      if (GUIGraphicsContext.Vmr9Active && GUIGraphicsContext.Vmr9FPS < 1f)
+      if (!SignalPresent())
       {
-        if ((g_Player.Playing && !g_Player.Paused) || (!g_Player.Playing))
-        {
+          TimeSpan ts = DateTime.Now - _signalLostTimer;
+          if (ts.TotalSeconds < 5)
+          {
+              VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+              return;
+          }
           VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
-        }
-        else
-        {
-          VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
-        }
       }
       else
-        VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
-    }
+      {
+          if (GUIGraphicsContext.Vmr9Active && GUIGraphicsContext.Vmr9FPS < 1f)
+          {
+              if ((g_Player.Playing && !g_Player.Paused) || (!g_Player.Playing))
+              {
+                  TimeSpan ts = DateTime.Now - _signalLostTimer;
+                  if (ts.TotalSeconds < 5)
+                  {
+                      VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+                      return;
+                  }
+                  VideoRendererStatistics.VideoState = VideoRendererStatistics.State.NoSignal;
+                  return;
+              }
+          }
+          _signalLostTimer = DateTime.Now;
+          VideoRendererStatistics.VideoState = VideoRendererStatistics.State.VideoPresent;
+      }
+  }
 
     public void Process()
     {
diff -uNr 7400/mediaportal/TVCapture/TVCaptureDeviceEx.cs 7401/mediaportal/TVCapture/TVCaptureDeviceEx.cs
--- 7400/mediaportal/TVCapture/TVCaptureDeviceEx.cs	2006-05-25 23:50:08.000000000 +0200
+++ 7401/mediaportal/TVCapture/TVCaptureDeviceEx.cs	2006-05-25 23:57:32.000000000 +0200
@@ -1154,7 +1154,7 @@
       if (_currentGraphState != State.Radio)
       {
         DeleteGraph();
-        CreateGraph();
+        if (!CreateGraph()) return;
         _currentGraphState = State.Radio;
         _currentGraph.StartRadio(station);
         if (_currentGraph.IsTimeShifting())
@@ -1173,7 +1173,7 @@
       if (_currentGraphState != State.Radio)
       {
         DeleteGraph();
-        CreateGraph();
+        if (!CreateGraph()) return;
         _currentGraph.StartRadio(station);
         _currentGraphState = State.Radio;
       }
@@ -1188,7 +1188,7 @@
       if (_currentGraphState != State.Radio)
       {
         DeleteGraph();
-        CreateGraph();
+        if (!CreateGraph()) return;
         RadioStation station = new RadioStation();
         _currentGraph.StartRadio(station);
         _currentGraphState = State.Radio;
@@ -1203,7 +1203,12 @@
       {
           bool deleteGraph = false;
           if (_currentGraph == null) {
-              CreateGraph();
+              if (!CreateGraph())
+              {
+                  chanmin = -1;
+                  chanmax = -1;
+                  return;
+              }
               deleteGraph = true;
           }
           _currentGraph.RadioChannelMinMax(out chanmin, out chanmax);
@@ -1218,7 +1223,12 @@
           bool deleteGraph = false;
           if (_currentGraph == null)
           {
-              CreateGraph();
+              if (!CreateGraph())
+              {
+                  chanmin = -1;
+                  chanmax = -1;
+                  return;
+              } 
               deleteGraph = true;
           }
           _currentGraph.TVChannelMinMax(out chanmin, out chanmax);
@@ -1274,7 +1284,12 @@
       {
         //Log.WriteFile(Log.LogType.Capture, "TvCaptureDevice:RebuildGraph() recreate timeshifting graph");
         _currentGraph = GraphFactory.CreateGraph(this);
-        _currentGraph.CreateGraph(Quality);
+        bool isCreated = _currentGraph.CreateGraph(Quality);
+        if (!isCreated)
+        {
+            _currentGraph = null;
+            return;
+        }
         //Log.WriteFile(Log.LogType.Capture, "TvCaptureDevice:RebuildGraph() start timeshifting");
         _currentGraph.StartTimeShifting(channel, Recorder.GetTimeShiftFileName(ID - 1));
         _lastChannelChange = DateTime.Now;
@@ -1290,7 +1305,12 @@
       {
         // Log.WriteFile(Log.LogType.Capture, "TvCaptureDevice:RebuildGraph() recreate viewing graph");
         _currentGraph = GraphFactory.CreateGraph(this);
-        _currentGraph.CreateGraph(Quality);
+        bool isCreated = _currentGraph.CreateGraph(Quality);
+        if (!isCreated)
+        {
+            _currentGraph = null;
+            return;
+        }
         _currentGraph.StartViewing(channel);
         _lastChannelChange = DateTime.Now;
       }
diff -uNr 7400/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs 7401/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs
--- 7400/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs	2006-05-25 23:53:01.000000000 +0200
+++ 7401/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs	2006-05-25 23:57:33.000000000 +0200
@@ -69,7 +69,7 @@
 			public bool  _bottomDialogMenuVisible=false;
 			public bool  wasVMRBitmapVisible=false;
 			public bool  volumeVisible=false;
-      public bool _dialogYesNoVisible = false;
+            public bool _dialogYesNoVisible = false;
 		}
 
 		bool				_infoVisible=false;
@@ -122,6 +122,8 @@
 		[SkinControlAttribute(500)]		protected GUIImage imgVolumeMuteIcon;
 		[SkinControlAttribute(501)]		protected GUIVolumeBar imgVolumeBar;
 
+      string lastChannelWithNoSignal = string.Empty;
+      VideoRendererStatistics.State videoState = VideoRendererStatistics.State.VideoPresent;
 
     enum Control 
 		{
@@ -156,6 +158,17 @@
 		{
 			GetID=(int)GUIWindow.Window.WINDOW_TVFULLSCREEN;
 		}
+
+        /// <summary>
+        /// Gets called by the runtime when a  window will be destroyed
+        /// Every window window should override this method and cleanup any resources
+        /// </summary>
+        /// <returns></returns>
+        public override void DeInit()
+        {
+            OnPageDestroy(-1);
+        }
+
     
 		public override bool Init()
 		{
@@ -202,6 +215,7 @@
 		{
 			using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml"))
 			{
+                GUITVHome.Navigator.SaveSettings(xmlwriter);
 				switch (GUIGraphicsContext.ARType)
 				{
 					case MediaPortal.GUI.Library.Geometry.Type.Zoom:
@@ -390,21 +404,23 @@
 
 				case Action.ActionType.ACTION_SHOW_INFO:
 				{
-					if(_useVMR9Zap==true )
-					{
-						_zapTimeOutTimer=DateTime.Now;
-					}
-					else
-					{
-						_osdTimeoutTimer=DateTime.Now;
-						GUIMessage msg= new GUIMessage (GUIMessage.MessageType.GUI_MSG_WINDOW_INIT,_zapWindow.GetID,0,0,GetID,0,null);
-						_zapWindow.OnMessage(msg);
-						Log.Write("ZAP OSD:ON");
-					
-						_zapOsdVisible=true;
-						_zapTimeOutTimer=DateTime.Now;
-					}
-
+                    if (!_zapOsdVisible)
+                    {
+                        if (_useVMR9Zap == true)
+                        {
+                            _zapTimeOutTimer = DateTime.Now;
+                        }
+                        else
+                        {
+                            _osdTimeoutTimer = DateTime.Now;
+                            GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, _zapWindow.GetID, 0, 0, GetID, 0, null);
+                            _zapWindow.OnMessage(msg);
+                            Log.Write("ZAP OSD:ON");
+
+                            _zapOsdVisible = true;
+                            _zapTimeOutTimer = DateTime.Now;
+                        }
+                    }
 				}
 					break;
 				case Action.ActionType.ACTION_SHOW_MSN_OSD:
@@ -886,6 +902,24 @@
 					// Set specified timeout
 					_msgBoxTimeout = message.Param1;
 					_msgTimer = DateTime.Now;
+                }
+                    break;
+                case GUIMessage.MessageType.GUI_MSG_NOTIFY:
+                {
+                    GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY);
+                    if (dlgNotify == null) return true;
+                    string channel = GUIPropertyManager.GetProperty("#TV.View.channel");
+                    string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, channel);
+                    dlgNotify.Reset();
+                    dlgNotify.ClearAll();
+                    dlgNotify.SetImage(strLogo);
+                    dlgNotify.SetHeading(channel);
+                    dlgNotify.SetText(message.Label);
+                    dlgNotify.TimeOut = message.Param1;
+                    _notifyDialogVisible = true;
+                    dlgNotify.DoModal(GUIWindowManager.ActiveWindow);
+                    _notifyDialogVisible = false;
+                    Log.Write("Notify Message:" + channel +", "+message.Label);
 				}
 					break;
 
@@ -1098,7 +1132,9 @@
 				{
 					dlg.Reset();
 					dlg.SetHeading(GUILocalizeStrings.Get(915));//TV Channels
-					foreach (TVChannel channel in GUITVHome.Navigator.CurrentGroup.TvChannels)
+                    int selected = 0;
+                    int i = 0;
+                    foreach (TVChannel channel in GUITVHome.Navigator.CurrentGroup.TvChannels)
 					{
 						GUIListItem pItem = new GUIListItem(channel.Name);
 						string strLogo=Utils.GetCoverArt(Thumbs.TVChannel,channel.Name);                   
@@ -1106,9 +1142,14 @@
 						{										
 							pItem.IconImage = strLogo;							
 						}						
-						dlg.Add(pItem);						
+						dlg.Add(pItem);
+                        if (channel.Name == GUITVHome.Navigator.CurrentTVChannel.Name)
+                        {
+                            selected = i;
+                        }
+                        i++;
 					}
-
+                    dlg.SelectedLabel = selected;
 					_isDialogVisible=true;
 					
 					dlg.DoModal( GetID);
@@ -1295,16 +1336,49 @@
 		public override void Process()
 		{
 			CheckTimeOuts();
+            if (ScreenStateChanged())
+            {
+                UpdateGUI();
+            }
+
+            if (!VideoRendererStatistics.IsVideoFound)
+            {
+                if ((lastChannelWithNoSignal != GUITVHome.Navigator.CurrentChannel) || (videoState != VideoRendererStatistics.VideoState))
+                {
+                    if (!_zapOsdVisible)
+                    {
+                        //GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_TV_NO_SIGNAL, true);
+                        GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_NOTIFY, GetID, GetID, 0, 5, 0, null);
+                        switch (VideoRendererStatistics.VideoState)
+                        {
+                            case VideoRendererStatistics.State.NoSignal:
+                                message.Label = GUILocalizeStrings.Get(1034);
+                                break;
+                            case VideoRendererStatistics.State.Scrambled:
+                                message.Label = GUILocalizeStrings.Get(1035);
+                                break;
+                            case VideoRendererStatistics.State.Signal:
+                                message.Label = GUILocalizeStrings.Get(1036);
+                                break;
+                            default:
+                                message.Label = GUILocalizeStrings.Get(1034);
+                                break;
+                        }
+                        lastChannelWithNoSignal = GUITVHome.Navigator.CurrentChannel;
+                        videoState = VideoRendererStatistics.VideoState;
+                        OnMessage(message);
+                    }
+                }
+            }
+            else
+            {
+                lastChannelWithNoSignal = string.Empty;
+                videoState = VideoRendererStatistics.State.VideoPresent;
+            }
 
-			if (ScreenStateChanged())
-			{
-				UpdateGUI();
-			}
 
 			GUIGraphicsContext.IsFullScreenVideo=true;
-			if (!VideoRendererStatistics.IsVideoFound)
-				GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_TV_NO_SIGNAL,true);
-		}
+        }
 
 		public bool ScreenStateChanged()
 		{
@@ -1601,8 +1675,9 @@
 			}
 
 
-      // Let the navigator zap channel if needed
-      if (GUITVHome.Navigator.CheckChannelChange() || _zapOsdVisible && _zapTimeOutValue>0)
+            // Let the navigator zap channel if needed
+           GUITVHome.Navigator.CheckChannelChange();
+           if (_zapOsdVisible && _zapTimeOutValue>0)
 			{
 				TimeSpan ts =DateTime.Now - _zapTimeOutTimer;
 				if ( ts.TotalMilliseconds > _zapTimeOutValue)
@@ -1699,9 +1774,8 @@
 
 		public void UpdateOSD()
 		{
-
 			if (GUIWindowManager.ActiveWindow!=GetID) return;
-      Log.Write("UpdateOSD()");
+            Log.Write("UpdateOSD()");
 			if (_isOsdVisible)
 			{
 				_osdWindow.UpdateChannelInfo();
@@ -1916,6 +1990,7 @@
 					}
 				}
 			}
+            SaveSettings();
 			base.OnPageDestroy (newWindowId);
 		}
 		void RenderVolume(bool show)
diff -uNr 7400/mediaportal/WindowPlugins/GUITV/GUITVHome.cs 7401/mediaportal/WindowPlugins/GUITV/GUITVHome.cs
--- 7400/mediaportal/WindowPlugins/GUITV/GUITVHome.cs	2006-05-25 23:53:01.000000000 +0200
+++ 7401/mediaportal/WindowPlugins/GUITV/GUITVHome.cs	2006-05-25 23:57:33.000000000 +0200
@@ -122,6 +122,16 @@
     #endregion
 
     #region overrides
+    /// <summary>
+    /// Gets called by the runtime when a  window will be destroyed
+    /// Every window window should override this method and cleanup any resources
+    /// </summary>
+    /// <returns></returns>
+    public override void DeInit()
+    {
+        OnPageDestroy(-1);
+    }
+
     public override bool Init()
     {
       bool bResult = Load(GUIGraphicsContext.Skin + @"\mytvhome.xml");
@@ -290,8 +300,8 @@
 
       if (channelName != String.Empty)
       {
-        Log.Write("tv home init:{0}", Navigator.CurrentChannel);
-        ViewChannel(Navigator.CurrentChannel);
+        Log.Write("tv home init:{0}", channelName);
+        ViewChannel(channelName);
       }
       UpdateChannelButton();
       UpdateStateOfButtons();
@@ -358,9 +368,12 @@
       for (int i = 0; i < Navigator.CurrentGroup.TvChannels.Count; ++i)
       {
         dlg.Add(Navigator.CurrentGroup.TvChannels[i].Name);
-        if (Navigator.CurrentGroup.TvChannels[i].Name == Navigator.CurrentTVChannel.Name)
+        if (Navigator.CurrentTVChannel != null)
         {
-          selected = i;
+            if (Navigator.CurrentGroup.TvChannels[i].Name == Navigator.CurrentTVChannel.Name)
+            {
+                selected = i;
+            }
         }
       }
       dlg.SelectedLabel = selected;
@@ -1349,14 +1362,14 @@
       if (m_currentgroup < 0 || m_currentgroup >= m_groups.Count)		// Group no longer exists?
         m_currentgroup = 0;
 
-      if (m_currentchannel.Trim() == String.Empty)
-      {
-        TVGroup group = (TVGroup)m_groups[m_currentgroup];
-        if (group.TvChannels.Count > 0)
-          m_currentchannel = ((TVChannel)group.TvChannels[0]).Name;
-      }
-
-      m_currentTvChannel = GetTVChannel(m_currentchannel);
+        m_currentTvChannel = GetTVChannel(m_currentchannel);
+        if (m_currentTvChannel == null) 
+        {
+            TVGroup group = (TVGroup)m_groups[m_currentgroup];
+            if (group.TvChannels.Count > 0)
+                m_currentchannel = ((TVChannel)group.TvChannels[0]).Name;
+            m_currentTvChannel = GetTVChannel(m_currentchannel);
+        }
     }
 
     public void SaveSettings(MediaPortal.Profile.Settings xmlwriter)
diff -uNr 7400/mediaportal/xbmc/d3dapp.cs 7401/mediaportal/xbmc/d3dapp.cs
--- 7400/mediaportal/xbmc/d3dapp.cs	2006-05-25 23:52:35.000000000 +0200
+++ 7401/mediaportal/xbmc/d3dapp.cs	2006-05-25 23:57:32.000000000 +0200
@@ -1733,8 +1733,6 @@
         this.Bounds = new Rectangle(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
         this.ClientSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
         this.Update();
-        GUIGraphicsContext.DX9Device.PresentationParameters.BackBufferWidth = Screen.PrimaryScreen.Bounds.Width;
-        GUIGraphicsContext.DX9Device.PresentationParameters.BackBufferHeight = Screen.PrimaryScreen.Bounds.Height;
         Log.Write("windowed->fullscreen done {0}", isMaximized);
         Log.Write("ClientSize: {0}x{1} screen:{2}x{3}",
           this.ClientSize.Width, this.ClientSize.Height,
