rtp: Make sure priv_data is set before reading it

This fixes crashes with muxing H263 into RTSP.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e90820d4f815c15796e642467cdddbad755212a2)

Signed-off-by: Martin Storsjö <martin@martin.st>
rtp: Make sure the output format pointer is set

Not sure if this actually happens, but we do the same check when
checking payload_type further above in the function, so it might
be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 932117171f32fc3160f3d92943290238945fcb28)

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpenc_chain: Use the original AVFormatContext for getting payload type

In ff_rtp_get_payload_type, the AVFormatContext is used for checking
whether the payload_type or rtpflags options are set. In rtpenc_chain,
the rtpctx struct is a newly initialized struct where no options have
been set yet, so no options can be fetched from there.

All muxers that internally chain rtp muxers have the "rtpflags" field
that allows passing such options on (which is how this worked before
8034130e06), so this works just as intended.

This makes it possible to produce H263 in RFC2190 format with chained
RTP muxers.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 4a4a7e138c92901e04db46a6b05cc6948023e5f5)

Signed-off-by: Martin Storsjö <martin@martin.st>