Not sure about Win8/8.1, but in my experience Windows hasn't been smart enough to know when your optical drive has hardware issues, so would pursue more software solutions first which I don't know as much about, and hopefully others have better suggestions.
No idea if it can help, but found this article on Microsoft's site searching online which should probably at least convince you software problems can cause this and you can find others by searching 'code 19 error':
http://support.microsoft.com/kb/314060Also, if you want to test the CD/DVD outside of Win8.1 to help confirm the hardware is okay, it can be a little tricky with Win8/8.1.
If you have a bootable disk and want to try this, tap the 'ESC' key a couple times (be sure to stop tapping quickly) as soon as you power on and see the Republic of Gamers logo to catch that boot menu.
If you can't catch that boot menu, try to keep tapping 'F2' or the delete key at power up to get into the bios and enable 'lauch CSM' under the 'Boot' menu and disable Secure boot control under the Security/Secure Boot menu.
If you miss the bios and get into Win8.1 instead, try holding the shift key while you restart Win8.1 to see the Windows advanced start up menu and select 'Troubleshoot', advanced options, and UEFI Firmware settings to get into the bios this way.
There should be other ways to solve it, but if you're not worried about erasing everything and reinstalling Windows to try to eliminate the possibility of any software issues, this is another idea.
Before recovering or resetting, consider 'refreshing' Windows or going back to an earlier system restore point if available too which normally should keep most of your data, but it's always better to back up just in case (which might also come in handy if you ever need it later on?).
Good luck!