]> git.sesse.net Git - ffmpeg/commitdiff
Replace remaining av_new_stream() with avformat_new_stream().
authorClément Bœsch <ubitux@gmail.com>
Sat, 5 Nov 2011 12:11:18 +0000 (13:11 +0100)
committerClément Bœsch <ubitux@gmail.com>
Sat, 5 Nov 2011 14:07:19 +0000 (15:07 +0100)
12 files changed:
doc/examples/muxing.c
libavdevice/dshow.c
libavdevice/lavfi.c
libavdevice/openal-dec.c
libavformat/act.c
libavformat/bintext.c
libavformat/g723_1.c
libavformat/libmodplug.c
libavformat/loasdec.c
libavformat/microdvddec.c
libavformat/pmpdec.c
libavformat/wav.c

index 0cdc895df8ed23ec03e864e3fe5e1eb0a9b072ff..77dccb49a8866ce6571b60341b2ea6ed4f20ac0b 100644 (file)
@@ -64,11 +64,12 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
     AVCodecContext *c;
     AVStream *st;
 
-    st = av_new_stream(oc, 1);
+    st = avformat_new_stream(oc, NULL);
     if (!st) {
         fprintf(stderr, "Could not alloc stream\n");
         exit(1);
     }
+    st->id = 1;
 
     c = st->codec;
     c->codec_id = codec_id;
index 6a77f4b43a1f240db4d50214237d11c5eed4a59e..ab5f7e97e05f5d89da3bef5a87aa34846b0ca419 100644 (file)
@@ -659,11 +659,12 @@ dshow_add_device(AVFormatContext *avctx, AVFormatParameters *ap,
     AVStream *st;
     int ret = AVERROR(EIO);
 
-    st = av_new_stream(avctx, devtype);
+    st = avformat_new_stream(avctx, NULL);
     if (!st) {
         ret = AVERROR(ENOMEM);
         goto error;
     }
+    st->id = devtype;
 
     ctx->capture_filter[devtype]->stream_index = st->index;
 
index 92281569882c7fc891f6cc7a7d953422ba80e47e..cce09c5592306e1152c352cb498668ca8cf17252 100644 (file)
@@ -161,8 +161,9 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx,
     /* for each open output create a corresponding stream */
     for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
         AVStream *st;
-        if (!(st = av_new_stream(avctx, i)))
+        if (!(st = avformat_new_stream(avctx, NULL)))
             FAIL(AVERROR(ENOMEM));
+        st->id = i;
     }
 
     /* create a sink for each output and connect them to the graph */
index 1b70525c774ba5ec5a413e008a65ddde870ce3a5..77b63b569546d3a429be21f2c2d2bbb4054ff70d 100644 (file)
@@ -145,7 +145,7 @@ static int read_header(AVFormatContext *ctx, AVFormatParameters *ap)
     if (error = al_get_error(ad->device, &error_msg)) goto fail;
 
     /* Create stream */
