ennuicastr / libavjs-webcodecs-polyfill

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

VideoDecoder close method is not working correctly #10

Closed jimmyn closed 1 year ago

jimmyn commented 1 year ago

VideoDecoder close method does not seem to be working, Even after close it keeps decoding frames and calling output callback.

The issue could be reproduced here - https://github.com/jimmyn/libavjs-webcodecs/

To run it:

- npm install
- npm start
image
Yahweasel commented 1 year ago

This is true, but it's also documented in the README:

Certain events are supposed to eagerly halt the event queue, but
LibAVJS-WebCodecs-Polyfill always lets the event queue finish.

I wasn't specific there about what those events are, but basically they're explicit closing and errors.

Is this happening even if you haven't already queued up data to decode? It should be that anything that's already queued up keeps on pumping out, but anything after you call close() is refused.

The long story short is that while this is indeed the case, it was an intentional compromise to keep the architecture a bit simpler. Is it particularly problematic somewhere?

jimmyn commented 1 year ago

@Yahweasel thanks for clarification, in my case it just consumes resources, but I think I can work around that. Good to know