Skip to content

Commit

Permalink
fix: null point error, read track_width of null
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Dec 22, 2023
1 parent 32e8f64 commit 0a1a63d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/av-cliper/src/mp4-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,19 @@ export function demuxcode(
},
onChunk: async ({ chunkType, data }) => {
if (chunkType === 'ready') {
Log.info('demuxcode chunk ready')
Log.info('demuxcode chunk ready, info:', data)
mp4File = data.file
mp4Info = data.info
const { videoDecoderConf, audioDecoderConf } = extractFileConfig(
data.file,
data.info
)
if (videoDecoderConf != null) vdecoder.configure(videoDecoderConf)

if (videoDecoderConf != null) {
vdecoder.configure(videoDecoderConf)
} else {
throw new Error('MP4 file does not include a video track or uses an unsupported codec')
}
if (opts.audio && audioDecoderConf != null) {
adecoder.configure(audioDecoderConf)
}
Expand Down

0 comments on commit 0a1a63d

Please sign in to comment.