Change function prototype from taking an AVStream to taking an index to the