Commit ebdae731 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'cf402d6f'

* commit 'cf402d6f':
  rtpenc_mpegts: Set chain->rtp_ctx only after avformat_write_header succeeded
Reviewed-by: 's avatarAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 967afad0 cf402d6f
...@@ -88,11 +88,10 @@ static int rtp_mpegts_write_header(AVFormatContext *s) ...@@ -88,11 +88,10 @@ static int rtp_mpegts_write_header(AVFormatContext *s)
st->time_base.num = 1; st->time_base.num = 1;
st->time_base.den = 90000; st->time_base.den = 90000;
st->codec->codec_id = AV_CODEC_ID_MPEG2TS; st->codec->codec_id = AV_CODEC_ID_MPEG2TS;
chain->rtp_ctx = rtp_ctx;
rtp_ctx->pb = s->pb; rtp_ctx->pb = s->pb;
if ((ret = avformat_write_header(rtp_ctx, NULL)) < 0) if ((ret = avformat_write_header(rtp_ctx, NULL)) < 0)
goto fail; goto fail;
rtp_ctx = NULL; chain->rtp_ctx = rtp_ctx;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment