Parse the command-line arguments first, and do not ignore avformat network init failure. At the end, deinit the avformat network.
Many functions returned an int to indicate their success. For clarity, use SDL_bool instead.
Start a new clean history from here.