Drepper's What every programmer should know about memory is a little old and goes into perhaps unnecessary detail at times, but is a great place to start.
Licensing is the responsibility of the party distributing the codec. When using the platform decoder any licensing fees have already been paid by, e.g. Apple.
To add to this, one thing I found helpful was to count with every breath in or out, up to ten -- breathe in, one; breathe out, two -- All the way up to ten, then back to the beginning.
Having something so easy and menial, yet requiring constant attention helps immensely to keep the mind from wandering.
This effect in some fields is called "Normalisation of Deviance". https://en.m.wikipedia.org/wiki/Normalization_of_deviance