Bug 1415821 - Correct the behavior for BADCUE state. r=alwu draft
authorbechen@mozilla.com <bechen@mozilla.com>
Wed, 15 Nov 2017 17:21:09 +0800
changeset 698103 65e54177e6c9fbf964d50059fc38bed4fa3b7f78
parent 698025 91a1342ced7dbdf5956fe1914b2ae4b27aab7bc8
child 740300 25c28fd2cdff907672ac4eb5d3abe9bbea01d7de
push id89205
push userbmo:bechen@mozilla.com
push dateWed, 15 Nov 2017 09:22:03 +0000
reviewersalwu
bugs1415821
milestone58.0
Bug 1415821 - Correct the behavior for BADCUE state. r=alwu MozReview-Commit-ID: G59NBC9rcGa
dom/media/webvtt/vtt.jsm
--- a/dom/media/webvtt/vtt.jsm
+++ b/dom/media/webvtt/vtt.jsm
@@ -1395,18 +1395,19 @@ const { XPCOMUtils } = require("resource
             }
             if (self.cue.text) {
               self.cue.text += "\n";
             }
             self.cue.text += line;
             break;
           case "BADCUE": // BADCUE
             // 54-62 - Collect and discard the remaining cue.
-            if (!line) {
-              self.state = "ID";
+            self.state = "ID";
+            if (line) { // keep this line to ID state.
+              continue;
             }
             break;
           }
           // The line was already parsed, empty it to ensure we can get the
           // new line in next iteration.
           line = null;
         }
       } catch (e) {