The call to av_find_best_stream() gives the decoder directly, this avoids to retrieve it afterwards in a separate step.