It was 2017 that the last MP3 patents expired, which is pretty recent, IMO. It was patented on the encode side about 10 years longer than on the decode side.
Yeah, I remember having to use nonfree repos to enable MP3 playback on my Linux machine back in the day. I could not remember when it stopped being the case, but 2017 seems about right.