You could be running into an HDMI handshake problem or the DVD player won't let you output raw digital audio through optical if you are using the HDMI output. Try connecting the DVD player to the TV ...
Additionally, the system profiler's report on the 13-inch MacBook Pro has no listing for S/PDIF Optical Digital Audio Output, while the 2012 and 2015 Retina MacBook Pro models do. AppleInsider ...