We propose a dynamic programming algorithm for finding optimal transmission policies for a single packet in ratedistortion optimized media streaming. The algorithm relies on an optimality assumption holding in particular when both the forward and round trip times have exponential distributions. In the other cases, we use the assumption as a heuristic principle. Simulations show that for realistic channel models, the algorithm provides optimal solutions and can be significantly faster than the previous fastest exact algorithm. The proposed algorithm can be used as a preprocessing step for streaming mutually dependent packets.