Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to cancel decompression? #8

Open
jardik opened this issue Dec 16, 2020 · 2 comments
Open

How to cancel decompression? #8

jardik opened this issue Dec 16, 2020 · 2 comments

Comments

@jardik
Copy link

jardik commented Dec 16, 2020

Is there correct way to cancel decompression of the stream? I am using similar code as in the file_test.c file. i.e. I call FL2_createDStreamMt once at start and then for each stream stored in a file I call FL2_initDStream and then keep calling FL2_decompressStream until I decompress all data. But if my file reading function returns an error, what should I call to cancel the decompression so that next FL2_initDStream doesn't return an error (unfinished decompression of previous stream)? It seems the example in file_test.c doesn't handle reading errors and they are just ignored. I found FL2_cancelDStream, is this the function I should call?

@conor42
Copy link
Owner

conor42 commented Dec 17, 2020

Yes, FL2_cancelDStream() should be called. It's only required for multi-threaded decompression, but should probably be called for single-threaded too in case something changes. At the moment for ST you can init a new stream without canceling. I'll leave this open to remind me to add read error handling in file_test.

@jardik
Copy link
Author

jardik commented Dec 17, 2020

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants