Skip to content

Commit

Permalink
lavf,lavd: replace av_new_stream->avformat_new_stream part I.
Browse files Browse the repository at this point in the history
Trivial replacements with sed are done in this commit:
sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
  • Loading branch information
elenril committed Oct 19, 2011
1 parent 569129a commit 3b3bbdd
Show file tree
Hide file tree
Showing 101 changed files with 129 additions and 129 deletions.
2 changes: 1 addition & 1 deletion libavdevice/alsa-audio-dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion libavdevice/bktr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 1 addition & 1 deletion libavdevice/jack_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/libcdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/libdc1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/oss_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/sndio_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavdevice/v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/vfwcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavdevice/x11grab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/aea.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/aiffdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavformat/anm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/ape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/asfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion libavformat/assdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavformat/au.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/bethsoftvid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/bfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/bink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/c93.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/cafdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/cdg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/daud.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/dfa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions libavformat/dsicin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions libavformat/dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/dxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavformat/eacdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/electronicarts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libavformat/ffmdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/ffmetadec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 3b3bbdd

Please sign in to comment.