Closed shervinemami closed 8 years ago
Good catch! The crashes you found should now be fixed in 2a78e3c.
I am not sure about removing the getopt_long dependency in the way you did. This is hard to do without adding bugs (for example, try running your code with "./h264_analyze -"). Also it is reimplementing something that already exists and works well. Instead, I would prefer to distribute one of the BSD-licensed getopt implementations with this project.
Good idea. I've never used getopt before so I didn't know how to fix the code, I just knew how to replace it with plain C code, but it looks like your bugfix is even better. Thanks!
I noticed the program crashed whenever I tried using the optional args, such as: ./h264_analyze -p file.h264 ./h264_analyze -v 0 file.h264 ./h264_analyze -v 1 file.h264 ./h264_analyze file.h264 -p
So I fixed those bugs and cleaned up the arg handling code. Now all of the commands above should work. I also added an empty line between NAL units in the debug output, so it's easier to see each NAL unit.