Open RossBencina opened 1 month ago
Hi Ross! I like your proposal, it will improve code readability indeed.
I would choose:
pSub->monoStereoConverter = GetMonoStereoConverter(&pSub->wavexu.ext, (output ? CONVERT__1TO2 : CONVERT_2TO1_L));
and:
_Convert_2TO1_8, _Convert_1TO2_24
Once PRs touching this area are merged, will create new one to address this issue.
[Hi Dmitry, this is just a suggestion for changing internal function names. I'm not proposing to have a lengthy debate. Please close this issue if you don't want to action it]
During the review of #934 I had a bit of confusion about the meaning of the phrase "internal stereo to mono mixer" in a comment.
Upon review of the code in
pa_win_wasapi.c
I see that there is a mechanism for selecting functions for changing channel count:GetMonoToStereoMixer
, it is called on line 3339:Note that this function, and the functions that it calls are used for 2->1 mixing or channel selection for input, or 1->2 channel duplication for output. There are two sources of confusion:
MonoToStereo
is used throughout the code. This could be changed to useMonoToStereo
andStereoToMono
consistent with behavior, but since2TO1
and1TO2
also appear but might be possible to just avoid it in most cases. Another option isMonoStereo
which does not name a direction.I think it is good to aim to reduce the amount of confusion in the code base. Here are some options:
or
Then I would change the name of in individual converters:
_StereoToMono_2TO1_8
,_MonoToStereo_1TO2_24
or, probably better:
_Convert_2TO1_8
,_Convert_1TO2_24
Hope you see what I mean.
Thank you.