Audio-Only Mode Fix#1022
Conversation
Fix audio bug that audio-Only mode does not work when restarting OBS.
| case PROP_BW_AUDIO_ONLY: | ||
| recv_desc.bandwidth = | ||
| NDIlib_recv_bandwidth_audio_only; | ||
| obs_source_output_video( |
There was a problem hiding this comment.
So there is no need to send any blank frame?
If this was the only thing sending a blank frame, then all blank frame code should be removed entirety.
There was a problem hiding this comment.
The only other place we send blank frame is
https://github.com/obs-ndi/obs-ndi/blob/develop/src/obs-ndi-source.cpp#L940
void ndi_source_thread_stop(ndi_source_t *s)
{
if (s->running) {
s->running = false;
pthread_join(s->av_thread, NULL);
if (!s->config.remember_last_frame) {
obs_source_output_video(s->obs_source,
s->config.blank_frame);
}
}
}
Is this also not necessary?
I think the intention here is to intentionally render an empty frame when the source is switched away and "remember last frame" is not selected.
ie: to blank the frame.
But why would an audio only source need to blank a video frame it never had?
The only reason I can see to do this is if the config is changing from a normal a/v source to an audio only source.
There was a problem hiding this comment.
FFR: PROP_BW_AUDIO_ONLY was first added 2017/11/29 in:
bafaf47#diff-6a31bbe65b845c97228452424d004830270b76230165c75ec3d1c67b2c6420e6R304
Then blank_video_frame() was first added 2018/03/24 in:
7d1cf13#diff-6a31bbe65b845c97228452424d004830270b76230165c75ec3d1c67b2c6420e6R446
The title of that 2018/03/24 PR is
source: reorder functions + clear last video frame in Audio Only mode
There has got to be a reason why this was added.
Thinking...
Maybe again only if the config is changing from a normal a/v source to an audio only source... something that would happen often while dev/testing this, and one time for most users changing from the default.
Removed trailing tab after the ;
Fix audio bug that audio-Only mode does not work when restarting OBS.
Main bug with workaround solution: #592
Should fix the issues :
#429
#578
#981
#906
#621
#467
#298
This was tested and confirmed fixing the bug on Win 11 Home + Win 10 Home on OBS 30.1.1 (for the issue)
DO NOT MERGE!
This re-introduce another issue that the "last frame" of the input is not "cleared" when the bandwidth settings change from another one to "audio_only".