-    if (!(st = av_new_stream(ctx, 0))) {
+    if (!(st = avformat_new_stream(ctx, NULL))) {
         error = AVERROR(ENOMEM);
         goto fail;
     }
index 8454cd1fc04c04d93063758110c28e14d4e89b85..bbda1ae4098e2205161db4c91b2a4b689a0c0d01 100644 (file)
@@ -69,7 +69,7 @@ static int read_header(AVFormatContext *s,
 
     int min,sec,msec;
 
-    st=av_new_stream(s, 0);
+    st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
 
index e03a31e447483773b7cd621d77dc2787b4da94b2..2450d92d0e3fe1c317d5738d7bcd6d78fe367e39 100644 (file)
@@ -102,7 +102,7 @@ static AVStream * init_stream(AVFormatContext *s,
                               AVFormatParameters *ap)
 {
     BinDemuxContext *bin = s->priv_data;
-    AVStream *st = av_new_stream(s, 0);
+    AVStream *st = avformat_new_stream(s, NULL);
     if (!st)
         return NULL;
     st->codec->codec_tag   = 0;
index 19441a1b19da87893587f851ed43e582c9ef7018..5bdd76436379daa054f2a174dbe4d0728a143716 100644 (file)
@@ -32,7 +32,7 @@ static int g723_1_init(AVFormatContext *s, AVFormatParameters *ap)
 {
     AVStream *st;
 
-    st = av_new_stream(s, 0);
+    st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
 
index 8b4e4f3bcd46c3ec44babda5b6efadee647913e6..ec9acd6c9200fa0b499c6ef8b7bd186d5fa5ed9d 100644 (file)
@@ -217,7 +217,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
     if (!modplug->f)
         return AVERROR_INVALIDDATA;
 
-    st = av_new_stream(s, 0);
+    st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
     av_set_pts_info(st, 64, 1, 1000);
@@ -231,7 +231,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
     modplug->ts_per_packet = 1000*AUDIO_PKT_SIZE / (4*44100.);
 
     if (modplug->video_stream) {
-        AVStream *vst = av_new_stream(s, 1);
+        AVStream *vst = avformat_new_stream(s, NULL);
         if (!vst)
             return AVERROR(ENOMEM);
         av_set_pts_info(vst, 64, 1, 1000);
index dd74b304fb38e0a58dbb18fea51bf1e2f856da4f..f3019420d1b7ae89fd8dfe4d36850444e136afc0 100644 (file)
@@ -63,7 +63,7 @@ static int loas_read_header(AVFormatContext *s,
 {
     AVStream *st;
 
-    st = av_new_stream(s, 0);
+    st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
 
index 95c76afc8d864d714cbb051664948ae7b53e5b1b..4c56a7f503aedad9a5389463ef975485892bc2bb 100644 (file)
@@ -54,7 +54,7 @@ static int microdvd_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
     AVRational pts_info = (AVRational){ 2997, 125 };  /* default: 23.976 fps */
     MicroDVDContext *microdvd = s->priv_data;
-    AVStream *st = av_new_stream(s, 0);
+    AVStream *st = avformat_new_stream(s, NULL);
     int i, frame;
     double fps;
     char c;
index ba4000335976f93b40d53406e7c9c63344c7f789..88b8998ad914e582d1c92b7415692c10b79ac7e4 100644 (file)
@@ -47,7 +47,7 @@ static int pmp_header(AVFormatContext *s, AVFormatParameters *ap) {
     int srate, channels;
     int i;
     uint64_t pos;
-    AVStream *vst = av_new_stream(s, 0);
+    AVStream *vst = avformat_new_stream(s, NULL);
     if (!vst)
         return AVERROR(ENOMEM);
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@@ -90,9 +90,10 @@ static int pmp_header(AVFormatContext *s, AVFormatParameters *ap) {
     srate = avio_rl32(pb);
     channels = avio_rl32(pb) + 1;
     for (i = 1; i < pmp->num_streams; i++) {
-        AVStream *ast = av_new_stream(s, i);
+        AVStream *ast = avformat_new_stream(s, NULL);
         if (!ast)
             return AVERROR(ENOMEM);
+        ast->id = i;
         ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
         ast->codec->codec_id = audio_codec_id;
         ast->codec->channels = channels;
index b690cc1a8fea10fce49212808780ebfc7da45c9b..096f706c37bb0f35eeb9316a36fcf15d10535274 100644 (file)
@@ -485,10 +485,11 @@ static int wav_read_header(AVFormatContext *s,
                 goto break_loop;
             }
             av_log(s, AV_LOG_DEBUG, "Found SMV data\n");
-            vst = av_new_stream(s, 1);
+            vst = avformat_new_stream(s, NULL);
             if (!vst)
                 return AVERROR(ENOMEM);
             avio_r8(pb);
+            vst->id = 1;
             vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
             vst->codec->codec_id = CODEC_ID_MJPEG;
             vst->codec->width  = avio_rl24(pb);