Commit 3b3bbdd3 authored by Anton Khirnov's avatar Anton Khirnov

lavf,lavd: replace av_new_stream->avformat_new_stream part I.

Trivial replacements with sed are done in this commit:
sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
parent 569129a6
......@@ -60,7 +60,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
enum CodecID codec_id;
snd_pcm_sw_params_t *sw_params;
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st) {
av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");
......
......@@ -271,7 +271,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
goto out;
}
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
goto out;
......
......@@ -108,7 +108,7 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
return ret;
}
if (!(st = av_new_stream(avctx, 0)))
if (!(st = avformat_new_stream(avctx, NULL)))
return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */
......
......@@ -229,7 +229,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
if ((test = start_jack(context)))
return test;
stream = av_new_stream(context, 0);
stream = avformat_new_stream(context, NULL);
if (!stream) {
stop_jack(self);
return AVERROR(ENOMEM);
......
......@@ -53,7 +53,7 @@ static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap)
int ret, i;
char *err = NULL;
if (!(st = av_new_stream(ctx, 0)))
if (!(st = avformat_new_stream(ctx, NULL)))
return AVERROR(ENOMEM);
s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err);
if (!s->drive) {
......
......@@ -160,7 +160,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
}
/* create a video stream */
vst = av_new_stream(c, 0);
vst = avformat_new_stream(c, NULL);
if (!vst) {
ret = AVERROR(ENOMEM);
goto out;
......
......@@ -209,7 +209,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap)
AVStream *st;
int ret;
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st) {
return AVERROR(ENOMEM);
}
......
......@@ -34,7 +34,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
AVStream *st;
int ret;
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -98,7 +98,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
s->video_win.width = ap->width;
s->video_win.height = ap->height;
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
......
......@@ -580,7 +580,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
enum CodecID codec_id;
enum PixelFormat pix_fmt = PIX_FMT_NONE;
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st) {
res = AVERROR(ENOMEM);
goto out;
......
......@@ -295,7 +295,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
SetWindowLongPtr(ctx->hwnd, GWLP_USERDATA, (LONG_PTR) s);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if(!st) {
vfw_read_close(s);
return AVERROR(ENOMEM);
......
......@@ -193,7 +193,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
goto out;
}
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
goto out;
......
......@@ -141,7 +141,7 @@ static int fourxm_read_header(AVFormatContext *s,
fourxm->height = AV_RL32(&header[i + 40]);
/* allocate a new AVStream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st){
ret= AVERROR(ENOMEM);
goto fail;
......
......@@ -65,7 +65,7 @@ static int adts_aac_read_header(AVFormatContext *s,
{
AVStream *st;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -57,7 +57,7 @@ static int aea_read_probe(AVProbeData *p)
static int aea_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -196,7 +196,7 @@ static int aiff_read_header(AVFormatContext *s,
filesize -= 4;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -84,7 +84,7 @@ static int amr_read_header(AVFormatContext *s,
avio_read(pb, header, 6);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
{
return AVERROR(ENOMEM);
......
......@@ -97,7 +97,7 @@ static int read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA;
/* video stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
......
......@@ -39,7 +39,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rl32(pb); /* _APC */
avio_rl32(pb); /* 1.20 */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -313,7 +313,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
ape->compressiontype);
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
......
......@@ -227,7 +227,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
pos1 = avio_tell(pb);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
......
......@@ -83,7 +83,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
uint8_t *p, **dst[2]={0};
int pos[2]={0};
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
av_set_pts_info(st, 64, 1, 100);
......
......@@ -151,7 +151,7 @@ static int au_read_header(AVFormatContext *s,
}
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -70,7 +70,7 @@ static int vid_read_header(AVFormatContext *s,
avio_skip(pb, 5);
vid->nframes = avio_rl16(pb);
stream = av_new_stream(s, 0);
stream = avformat_new_stream(s, NULL);
if (!stream)
return AVERROR(ENOMEM);
av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps
......@@ -83,7 +83,7 @@ static int vid_read_header(AVFormatContext *s,
avio_rl16(pb);
// done with video codec, set up audio codec
stream = av_new_stream(s, 0);
stream = avformat_new_stream(s, NULL);
if (!stream)
return AVERROR(ENOMEM);
stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -55,12 +55,12 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
int fps, chunk_header;
/* Initialize the video codec... */
vstream = av_new_stream(s, 0);
vstream = avformat_new_stream(s, NULL);
if (!vstream)
return AVERROR(ENOMEM);
/* Initialize the audio codec... */
astream = av_new_stream(s, 0);
astream = avformat_new_stream(s, NULL);
if (!astream)
return AVERROR(ENOMEM);
......
......@@ -78,7 +78,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
uint16_t flags;
int keyframe;
vst = av_new_stream(s, 0);
vst = avformat_new_stream(s, NULL);
if (!vst)
return AVERROR(ENOMEM);
......
......@@ -79,7 +79,7 @@ static int read_header(AVFormatContext *s,
/* Audio streams are added if audio packets are found */
s->ctx_flags |= AVFMTCTX_NOHEADER;
video = av_new_stream(s, 0);
video = avformat_new_stream(s, NULL);
if (!video)
return AVERROR(ENOMEM);
......
......@@ -61,7 +61,7 @@ static int read_desc_chunk(AVFormatContext *s)
int flags;
/* new audio stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -28,7 +28,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *vst;
int ret;
vst = av_new_stream(s, 0);
vst = avformat_new_stream(s, NULL);
if (!vst)
return AVERROR(ENOMEM);
......
......@@ -21,7 +21,7 @@
#include "avformat.h"
static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -45,7 +45,7 @@ static int dfa_read_header(AVFormatContext *s,
avio_skip(pb, 2); // unused
frames = avio_rl16(pb);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -107,7 +107,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
cin->audio_buffer_size = 0;
/* initialize the video decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......@@ -120,7 +120,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->height = hdr->video_frame_height;
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -211,7 +211,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
/* Dynamic handling of the audio streams in DV */
for (i = 0; i < ach; i++) {
if (!c->ast[i]) {
c->ast[i] = av_new_stream(c->fctx, 0);
c->ast[i] = avformat_new_stream(c->fctx, NULL);
if (!c->ast[i])
break;
av_set_pts_info(c->ast[i], 64, 1, 30000);
......@@ -278,7 +278,7 @@ DVDemuxContext* dv_init_demux(AVFormatContext *s)
if (!c)
return NULL;
c->vst = av_new_stream(s, 0);
c->vst = avformat_new_stream(s, NULL);
if (!c->vst) {
av_free(c);
return NULL;
......
......@@ -87,7 +87,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
h = avio_rb16(pb);
c->has_sound = 0;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
......@@ -100,7 +100,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_skip(pb, 16);
fsize = avio_rl32(pb);
ast = av_new_stream(s, 0);
ast = avformat_new_stream(s, NULL);
if (!ast)
return -1;
ret = ff_get_wav_header(pb, ast->codec, fsize);
......
......@@ -64,7 +64,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap)
sample_rate = avio_rb16(pb);
avio_skip(pb, 12);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -410,7 +410,7 @@ static int ea_read_header(AVFormatContext *s,
if (ea->video_codec) {
/* initialize the video decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
ea->video_stream_index = st->index;
......@@ -435,7 +435,7 @@ static int ea_read_header(AVFormatContext *s,
}
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, ea->sample_rate);
......
......@@ -290,7 +290,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
for(i=0;i<nb_streams;i++) {
char rc_eq_buf[128];
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
goto fail;
......
......@@ -132,7 +132,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
get_line(s->pb, line, sizeof(line));
if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return -1;
......
......@@ -49,7 +49,7 @@ static int read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA;
}
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -31,7 +31,7 @@ static int flac_read_header(AVFormatContext *s,
int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
uint8_t header[4];
uint8_t *buffer=NULL;
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -105,7 +105,7 @@ static int flic_read_header(AVFormatContext *s,
speed = FLIC_DEFAULT_SPEED;
/* initialize the decoder streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
flic->video_stream_index = st->index;
......
......@@ -153,7 +153,7 @@ static int idcin_read_header(AVFormatContext *s,
bytes_per_sample = avio_rl32(pb);
channels = avio_rl32(pb);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, IDCIN_FPS);
......@@ -174,7 +174,7 @@ static int idcin_read_header(AVFormatContext *s,
/* if sample rate is 0, assume no audio */
if (sample_rate) {
idcin->audio_present = 1;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, IDCIN_FPS);
......
......@@ -84,7 +84,7 @@ static int roq_read_header(AVFormatContext *s,
roq->audio_frame_count = 0;
roq->audio_stream_index = -1;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 63, 1, framerate);
......
......@@ -115,7 +115,7 @@ static int iff_read_header(AVFormatContext *s,
uint32_t chunk_id, data_size;
int compression = -1;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -216,7 +216,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
s1->ctx_flags |= AVFMTCTX_NOHEADER;
st = av_new_stream(s1, 0);
st = avformat_new_stream(s1, NULL);
if (!st) {
return AVERROR(ENOMEM);
}
......
......@@ -559,7 +559,7 @@ static int ipmovie_read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA;
/* initialize the stream decoders */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 63, 1, 1000000);
......@@ -572,7 +572,7 @@ static int ipmovie_read_header(AVFormatContext *s,
st->codec->bits_per_coded_sample = ipmovie->video_bpp;
if (ipmovie->audio_type) {
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
......
......@@ -88,7 +88,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap)
iss->sample_start_pos = avio_tell(pb);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -40,7 +40,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVStream *st;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -40,7 +40,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rl16(s->pb); // version
avio_rl16(s->pb); // header size
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -69,7 +69,7 @@ static int read_header(AVFormatContext *s,
avio_skip(pb, 80);
ast = av_new_stream(s, 0);
ast = avformat_new_stream(s, NULL);
vst = av_new_stream(s, 1);
if (!ast || !vst)
return AVERROR(ENOMEM);
......
......@@ -60,7 +60,7 @@ static int lmlm4_probe(AVProbeData * pd) {
static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st;
if (!(st = av_new_stream(s, 0)))
if (!(st = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_MPEG4;
......
......@@ -217,7 +217,7 @@ static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if ((ret = avio_read(pb, header_data, LXF_HEADER_DATA_SIZE)) != LXF_HEADER_DATA_SIZE)
return ret < 0 ? ret : AVERROR_EOF;
if (!(st = av_new_stream(s, 0)))
if (!(st = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
st->duration = AV_RL32(&header_data[32]);
......
......@@ -1396,7 +1396,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
}
st = track->stream = av_new_stream(s, 0);
st = track->stream = avformat_new_stream(s, NULL);
if (st == NULL)
return AVERROR(ENOMEM);
......@@ -1570,7 +1570,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
attachements[j].bin.data && attachements[j].bin.size > 0)) {
av_log(matroska->ctx, AV_LOG_ERROR, "incomplete attachment\n");
} else {
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (st == NULL)
break;
av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);
......
......@@ -105,7 +105,7 @@ static int read_header(AVFormatContext *s,
avio_skip(pb, length - 10); /* unknown data */
/* video stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
......@@ -117,7 +117,7 @@ static int read_header(AVFormatContext *s,
/* audio stream */
if (length == MM_HEADER_LEN_AV) {
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -241,7 +241,7 @@ static int mmf_read_header(AVFormatContext *s,
}
mmf->data_size = size;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -137,7 +137,7 @@ static int mp3_read_header(AVFormatContext *s,
AVStream *st;
int64_t off;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -84,7 +84,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->curbits = 8;
c->frames_noted = 0;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -222,7 +222,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->samples = ffio_read_varlen(pb);
ffio_read_varlen(pb); //silence samples at the beginning
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -1550,7 +1550,7 @@ static int mpegts_read_header(AVFormatContext *s,
/* only read packets */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
goto fail;
av_set_pts_info(st, 60, 1, 27000000);
......
......@@ -75,7 +75,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
AVCodecContext *codec;
AVStream *st;
st = av_new_stream(ctx, 0);
st = avformat_new_stream(ctx, NULL);
if(!st)
return AVERROR(ENOMEM);
......
......@@ -42,11 +42,11 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *ast, *vst;
unsigned int version, frames_count, msecs_per_frame, player_version;
ast = av_new_stream(s, 0);
ast = avformat_new_stream(s, NULL);
if (!ast)
return AVERROR(ENOMEM);
vst = av_new_stream(s, 0);
vst = avformat_new_stream(s, NULL);
if (!vst)
return AVERROR(ENOMEM);
......
......@@ -45,7 +45,7 @@ static int nc_probe(AVProbeData *probe_packet)
static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -307,7 +307,7 @@ static int oma_read_header(AVFormatContext *s,
codec_params = AV_RB24(&buf[33]);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -200,7 +200,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
AVCodecContext *c;
AVStream *st;
st = av_new_stream(oc, 0);
st = avformat_new_stream(oc, NULL);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
exit(1);
......
......@@ -162,7 +162,7 @@ static int str_read_packet(AVFormatContext *s,
if(str->channels[channel].video_stream_index < 0){
/* allocate a new AVStream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 15);
......@@ -210,7 +210,7 @@ static int str_read_packet(AVFormatContext *s,
if(str->channels[channel].audio_stream_index < 0){
int fmt = sector[0x13];
/* allocate a new AVStream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -43,7 +43,7 @@ static int pva_probe(AVProbeData * pd) {
static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st;
if (!(st = av_new_stream(s, 0)))
if (!(st = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_MPEG2VIDEO;
......
......@@ -84,7 +84,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVIOContext *pb = s->pb;
QCPContext *c = s->priv_data;
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
uint8_t buf[16];
int i, nb_rates;
......
......@@ -52,7 +52,7 @@ static int read_atom(AVFormatContext *s, Atom *atom)
static int r3d_read_red1(AVFormatContext *s)
{
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
char filename[258];
int tmp;
int av_unused tmp2;
......
......@@ -33,7 +33,7 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *st;
enum CodecID id;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......@@ -122,7 +122,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
int ff_raw_audio_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......@@ -143,7 +143,7 @@ int ff_raw_video_read_header(AVFormatContext *s,
int ret = 0;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
......
......@@ -110,7 +110,7 @@ static av_cold int rl2_read_header(AVFormatContext *s,
def_sound_size = avio_rl16(pb);
/** setup video stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if(!st)
return AVERROR(ENOMEM);
......@@ -140,7 +140,7 @@ static av_cold int rl2_read_header(AVFormatContext *s,
pts_num = def_sound_size;
pts_den = rate;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -396,7 +396,7 @@ static int rm_read_header_old(AVFormatContext *s)
AVStream *st;
rm->old_format = 1;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
st->priv_data = ff_rm_alloc_rmstream();
......@@ -462,7 +462,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
rm_read_metadata(s, 1);
break;
case MKTAG('M', 'D', 'P', 'R'):
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->id = avio_rb16(pb);
......
......@@ -139,7 +139,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
av_dict_set(&s->metadata, "author" , line, 0);
// video headers
vst = av_new_stream(s, 0);
vst = avformat_new_stream(s, NULL);
if (!vst)
return AVERROR(ENOMEM);
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
......@@ -181,7 +181,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
// samples, though. This code will ignore additional tracks.
audio_format = read_line_and_int(pb, &error); // audio format ID
if (audio_format) {
ast = av_new_stream(s, 0);
ast = avformat_new_stream(s, NULL);
if (!ast)
return AVERROR(ENOMEM);
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -54,7 +54,7 @@ static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -43,7 +43,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
return NULL;
rtpctx->oformat = rtp_format;
if (!av_new_stream(rtpctx, 0)) {
if (!avformat_new_stream(rtpctx, NULL)) {
av_free(rtpctx);
return NULL;
}
......
......@@ -134,7 +134,7 @@ static int film_read_header(AVFormatContext *s,
/* initialize the decoder streams */
if (film->video_type) {
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
film->video_stream_index = st->index;
......@@ -146,7 +146,7 @@ static int film_read_header(AVFormatContext *s,
}
if (film->audio_type) {
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
film->audio_stream_index = st->index;
......
......@@ -104,7 +104,7 @@ static int vmd_read_header(AVFormatContext *s,
else
vmd->is_indeo3 = 0;
/* start up the decoders */
vst = av_new_stream(s, 0);
vst = avformat_new_stream(s, NULL);
if (!vst)
return AVERROR(ENOMEM);
av_set_pts_info(vst, 33, 1, 10);
......@@ -125,7 +125,7 @@ static int vmd_read_header(AVFormatContext *s,
/* if sample rate is 0, assume no audio */
vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]);
if (vmd->sample_rate) {
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
vmd->audio_stream_index = st->index;
......
......@@ -71,7 +71,7 @@ static int siff_probe(AVProbeData *p)
static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
{
AVStream *ast;
ast = av_new_stream(s, 0);
ast = avformat_new_stream(s, NULL);
if (!ast)
return -1;
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......@@ -115,7 +115,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb)
avio_skip(pb, 16); //zeroes
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
......
......@@ -154,7 +154,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
/* init video codec */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
smk->videoindex = st->index;
......@@ -177,7 +177,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
for(i = 0; i < 7; i++) {
smk->indexes[i] = -1;
if (smk->rates[i]) {
ast[i] = av_new_stream(s, 0);
ast[i] = avformat_new_stream(s, NULL);
smk->indexes[i] = ast[i]->index;
ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
if (smk->aflags[i] & SMK_AUD_BINKAUD) {
......
......@@ -110,7 +110,7 @@ static int sol_read_header(AVFormatContext *s,
else id = 0;
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -51,7 +51,7 @@ static int sox_read_header(AVFormatContext *s,
double sample_rate, sample_rate_frac;
AVStream *st;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -205,7 +205,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!s->nb_streams) {
/* first packet, create a stream */
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st) {
av_free_packet(pkt);
return AVERROR(ENOMEM);
......
......@@ -42,7 +42,7 @@ static int srt_probe(AVProbeData *p)
static int srt_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return -1;
av_set_pts_info(st, 64, 1, 1000);
......
......@@ -94,7 +94,7 @@ static int thp_read_header(AVFormatContext *s,
break;
/* Video component. */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......@@ -117,7 +117,7 @@ static int thp_read_header(AVFormatContext *s,
break;
/* Audio component. */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -206,7 +206,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap)
seq->audio_buffer_full = 0;
/* initialize the video decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......@@ -219,7 +219,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->height = SEQ_FRAME_H;
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -73,10 +73,10 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (avio_rl32(pb) != TMV_TAG)
return -1;
if (!(vst = av_new_stream(s, 0)))
if (!(vst = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
if (!(ast = av_new_stream(s, 0)))
if (!(ast = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
ast->codec->sample_rate = avio_rl16(pb);
......
......@@ -77,7 +77,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1;
}
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -76,7 +76,7 @@ static int read_header(AVFormatContext *avctx,
{
TtyDemuxContext *s = avctx->priv_data;
int width = 0, height = 0, ret = 0;
AVStream *st = av_new_stream(avctx, 0);
AVStream *st = avformat_new_stream(avctx, NULL);
AVRational framerate;
if (!st) {
......
......@@ -40,7 +40,7 @@ static int txd_probe(AVProbeData * pd) {
static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
......
......@@ -54,7 +54,7 @@ static int vc1t_read_header(AVFormatContext *s,
return -1;
/* init video codec */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
......
......@@ -52,7 +52,7 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap)
return AVERROR(ENOSYS);
}
avio_skip(pb, header_size);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -64,7 +64,7 @@ static void add_metadata(AVFormatContext *s, const char *tag,
static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
VqfContext *c = s->priv_data;
AVStream *st = av_new_stream(s, 0);
AVStream *st = avformat_new_stream(s, NULL);
int chunk_tag;
int rate_flag = -1;
int header_size;
......
......@@ -273,7 +273,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
int ret;
/* parse fmt header */
*st = av_new_stream(s, 0);
*st = avformat_new_stream(s, NULL);
if (!*st)
return AVERROR(ENOMEM);
......@@ -636,7 +636,7 @@ static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1;
}
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -163,7 +163,7 @@ static int wc3_read_header(AVFormatContext *s,
} while (fourcc_tag != BRCH_TAG);
/* initialize the decoder streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, WC3_FRAME_FPS);
......@@ -174,7 +174,7 @@ static int wc3_read_header(AVFormatContext *s,
st->codec->width = wc3->width;
st->codec->height = wc3->height;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, WC3_FRAME_FPS);
......
......@@ -144,7 +144,7 @@ static int wsaud_read_header(AVFormatContext *s,
wsaud->audio_bits = (((header[10] & 0x2) >> 1) + 1) * 8;
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, wsaud->audio_samplerate);
......@@ -221,7 +221,7 @@ static int wsvqa_read_header(AVFormatContext *s,
unsigned int chunk_size;
/* initialize the video decoder stream */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, VQA_FRAMERATE);
......@@ -247,7 +247,7 @@ static int wsvqa_read_header(AVFormatContext *s,
/* initialize the audio decoder stream for VQA v1 or nonzero samplerate */
if (AV_RL16(&header[24]) || (AV_RL16(&header[0]) == 1 && AV_RL16(&header[2]) == 1)) {
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, VQA_FRAMERATE);
......
......@@ -481,7 +481,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
if (!filesize)
goto done;
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
goto done;
av_dict_set(&st->metadata, "title", description, 0);
......
......@@ -220,7 +220,7 @@ static int wv_read_header(AVFormatContext *s,
}
/* now we are ready: build format streams */
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return -1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
......
......@@ -70,7 +70,7 @@ static int xa_read_header(AVFormatContext *s,
AVStream *st;
/*Set up the XA Audio Decoder*/
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -150,7 +150,7 @@ static int xmv_read_header(AVFormatContext *s,
/* Video track */
vst = av_new_stream(s, 0);
vst = avformat_new_stream(s, NULL);
if (!vst)
return AVERROR(ENOMEM);
......
......@@ -69,7 +69,7 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (tag != MKTAG('f', 'm', 't', ' '))
return -1;
size = avio_rl32(pb);
st = av_new_stream(s, 0);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
......@@ -56,7 +56,7 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap)
int frame_rate, ret;
audio_stream = av_new_stream(s, 0);
audio_stream = avformat_new_stream(s, NULL);
video_stream = av_new_stream(s, 1);
// Extra data that will be passed to the decoder
......
This diff is collapsed.
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