There will either be a menu option or a button on the front panel/remote that allows you to assign digital inputs. For example, on my Onkyo there is a button marked 'digital input'.
I connect the DVD player video to the DVD input. I connect the optical audio to Optical 1. After I select the DVD input, press digital input and it cycles through the options. When the digital input says 'optical 1' then the dvd input is assigned to optical 1. This only has to be done once.
I understand when you say it used to work, but you know sometimes we inadvertently press buttons and things get out of whack. Just a suggestion as that is the number one thing that gets messed up.
Post the brand and model number of your receiver if you still have trouble and maybe someone will be familiar with that exact model.
P.S. There is also the possibility that the dvd player settings are incorrect. You must tell it to pass digital audio. If you have it set to 2-channel stereo, it will use the analog outputs, and if the analog cables aren't hooked to the receiver, you will get no sound.