-
Notifications
You must be signed in to change notification settings - Fork 88
Add ebur128_reset to reset measurements #101
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
base: master
Are you sure you want to change the base?
Conversation
Useful when used as a Live Loudness Meter
| } | ||
|
|
||
| void ebur128_reset(ebur128_state *st) { | ||
| unsigned int i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of this code is redundant with code in ebur128_init(). Maybe there could be a common function they both call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully agree
| return EBUR128_SUCCESS; | ||
| } | ||
|
|
||
| void ebur128_reset(ebur128_state *st) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This same effect could be achieved by the application by simply calling destroy() and init(). I think it would be worthwhile to discuss the need for this function (and the extra code to maintain). I am not against it, just opening discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's what I first think of but you would free and reallocate quite a few (other) things which may not be ideal in "live" operation. Of course you would not do that in the real-time audio thread but still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing: if destroy() and init() is chosen, how would you achieve the Pause/Continue feature ? See #100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for Pause, you would stop sending data to the library and for Continue, you would resume sending data. So the application can just throw away audio data when paused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then the momentary value would not be computed any more, perhaps you still want it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps. I guess I am not familiar with the use case for pause and which measurements should be paused and why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pause should just not listening to the audio coming so no further values are calculated during that time.
While you are live you sometimes have to play something very different, e.g. for monitoring. Than just hit pause, play that other and then resume.
|
you should add ebur128_clear to ebur128.def |
|
any traction on this ? |
|
This pull request is not a priority in my opinion since a reset can be achieved by calling destroy/init. In fact, that is exactly what I do in MLT for live applications: https://github.com/mltframework/mlt/blob/master/src/modules/plus/filter_dynamic_loudness.c#L53 |
Useful when used as a Live Loudness Meter
Check #100