lame_init_params() sets ReplayGain to zero if the Xing header is not being saved by Lame. It would be helpful not to override the flags and warn the user instead.
This would allow the generation of the info in the Xing header even when the input to libmp3lame is streamed. The application I have in mind is the addition of the Xing header in ffmpeg.
Ok, find peak sample and calculating replay gain won't get disabled in this case anymore.