Patch for ttx segfault
authorChris Tallon <chris@vomp.tv>
Mon, 28 Sep 2009 16:49:17 +0000 (16:49 +0000)
committerChris Tallon <chris@vomp.tv>
Mon, 28 Sep 2009 16:49:17 +0000 (16:49 +0000)
vvideolivetv.cc

index 40838feab9c3ee70f7d0f44d4262893ea209ff0a..8d50bf2026dd5fd9095f5e39210a45ebcdc9c0be 100644 (file)
@@ -397,7 +397,7 @@ int VVideoLiveTV::handleCommand(int command)
     }
     case Remote::YELLOW:
     {
-      doTeletext(); //TODO: Add a selector for subtitles or teletext
+      if (streamType ==VDR::VIDEO) doTeletext(); //TODO: Add a selector for subtitles or teletext
       return 2;
     }
     case Remote::GUIDE:
@@ -577,6 +577,7 @@ void VVideoLiveTV::doKey(int command)
 
 void VVideoLiveTV::doTeletext(bool subtitlemode)
 {
+  if (streamType !=VDR::VIDEO) return;
   bool exists=true;
 
   // Cancel keying
@@ -642,7 +643,7 @@ void VVideoLiveTV::doAudioSelector()
 
   // Draw the selector
   vas = new VAudioSelector(this, (*chanList)[currentChannelIndex], ((PlayerLiveTV*)player)->getCurrentAudioChannel(),
-      subtitleType,subtitleChannel,player->getTeletxtSubtitlePages());
+      subtitleType,subtitleChannel,NULL);
   Colour osdBack = Colour(0, 0, 0, 128);
   vas->setBackgroundColour(osdBack);
   vas->setPosition(0, osd.getScreenY() - vas->getHeight());
@@ -862,12 +863,13 @@ void VVideoLiveTV::timercall(int ref)
 bool VVideoLiveTV::channelChange(UCHAR changeType, UINT newData)
 {
   UINT newChannel = 0;
+  if (streamType ==VDR::VIDEO) {
   VTeletextView *vtxt=((PlayerLiveTV*)player)->getTeletextDecoder()->getTeletxtView();
-  if (vtxt ) {
-       BoxStack::getInstance()->remove(vtxt);
-       
-  }
+    if (vtxt ) {
+         BoxStack::getInstance()->remove(vtxt);
 
+    }
+  }
   if (changeType == INDEX)
   {
     newChannel = newData;
@@ -987,6 +989,7 @@ void VVideoLiveTV::processMessage(Message* m)
   } 
   else if (m->message == Message::SUBTITLE_CHANGE_CHANNEL)
   {
+    if (streamType !=VDR::VIDEO) return;
       Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Received change subtitle channel to %i", m->parameter);
       int type=((m->parameter & 0xFF0000)>>16);
       switch (type) {