{"record":{"id":"73210ba232253557","repo":"mifi/lossless-cut","slug":"invalid-edl-data-found","errorCode":null,"errorMessage":"Invalid EDL data found","messagePattern":"Invalid EDL data found","errorType":"exception","errorClass":"UserFacingError","httpStatus":null,"severity":"error","filePath":"src/renderer/src/edlFormats.ts","lineNumber":198,"sourceCode":"    return [{ start, end, type }];\n  });\n\n  const cutAwaySegments = allRows.filter((row) => row.type === 0);\n  const muteSegments = allRows.filter((row) => row.type === 1);\n  const sceneMarkers = allRows.filter((row) => row.type === 2);\n  const commercialBreaks = allRows.filter((row) => row.type === 3);\n\n  const inverted = invertSegments(sortSegments(cutAwaySegments), true, true);\n\n  const map = (segments: SegmentBase[], name: string, type: 0 | 1 | 2 | 3) => segments.map(({ start, end }) => ({ start, end, name, tags: { mplayerEdlType: String(type) } }));\n\n  const out = [\n    ...map(inverted, 'Cut', 0),\n    ...map(muteSegments, 'Mute', 1),\n    ...map(sceneMarkers, 'Scene Marker', 2),\n    ...map(commercialBreaks, 'Commercial Break', 3),\n  ];\n  if (out.length === 0) throw new UserFacingError(i18n.t('Invalid EDL data found'));\n  return out;\n}\n\nexport async function parseEdlCmx3600(text: string, fps: number) {\n  const cmx = parseCmx3600(text);\n\n  const parseTimecode = (t: string) => {\n    const match = t.match(/^(\\d+)[:;](\\d+)[:;](\\d+)[:;](\\d+)$/);\n    invariant(match, `Invalid EDL line: ${t}`);\n    const hours = parseInt(match[1]!, 10);\n    const minutes = parseInt(match[2]!, 10);\n    const seconds = parseInt(match[3]!, 10);\n    const frames = parseInt(match[4]!, 10);\n    return Duration.fromObject({ hours, minutes, seconds: seconds + (frames / fps) }).as('seconds');\n  };\n\n  return cmx.events.map((event) => ({\n    start: parseTimecode(event.sourceIn),","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/mifi/lossless-cut/blob/3b9a59c288bf6e11076b583c932cfa48ddab3b02/src/renderer/src/edlFormats.ts#L180-L216","documentation":"Thrown at the end of the mplayer EDL parser when the aggregated output array (Cut, Mute, Scene Marker, and Commercial Break segments combined) is empty. The parser read the file and classified rows by type (0-3) but none produced a valid segment, so there is nothing to import. It is a guard against importing a syntactically-OK but semantically empty .edl file.","triggerScenarios":"Importing a .edl file that contains only comment lines, blank lines, or rows whose type field is outside 0-3; an .edl where all rows failed the start<=end or numeric-parsing internal filters; pointing the EDL importer at a file with the .edl extension that is actually a different format.","commonSituations":"Re-saving an mplayer EDL with an editor that stripped the tab-separated numeric columns; a file from a tool that uses a different EDL dialect (CMX3600 vs mplayer) but shares the .edl extension; an EDL exported for a different cut list that has zero actual cut entries.","solutions":["Open the .edl in a text editor and confirm it contains lines of the form 'start<TAB>end<TAB>type' with type in 0..3.","If the file is actually a CMX3600 EDL, import it through the CMX path (parseEdlCmx3600) instead of the mplayer parser.","Regenerate the EDL from the source application, ensuring at least one valid cut/mute/scene/commercial row.","Verify there are no stray non-numeric characters or wrong delimiters in the start/end columns."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Heuristic: a mplayer EDL should have at least one numeric tab-separated row\nexport function looksLikeMplayerEdl(text: string): boolean {\n  return /^\\s*[\\d.]+\\s+\\t\\s+[\\d.]+\\s+\\t\\s+[0-3]\\s*$/m.test(text) || text.split(/\\r?\\n/).some((l) => /^\\s*[\\d.]+\\t[\\d.]+\\t[0-3]\\s*$/.test(l));\n}\nif (!looksLikeMplayerEdl(text)) throw new Error('File does not look like an mplayer EDL');","typeGuard":null,"tryCatchPattern":"try {\n  return await parseMplayerEdl(text);\n} catch (err) {\n  if (err instanceof UserFacingError && /Invalid EDL data found/.test(err.message)) {\n    showError('This EDL contains no valid cut/mute/scene/commercial entries.');\n    return [];\n  }\n  throw err;\n}","preventionTips":["Distinguish mplayer EDL from CMX3600 EDL by content before choosing the parser.","Open the .edl in a text editor and confirm 'start<TAB>end<TAB>type' rows with type 0-3 exist.","Regenerate the EDL from its source tool if it contains only comments/blank lines."],"tags":["edl","mplayer","parsing","edl-import","validation"],"backgroundTag":null,"analyzedSha":"3b9a59c288bf6e11076b583c932cfa48ddab3b02","analyzedAt":"2026-08-12T20:54:25.651Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}