From a247d343faf8575f146b1ac55b8667ab4b8b9f64 Mon Sep 17 00:00:00 2001 From: Rob Walch Date: Fri, 24 May 2024 15:19:53 -0700 Subject: [PATCH] Emit FRAG_PARSING_ERROR on unsupported M2TS codec (#6447) Fixes #6445 (cherry picked from commit 5d2f57cfcfb4f88fdfe9e39147b9f7e78e6e5a38) --- src/demux/transmuxer-interface.ts | 1 + src/demux/tsdemuxer.ts | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/demux/transmuxer-interface.ts b/src/demux/transmuxer-interface.ts index a102515d009..52df5527635 100644 --- a/src/demux/transmuxer-interface.ts +++ b/src/demux/transmuxer-interface.ts @@ -337,6 +337,7 @@ export default class TransmuxerInterface { type: ErrorTypes.MEDIA_ERROR, details: ErrorDetails.FRAG_PARSING_ERROR, chunkMeta, + frag: this.frag || undefined, fatal: false, error, err: error, diff --git a/src/demux/tsdemuxer.ts b/src/demux/tsdemuxer.ts index e45070f95ab..02dc71afd82 100644 --- a/src/demux/tsdemuxer.ts +++ b/src/demux/tsdemuxer.ts @@ -872,11 +872,10 @@ function parsePMT( case 0xc2: // SAMPLE-AES EC3 /* falls through */ case 0x87: - logger.warn('Unsupported EC-3 in M2TS found'); - break; + throw new Error('Unsupported EC-3 in M2TS found'); + case 0x24: - logger.warn('Unsupported HEVC in M2TS found'); - break; + throw new Error('Unsupported HEVC in M2TS found'); default: // logger.log('unknown stream type:' + data[offset]);