Adjust API for subtitle
Added error handling for file header