Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99c90f0

Browse files
committed
fix: compatible with incomplete audio codec string mp4a.40
1 parent226ba8e commit99c90f0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

‎packages/av-cliper/src/clips/__tests__/mp4-clip.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,14 @@ test('decode incorrectFrameTypeMp4', async () => {
191191
const{ state}=awaitclip.tick(clip.meta.duration-30e3);
192192
expect(state).toBe('success');
193193
});
194+
195+
constmp4_webav1=`//${location.host}/video/webav1.mp4`;
196+
test('compatible with incomplete audio codec string mp4a.40',async()=>{
197+
constclip=newMP4Clip((awaitfetch(mp4_webav1)).body!);
198+
awaitclip.ready;
199+
constspy=vi.spyOn(console,'error').mockImplementation(()=>{});
200+
201+
awaitclip.tick(1e6);
202+
expect(spy).not.toHaveBeenCalled();
203+
spy.mockRestore();
204+
});

‎packages/av-cliper/src/mp4-utils/mp4box-utils.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ function parseAudioInfoFromESDSBox(esds: ESDSBoxParser): {
110110
codec+='.'+decConfDesc.oti.toString(16);
111111

112112
constdecSpecInfo=decConfDesc.descs[0];
113-
if(decSpecInfo==null)return{ codec};
113+
if(decSpecInfo==null){
114+
if(codec.endsWith('40'))codec+='.2';
115+
return{ codec};
116+
}
114117

115118
// ref: https://wiki.multimedia.cx/index.php/MPEG-4_Audio#Audio_Specific_Config
116119
constaudioObjectType=(decSpecInfo.data[0]&0xf8)>>3;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp