ennuicastr / libavjs-webcodecs-polyfill

A polyfill for the WebCodecs API. No, really.
82 stars 8 forks source link

metadata argument of AudioEncoder output callback doesn't match spec #5

Closed xlf1024 closed 2 years ago

xlf1024 commented 2 years ago

according to spec, the second argument of the EncodedAudioChunkOutputCallback receives an optional EncodedAudioChunkMetadata which in turn contains an optional AudioDecoderConfigdecoderConfig, which is the same type as supplied to AudioDecoder::configure(AudioDecoderConfigconfig).

This polyfill passes a Uint8Array instead, which from the stacktrace looks like it directly the codec extradata that seems like it should be in decoderConfig.description.

Also, if I understood the spec correctly, decoderConfig should be passed to AudioDecoder::configure, but this polyfill's implementation doesn't seem to read the description property at all.

Yahweasel commented 2 years ago

Hmmm, I indeed seemed to have missed something around decoder configuration. Probably a case of "just get it working" since this argument wasn't important for any of the codecs I was concerned with at the time :) . Will fix.

Yahweasel commented 2 years ago

Fixed in 712672c