Yes, just use both -- why not, reasons of speed? You can run both in parallel even.
I don't know of a better solution if you don't know what is in there to begin with; start with the one more likely to appear. If they're equally likely, start with PDF417. It's slower but not prone to false positives.