Skip to content

Conversation

@JPasterkampRotec
Copy link

@JPasterkampRotec JPasterkampRotec commented Feb 14, 2025

  • Added a editorconfig because this project was written with spaces instead of tabs, so spaces should be enforced in everyone's editor.
  • Passing cancellation token into Stream.ReadAsync.
  • Killing the ffmpeg process if it will not cancel within 1 second.

Most visual studio installations default to tabs, while the original creator of this solution seems to use spaces. By adding this editor config everyone will automatically use spaces in this solution.
This does not cancel the reading in most cases sadly, but it is good practice to always pass in cancellation tokens.
Since the cancellation token does not  stop the Stream.ReadAsync when the inputsource is offline,  we manually kill the ffmpeg process after 1 second of lenience. This causes the ReadAsync method to return 0 bytes, allowing the stream to end.
@JPasterkampRotec
Copy link
Author

JPasterkampRotec commented Feb 14, 2025

I tried linking this pull request to this issue but don't know how

@tinohager
Copy link
Member

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

Successfully merging this pull request may close these issues.

2 participants