| ... | ... |
@@ -64,11 +64,12 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id) |
| 64 | 64 |
AVCodecContext *c; |
| 65 | 65 |
AVStream *st; |
| 66 | 66 |
|
| 67 |
- st = av_new_stream(oc, 1); |
|
| 67 |
+ st = avformat_new_stream(oc, NULL); |
|
| 68 | 68 |
if (!st) {
|
| 69 | 69 |
fprintf(stderr, "Could not alloc stream\n"); |
| 70 | 70 |
exit(1); |
| 71 | 71 |
} |
| 72 |
+ st->id = 1; |
|
| 72 | 73 |
|
| 73 | 74 |
c = st->codec; |
| 74 | 75 |
c->codec_id = codec_id; |
| ... | ... |
@@ -659,11 +659,12 @@ dshow_add_device(AVFormatContext *avctx, AVFormatParameters *ap, |
| 659 | 659 |
AVStream *st; |
| 660 | 660 |
int ret = AVERROR(EIO); |
| 661 | 661 |
|
| 662 |
- st = av_new_stream(avctx, devtype); |
|
| 662 |
+ st = avformat_new_stream(avctx, NULL); |
|
| 663 | 663 |
if (!st) {
|
| 664 | 664 |
ret = AVERROR(ENOMEM); |
| 665 | 665 |
goto error; |
| 666 | 666 |
} |
| 667 |
+ st->id = devtype; |
|
| 667 | 668 |
|
| 668 | 669 |
ctx->capture_filter[devtype]->stream_index = st->index; |
| 669 | 670 |
|
| ... | ... |
@@ -161,8 +161,9 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx, |
| 161 | 161 |
/* for each open output create a corresponding stream */ |
| 162 | 162 |
for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
|
| 163 | 163 |
AVStream *st; |
| 164 |
- if (!(st = av_new_stream(avctx, i))) |
|
| 164 |
+ if (!(st = avformat_new_stream(avctx, NULL))) |
|
| 165 | 165 |
FAIL(AVERROR(ENOMEM)); |
| 166 |
+ st->id = i; |
|
| 166 | 167 |
} |
| 167 | 168 |
|
| 168 | 169 |
/* create a sink for each output and connect them to the graph */ |
| ... | ... |
@@ -145,7 +145,7 @@ static int read_header(AVFormatContext *ctx, AVFormatParameters *ap) |
| 145 | 145 |
if (error = al_get_error(ad->device, &error_msg)) goto fail; |
| 146 | 146 |
|
| 147 | 147 |
/* Create stream */ |
| 148 |
- if (!(st = av_new_stream(ctx, 0))) {
|
|
| 148 |
+ if (!(st = avformat_new_stream(ctx, NULL))) {
|
|
| 149 | 149 |
error = AVERROR(ENOMEM); |
| 150 | 150 |
goto fail; |
| 151 | 151 |
} |
| ... | ... |
@@ -102,7 +102,7 @@ static AVStream * init_stream(AVFormatContext *s, |
| 102 | 102 |
AVFormatParameters *ap) |
| 103 | 103 |
{
|
| 104 | 104 |
BinDemuxContext *bin = s->priv_data; |
| 105 |
- AVStream *st = av_new_stream(s, 0); |
|
| 105 |
+ AVStream *st = avformat_new_stream(s, NULL); |
|
| 106 | 106 |
if (!st) |
| 107 | 107 |
return NULL; |
| 108 | 108 |
st->codec->codec_tag = 0; |
| ... | ... |
@@ -217,7 +217,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 217 | 217 |
if (!modplug->f) |
| 218 | 218 |
return AVERROR_INVALIDDATA; |
| 219 | 219 |
|
| 220 |
- st = av_new_stream(s, 0); |
|
| 220 |
+ st = avformat_new_stream(s, NULL); |
|
| 221 | 221 |
if (!st) |
| 222 | 222 |
return AVERROR(ENOMEM); |
| 223 | 223 |
av_set_pts_info(st, 64, 1, 1000); |
| ... | ... |
@@ -231,7 +231,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 231 | 231 |
modplug->ts_per_packet = 1000*AUDIO_PKT_SIZE / (4*44100.); |
| 232 | 232 |
|
| 233 | 233 |
if (modplug->video_stream) {
|
| 234 |
- AVStream *vst = av_new_stream(s, 1); |
|
| 234 |
+ AVStream *vst = avformat_new_stream(s, NULL); |
|
| 235 | 235 |
if (!vst) |
| 236 | 236 |
return AVERROR(ENOMEM); |
| 237 | 237 |
av_set_pts_info(vst, 64, 1, 1000); |
| ... | ... |
@@ -54,7 +54,7 @@ static int microdvd_read_header(AVFormatContext *s, AVFormatParameters *ap) |
| 54 | 54 |
{
|
| 55 | 55 |
AVRational pts_info = (AVRational){ 2997, 125 }; /* default: 23.976 fps */
|
| 56 | 56 |
MicroDVDContext *microdvd = s->priv_data; |
| 57 |
- AVStream *st = av_new_stream(s, 0); |
|
| 57 |
+ AVStream *st = avformat_new_stream(s, NULL); |
|
| 58 | 58 |
int i, frame; |
| 59 | 59 |
double fps; |
| 60 | 60 |
char c; |
| ... | ... |
@@ -47,7 +47,7 @@ static int pmp_header(AVFormatContext *s, AVFormatParameters *ap) {
|
| 47 | 47 |
int srate, channels; |
| 48 | 48 |
int i; |
| 49 | 49 |
uint64_t pos; |
| 50 |
- AVStream *vst = av_new_stream(s, 0); |
|
| 50 |
+ AVStream *vst = avformat_new_stream(s, NULL); |
|
| 51 | 51 |
if (!vst) |
| 52 | 52 |
return AVERROR(ENOMEM); |
| 53 | 53 |
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| ... | ... |
@@ -90,9 +90,10 @@ static int pmp_header(AVFormatContext *s, AVFormatParameters *ap) {
|
| 90 | 90 |
srate = avio_rl32(pb); |
| 91 | 91 |
channels = avio_rl32(pb) + 1; |
| 92 | 92 |
for (i = 1; i < pmp->num_streams; i++) {
|
| 93 |
- AVStream *ast = av_new_stream(s, i); |
|
| 93 |
+ AVStream *ast = avformat_new_stream(s, NULL); |
|
| 94 | 94 |
if (!ast) |
| 95 | 95 |
return AVERROR(ENOMEM); |
| 96 |
+ ast->id = i; |
|
| 96 | 97 |
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
| 97 | 98 |
ast->codec->codec_id = audio_codec_id; |
| 98 | 99 |
ast->codec->channels = channels; |
| ... | ... |
@@ -485,10 +485,11 @@ static int wav_read_header(AVFormatContext *s, |
| 485 | 485 |
goto break_loop; |
| 486 | 486 |
} |
| 487 | 487 |
av_log(s, AV_LOG_DEBUG, "Found SMV data\n"); |
| 488 |
- vst = av_new_stream(s, 1); |
|
| 488 |
+ vst = avformat_new_stream(s, NULL); |
|
| 489 | 489 |
if (!vst) |
| 490 | 490 |
return AVERROR(ENOMEM); |
| 491 | 491 |
avio_r8(pb); |
| 492 |
+ vst->id = 1; |
|
| 492 | 493 |
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 493 | 494 |
vst->codec->codec_id = CODEC_ID_MJPEG; |
| 494 | 495 |
vst->codec->width = avio_rl24(pb); |