]> git.vomp.tv Git - vompclient.git/commitdiff
Fix resuming recording directly after stopping it
authorChris Tallon <chris@vomp.tv>
Mon, 30 Dec 2019 15:36:51 +0000 (15:36 +0000)
committerChris Tallon <chris@vomp.tv>
Mon, 30 Dec 2019 15:36:51 +0000 (15:36 +0000)
If a recording is playing and the user presses stop, then play
the recording is started from the beginning. Caused by
commit fa854a3abe995de8e3a06c422a535fc0e4a8484a.

vrecordinglist.cc

index bf28e7f395a2e45efe2d488b99e00bf4fc1b97d3..c9059f7688eb7f540b0ae9e75a30c17930d74fe7 100644 (file)
@@ -191,6 +191,28 @@ int VRecordingList::doPlay(bool resume)
 
   if (toPlay)
   {
+    toPlay->loadRecInfo();
+
+    if (toPlay->recInfo == NULL)
+    {
+      VInfo* vi = new VInfo();
+      vi->setSize(360, 200);
+      vi->createBuffer();
+      if (Video::getInstance()->getFormat() == Video::PAL)
+        vi->setPosition(190, 170);
+      else
+        vi->setPosition(180, 120);
+      vi->setOneLiner(tr("Error playing recording"));
+      vi->setExitable();
+      vi->setBorderOn(1);
+      vi->setTitleBarColour(DrawStyle::DANGER);
+      vi->okButton();
+      vi->draw();
+      boxstack->add(vi);
+      boxstack->update(vi);
+      return 0;
+    }
+
     toPlay->loadMarks();
     bool ish264;
     bool isRadio = toPlay->isRadio(ish264);
@@ -247,28 +269,6 @@ int VRecordingList::doPlay(bool resume)
       }
       else
       {
-        toPlay->loadRecInfo();
-
-        if (toPlay->recInfo == NULL)
-        {
-          VInfo* vi = new VInfo();
-          vi->setSize(360, 200);
-          vi->createBuffer();
-          if (Video::getInstance()->getFormat() == Video::PAL)
-            vi->setPosition(190, 170);
-          else
-            vi->setPosition(180, 120);
-          vi->setOneLiner(tr("Error playing recording"));
-          vi->setExitable();
-          vi->setBorderOn(1);
-          vi->setTitleBarColour(DrawStyle::DANGER);
-          vi->okButton();
-          vi->draw();
-          boxstack->add(vi);
-          boxstack->update(vi);
-          return 0;
-        }
-
         VVideoRec* vidrec = new VVideoRec(toPlay, ish264);
         vidrec->draw();
         boxstack->add(vidrec);