summaryrefslogtreecommitdiff
path: root/libavformat/sapdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/sapdec.c')
-rw-r--r--libavformat/sapdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c
index c317821772..84a9eb17b3 100644
--- a/libavformat/sapdec.c
+++ b/libavformat/sapdec.c
@@ -163,11 +163,12 @@ static int sap_read_header(AVFormatContext *s,
if (sap->sdp_ctx->ctx_flags & AVFMTCTX_NOHEADER)
s->ctx_flags |= AVFMTCTX_NOHEADER;
for (i = 0; i < sap->sdp_ctx->nb_streams; i++) {
- AVStream *st = av_new_stream(s, i);
+ AVStream *st = avformat_new_stream(s, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
}
+ st->id = i;
avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec);
st->time_base = sap->sdp_ctx->streams[i]->time_base;
}
@@ -211,11 +212,12 @@ static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
if (s->ctx_flags & AVFMTCTX_NOHEADER) {
while (sap->sdp_ctx->nb_streams > s->nb_streams) {
int i = s->nb_streams;
- AVStream *st = av_new_stream(s, i);
+ AVStream *st = avformat_new_stream(s, NULL);
if (!st) {
av_free_packet(pkt);
return AVERROR(ENOMEM);
}
+ st->id = i;
avcodec_copy_context(st->codec, sap->sdp_ctx->streams[i]->codec);
st->time_base = sap->sdp_ctx->streams[i]->time_base;
}