Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was receiving jpeg decoding errors when trying to use mjpeg with a microsoft lifecam studio webcam on linux. The same code worked fine with a logitech c920 camera though. And the camera works with any other application.
After some investigation, I stumbled upon this blog post https://lightbits.github.io/v4l2_huffman/ that explains that a mjpeg frame does not necessarily has to include the a huffman table which seems to trip up the jpgd library.
This code checks if a table is defined and injects a default one if it is not.