Skip to content

dateRanges[index].startDate undefined #186

@pmendozav

Description

@pmendozav

Error:

Image

Steps to replicate:

Unfortnately I cannot share the stream url but basically I was waiting for a long time and suddenly a playlist manifest started to include a tag EXT-X-DATERANGE with a field END-DATE but not START-DATE that m3u8-parser expects.

Basically I put a break point and wait:
Image

here is the value for this:
Image

Analysis

1. Observing this.lineStream.buffer:

#EXT-X-DATERANGE:ID="splice-0x9C6",END-DATE="2024-11-19T12:30:10.334833Z",DURATION=130.0,SCTE35-IN=0xFC302000000000000000FFF00F05000009C67F4FFF5A2E02770014000000008FBAEEA5
#EXTINF:6.16,
https://...52014694.ts
#EXTINF:6.0,
https://...52014695.ts

There is END-DATE but not START-DATE

2. To confirm, I checked t = this.manifest.dateRanges[e] with (e=1)

{
    "scte35In": "0xFC302000000000000000FFF00F05000009C67F4FFF5A2E02770014000000008FBAEEA5",
    "duration": 130,
    "endDate": "2024-11-19T12:30:10.334Z",
    "id": "splice-0x9C6"
}

3. My question:

In parser.js I see:

const dateRange = this.manifest.dateRanges[index]
// ...
if (dateRange.duration && dateRange.endDate) {
  const startDate = dateRange.startDate;
  const newDateInSeconds = startDate.getTime() + (dateRange.duration * 1000);

  this.manifest.dateRanges[index].endDate = new Date(newDateInSeconds);
}

So, are you checking if dateRange.endDate is defined to decide whether to update it? I'm unclear about that part. Shouldn't the criteria be dateRange.duration && dateRange.startDate? If dateRange.endDate is defined but one of the others is missing, we could just maintain the current daterange.endDate, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions