rtsp: Fix a crash with the RTSP muxer

This was introduced in bc2a32969e.

The whole block that the statement was added to is only
relevant when used as a demuxer, but the other statements
there have had other if statements guarding them. Make
sure to only run this whole block if being used as a
demuxer.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
