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)/'
This commit is contained in:
Anton Khirnov 2011-06-18 11:43:24 +02:00
parent 569129a6dc
commit 3b3bbdd3e6
101 changed files with 129 additions and 129 deletions

View File

@ -60,7 +60,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
enum CodecID codec_id; enum CodecID codec_id;
snd_pcm_sw_params_t *sw_params; snd_pcm_sw_params_t *sw_params;
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) { if (!st) {
av_log(s1, AV_LOG_ERROR, "Cannot add stream\n"); av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");

View File

@ -271,7 +271,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
goto out; goto out;
} }
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) { if (!st) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto out; goto out;

View File

@ -108,7 +108,7 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
return ret; return ret;
} }
if (!(st = av_new_stream(avctx, 0))) if (!(st = avformat_new_stream(avctx, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */ av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */

View File

@ -229,7 +229,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
if ((test = start_jack(context))) if ((test = start_jack(context)))
return test; return test;
stream = av_new_stream(context, 0); stream = avformat_new_stream(context, NULL);
if (!stream) { if (!stream) {
stop_jack(self); stop_jack(self);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -53,7 +53,7 @@ static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap)
int ret, i; int ret, i;
char *err = NULL; char *err = NULL;
if (!(st = av_new_stream(ctx, 0))) if (!(st = avformat_new_stream(ctx, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err); s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err);
if (!s->drive) { if (!s->drive) {

View File

@ -160,7 +160,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
} }
/* create a video stream */ /* create a video stream */
vst = av_new_stream(c, 0); vst = avformat_new_stream(c, NULL);
if (!vst) { if (!vst) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto out; goto out;

View File

@ -209,7 +209,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap)
AVStream *st; AVStream *st;
int ret; int ret;
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) { if (!st) {
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }

View File

@ -34,7 +34,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
AVStream *st; AVStream *st;
int ret; int ret;
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -98,7 +98,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
s->video_win.width = ap->width; s->video_win.width = ap->width;
s->video_win.height = ap->height; s->video_win.height = ap->height;
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */ av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

View File

@ -580,7 +580,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
enum CodecID codec_id; enum CodecID codec_id;
enum PixelFormat pix_fmt = PIX_FMT_NONE; enum PixelFormat pix_fmt = PIX_FMT_NONE;
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) { if (!st) {
res = AVERROR(ENOMEM); res = AVERROR(ENOMEM);
goto out; goto out;

View File

@ -295,7 +295,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
SetWindowLongPtr(ctx->hwnd, GWLP_USERDATA, (LONG_PTR) s); SetWindowLongPtr(ctx->hwnd, GWLP_USERDATA, (LONG_PTR) s);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if(!st) { if(!st) {
vfw_read_close(s); vfw_read_close(s);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -193,7 +193,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
goto out; goto out;
} }
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) { if (!st) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto out; goto out;

View File

@ -141,7 +141,7 @@ static int fourxm_read_header(AVFormatContext *s,
fourxm->height = AV_RL32(&header[i + 40]); fourxm->height = AV_RL32(&header[i + 40]);
/* allocate a new AVStream */ /* allocate a new AVStream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st){ if (!st){
ret= AVERROR(ENOMEM); ret= AVERROR(ENOMEM);
goto fail; goto fail;

View File

@ -65,7 +65,7 @@ static int adts_aac_read_header(AVFormatContext *s,
{ {
AVStream *st; AVStream *st;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -57,7 +57,7 @@ static int aea_read_probe(AVProbeData *p)
static int aea_read_header(AVFormatContext *s, static int aea_read_header(AVFormatContext *s,
AVFormatParameters *ap) AVFormatParameters *ap)
{ {
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -196,7 +196,7 @@ static int aiff_read_header(AVFormatContext *s,
filesize -= 4; filesize -= 4;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -84,7 +84,7 @@ static int amr_read_header(AVFormatContext *s,
avio_read(pb, header, 6); avio_read(pb, header, 6);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
{ {
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -97,7 +97,7 @@ static int read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
/* video stream */ /* video stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

View File

@ -39,7 +39,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rl32(pb); /* _APC */ avio_rl32(pb); /* _APC */
avio_rl32(pb); /* 1.20 */ avio_rl32(pb); /* 1.20 */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -313,7 +313,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
ape->compressiontype); ape->compressiontype);
/* now we are ready: build format streams */ /* now we are ready: build format streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;

View File

@ -227,7 +227,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
pos1 = avio_tell(pb); pos1 = avio_tell(pb);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */ av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */

View File

@ -83,7 +83,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
uint8_t *p, **dst[2]={0}; uint8_t *p, **dst[2]={0};
int pos[2]={0}; int pos[2]={0};
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
av_set_pts_info(st, 64, 1, 100); av_set_pts_info(st, 64, 1, 100);

View File

@ -151,7 +151,7 @@ static int au_read_header(AVFormatContext *s,
} }
/* now we are ready: build format streams */ /* now we are ready: build format streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -70,7 +70,7 @@ static int vid_read_header(AVFormatContext *s,
avio_skip(pb, 5); avio_skip(pb, 5);
vid->nframes = avio_rl16(pb); vid->nframes = avio_rl16(pb);
stream = av_new_stream(s, 0); stream = avformat_new_stream(s, NULL);
if (!stream) if (!stream)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps 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); avio_rl16(pb);
// done with video codec, set up audio codec // done with video codec, set up audio codec
stream = av_new_stream(s, 0); stream = avformat_new_stream(s, NULL);
if (!stream) if (!stream)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -55,12 +55,12 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
int fps, chunk_header; int fps, chunk_header;
/* Initialize the video codec... */ /* Initialize the video codec... */
vstream = av_new_stream(s, 0); vstream = avformat_new_stream(s, NULL);
if (!vstream) if (!vstream)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
/* Initialize the audio codec... */ /* Initialize the audio codec... */
astream = av_new_stream(s, 0); astream = avformat_new_stream(s, NULL);
if (!astream) if (!astream)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -78,7 +78,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
uint16_t flags; uint16_t flags;
int keyframe; int keyframe;
vst = av_new_stream(s, 0); vst = avformat_new_stream(s, NULL);
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -79,7 +79,7 @@ static int read_header(AVFormatContext *s,
/* Audio streams are added if audio packets are found */ /* Audio streams are added if audio packets are found */
s->ctx_flags |= AVFMTCTX_NOHEADER; s->ctx_flags |= AVFMTCTX_NOHEADER;
video = av_new_stream(s, 0); video = avformat_new_stream(s, NULL);
if (!video) if (!video)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -61,7 +61,7 @@ static int read_desc_chunk(AVFormatContext *s)
int flags; int flags;
/* new audio stream */ /* new audio stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -28,7 +28,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *vst; AVStream *vst;
int ret; int ret;
vst = av_new_stream(s, 0); vst = avformat_new_stream(s, NULL);
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -21,7 +21,7 @@
#include "avformat.h" #include "avformat.h"
static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -45,7 +45,7 @@ static int dfa_read_header(AVFormatContext *s,
avio_skip(pb, 2); // unused avio_skip(pb, 2); // unused
frames = avio_rl16(pb); frames = avio_rl16(pb);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -107,7 +107,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
cin->audio_buffer_size = 0; cin->audio_buffer_size = 0;
/* initialize the video decoder stream */ /* initialize the video decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -120,7 +120,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->height = hdr->video_frame_height; st->codec->height = hdr->video_frame_height;
/* initialize the audio decoder stream */ /* initialize the audio decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -211,7 +211,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
/* Dynamic handling of the audio streams in DV */ /* Dynamic handling of the audio streams in DV */
for (i = 0; i < ach; i++) { for (i = 0; i < ach; i++) {
if (!c->ast[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]) if (!c->ast[i])
break; break;
av_set_pts_info(c->ast[i], 64, 1, 30000); av_set_pts_info(c->ast[i], 64, 1, 30000);
@ -278,7 +278,7 @@ DVDemuxContext* dv_init_demux(AVFormatContext *s)
if (!c) if (!c)
return NULL; return NULL;
c->vst = av_new_stream(s, 0); c->vst = avformat_new_stream(s, NULL);
if (!c->vst) { if (!c->vst) {
av_free(c); av_free(c);
return NULL; return NULL;

View File

@ -87,7 +87,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
h = avio_rb16(pb); h = avio_rb16(pb);
c->has_sound = 0; c->has_sound = 0;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
@ -100,7 +100,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_skip(pb, 16); avio_skip(pb, 16);
fsize = avio_rl32(pb); fsize = avio_rl32(pb);
ast = av_new_stream(s, 0); ast = avformat_new_stream(s, NULL);
if (!ast) if (!ast)
return -1; return -1;
ret = ff_get_wav_header(pb, ast->codec, fsize); ret = ff_get_wav_header(pb, ast->codec, fsize);

View File

@ -64,7 +64,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap)
sample_rate = avio_rb16(pb); sample_rate = avio_rb16(pb);
avio_skip(pb, 12); avio_skip(pb, 12);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -410,7 +410,7 @@ static int ea_read_header(AVFormatContext *s,
if (ea->video_codec) { if (ea->video_codec) {
/* initialize the video decoder stream */ /* initialize the video decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ea->video_stream_index = st->index; ea->video_stream_index = st->index;
@ -435,7 +435,7 @@ static int ea_read_header(AVFormatContext *s,
} }
/* initialize the audio decoder stream */ /* initialize the audio decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, ea->sample_rate); av_set_pts_info(st, 33, 1, ea->sample_rate);

View File

@ -290,7 +290,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
for(i=0;i<nb_streams;i++) { for(i=0;i<nb_streams;i++) {
char rc_eq_buf[128]; char rc_eq_buf[128];
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
goto fail; goto fail;

View File

@ -132,7 +132,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
get_line(s->pb, line, sizeof(line)); get_line(s->pb, line, sizeof(line));
if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) { if (!memcmp(line, ID_STREAM, strlen(ID_STREAM))) {
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;

View File

@ -49,7 +49,7 @@ static int read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -31,7 +31,7 @@ static int flac_read_header(AVFormatContext *s,
int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0; int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
uint8_t header[4]; uint8_t header[4];
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -105,7 +105,7 @@ static int flic_read_header(AVFormatContext *s,
speed = FLIC_DEFAULT_SPEED; speed = FLIC_DEFAULT_SPEED;
/* initialize the decoder streams */ /* initialize the decoder streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
flic->video_stream_index = st->index; flic->video_stream_index = st->index;

View File

@ -153,7 +153,7 @@ static int idcin_read_header(AVFormatContext *s,
bytes_per_sample = avio_rl32(pb); bytes_per_sample = avio_rl32(pb);
channels = avio_rl32(pb); channels = avio_rl32(pb);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, IDCIN_FPS); 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 is 0, assume no audio */
if (sample_rate) { if (sample_rate) {
idcin->audio_present = 1; idcin->audio_present = 1;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, IDCIN_FPS); av_set_pts_info(st, 33, 1, IDCIN_FPS);

View File

@ -84,7 +84,7 @@ static int roq_read_header(AVFormatContext *s,
roq->audio_frame_count = 0; roq->audio_frame_count = 0;
roq->audio_stream_index = -1; roq->audio_stream_index = -1;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 63, 1, framerate); av_set_pts_info(st, 63, 1, framerate);

View File

@ -115,7 +115,7 @@ static int iff_read_header(AVFormatContext *s,
uint32_t chunk_id, data_size; uint32_t chunk_id, data_size;
int compression = -1; int compression = -1;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -216,7 +216,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
s1->ctx_flags |= AVFMTCTX_NOHEADER; s1->ctx_flags |= AVFMTCTX_NOHEADER;
st = av_new_stream(s1, 0); st = avformat_new_stream(s1, NULL);
if (!st) { if (!st) {
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }

View File

@ -559,7 +559,7 @@ static int ipmovie_read_header(AVFormatContext *s,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
/* initialize the stream decoders */ /* initialize the stream decoders */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 63, 1, 1000000); 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; st->codec->bits_per_coded_sample = ipmovie->video_bpp;
if (ipmovie->audio_type) { if (ipmovie->audio_type) {
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate); av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);

View File

@ -88,7 +88,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap)
iss->sample_start_pos = avio_tell(pb); iss->sample_start_pos = avio_tell(pb);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -40,7 +40,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
AVStream *st; AVStream *st;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -40,7 +40,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_rl16(s->pb); // version avio_rl16(s->pb); // version
avio_rl16(s->pb); // header size avio_rl16(s->pb); // header size
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -69,7 +69,7 @@ static int read_header(AVFormatContext *s,
avio_skip(pb, 80); avio_skip(pb, 80);
ast = av_new_stream(s, 0); ast = avformat_new_stream(s, NULL);
vst = av_new_stream(s, 1); vst = av_new_stream(s, 1);
if (!ast || !vst) if (!ast || !vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -60,7 +60,7 @@ static int lmlm4_probe(AVProbeData * pd) {
static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) { static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st; AVStream *st;
if (!(st = av_new_stream(s, 0))) if (!(st = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_MPEG4; st->codec->codec_id = CODEC_ID_MPEG4;

View File

@ -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) if ((ret = avio_read(pb, header_data, LXF_HEADER_DATA_SIZE)) != LXF_HEADER_DATA_SIZE)
return ret < 0 ? ret : AVERROR_EOF; return ret < 0 ? ret : AVERROR_EOF;
if (!(st = av_new_stream(s, 0))) if (!(st = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->duration = AV_RL32(&header_data[32]); st->duration = AV_RL32(&header_data[32]);

View File

@ -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) if (st == NULL)
return AVERROR(ENOMEM); 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)) { attachements[j].bin.data && attachements[j].bin.size > 0)) {
av_log(matroska->ctx, AV_LOG_ERROR, "incomplete attachment\n"); av_log(matroska->ctx, AV_LOG_ERROR, "incomplete attachment\n");
} else { } else {
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (st == NULL) if (st == NULL)
break; break;
av_dict_set(&st->metadata, "filename",attachements[j].filename, 0); av_dict_set(&st->metadata, "filename",attachements[j].filename, 0);

View File

@ -105,7 +105,7 @@ static int read_header(AVFormatContext *s,
avio_skip(pb, length - 10); /* unknown data */ avio_skip(pb, length - 10); /* unknown data */
/* video stream */ /* video stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@ -117,7 +117,7 @@ static int read_header(AVFormatContext *s,
/* audio stream */ /* audio stream */
if (length == MM_HEADER_LEN_AV) { if (length == MM_HEADER_LEN_AV) {
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -241,7 +241,7 @@ static int mmf_read_header(AVFormatContext *s,
} }
mmf->data_size = size; mmf->data_size = size;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -137,7 +137,7 @@ static int mp3_read_header(AVFormatContext *s,
AVStream *st; AVStream *st;
int64_t off; int64_t off;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -84,7 +84,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->curbits = 8; c->curbits = 8;
c->frames_noted = 0; c->frames_noted = 0;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -222,7 +222,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
c->samples = ffio_read_varlen(pb); c->samples = ffio_read_varlen(pb);
ffio_read_varlen(pb); //silence samples at the beginning ffio_read_varlen(pb); //silence samples at the beginning
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -1550,7 +1550,7 @@ static int mpegts_read_header(AVFormatContext *s,
/* only read packets */ /* only read packets */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
goto fail; goto fail;
av_set_pts_info(st, 60, 1, 27000000); av_set_pts_info(st, 60, 1, 27000000);

View File

@ -75,7 +75,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
AVCodecContext *codec; AVCodecContext *codec;
AVStream *st; AVStream *st;
st = av_new_stream(ctx, 0); st = avformat_new_stream(ctx, NULL);
if(!st) if(!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -42,11 +42,11 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *ast, *vst; AVStream *ast, *vst;
unsigned int version, frames_count, msecs_per_frame, player_version; unsigned int version, frames_count, msecs_per_frame, player_version;
ast = av_new_stream(s, 0); ast = avformat_new_stream(s, NULL);
if (!ast) if (!ast)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
vst = av_new_stream(s, 0); vst = avformat_new_stream(s, NULL);
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -45,7 +45,7 @@ static int nc_probe(AVProbeData *probe_packet)
static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap) 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) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -307,7 +307,7 @@ static int oma_read_header(AVFormatContext *s,
codec_params = AV_RB24(&buf[33]); codec_params = AV_RB24(&buf[33]);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -200,7 +200,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id)
AVCodecContext *c; AVCodecContext *c;
AVStream *st; AVStream *st;
st = av_new_stream(oc, 0); st = avformat_new_stream(oc, NULL);
if (!st) { if (!st) {
fprintf(stderr, "Could not alloc stream\n"); fprintf(stderr, "Could not alloc stream\n");
exit(1); exit(1);

View File

@ -162,7 +162,7 @@ static int str_read_packet(AVFormatContext *s,
if(str->channels[channel].video_stream_index < 0){ if(str->channels[channel].video_stream_index < 0){
/* allocate a new AVStream */ /* allocate a new AVStream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 15); 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){ if(str->channels[channel].audio_stream_index < 0){
int fmt = sector[0x13]; int fmt = sector[0x13];
/* allocate a new AVStream */ /* allocate a new AVStream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -43,7 +43,7 @@ static int pva_probe(AVProbeData * pd) {
static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st; AVStream *st;
if (!(st = av_new_stream(s, 0))) if (!(st = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_MPEG2VIDEO; st->codec->codec_id = CODEC_ID_MPEG2VIDEO;

View File

@ -84,7 +84,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
QCPContext *c = s->priv_data; QCPContext *c = s->priv_data;
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
uint8_t buf[16]; uint8_t buf[16];
int i, nb_rates; int i, nb_rates;

View File

@ -52,7 +52,7 @@ static int read_atom(AVFormatContext *s, Atom *atom)
static int r3d_read_red1(AVFormatContext *s) static int r3d_read_red1(AVFormatContext *s)
{ {
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
char filename[258]; char filename[258];
int tmp; int tmp;
int av_unused tmp2; int av_unused tmp2;

View File

@ -33,7 +33,7 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *st; AVStream *st;
enum CodecID id; enum CodecID id;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); 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, int ff_raw_audio_read_header(AVFormatContext *s,
AVFormatParameters *ap) AVFormatParameters *ap)
{ {
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
@ -143,7 +143,7 @@ int ff_raw_video_read_header(AVFormatContext *s,
int ret = 0; int ret = 0;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) { if (!st) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail; goto fail;

View File

@ -110,7 +110,7 @@ static av_cold int rl2_read_header(AVFormatContext *s,
def_sound_size = avio_rl16(pb); def_sound_size = avio_rl16(pb);
/** setup video stream */ /** setup video stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if(!st) if(!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -140,7 +140,7 @@ static av_cold int rl2_read_header(AVFormatContext *s,
pts_num = def_sound_size; pts_num = def_sound_size;
pts_den = rate; pts_den = rate;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -396,7 +396,7 @@ static int rm_read_header_old(AVFormatContext *s)
AVStream *st; AVStream *st;
rm->old_format = 1; rm->old_format = 1;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
st->priv_data = ff_rm_alloc_rmstream(); 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); rm_read_metadata(s, 1);
break; break;
case MKTAG('M', 'D', 'P', 'R'): case MKTAG('M', 'D', 'P', 'R'):
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->id = avio_rb16(pb); st->id = avio_rb16(pb);

View File

@ -139,7 +139,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap)
av_dict_set(&s->metadata, "author" , line, 0); av_dict_set(&s->metadata, "author" , line, 0);
// video headers // video headers
vst = av_new_stream(s, 0); vst = avformat_new_stream(s, NULL);
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; 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. // samples, though. This code will ignore additional tracks.
audio_format = read_line_and_int(pb, &error); // audio format ID audio_format = read_line_and_int(pb, &error); // audio format ID
if (audio_format) { if (audio_format) {
ast = av_new_stream(s, 0); ast = avformat_new_stream(s, NULL);
if (!ast) if (!ast)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -54,7 +54,7 @@ static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap)
} }
/* now we are ready: build format streams */ /* now we are ready: build format streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -43,7 +43,7 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
return NULL; return NULL;
rtpctx->oformat = rtp_format; rtpctx->oformat = rtp_format;
if (!av_new_stream(rtpctx, 0)) { if (!avformat_new_stream(rtpctx, NULL)) {
av_free(rtpctx); av_free(rtpctx);
return NULL; return NULL;
} }

View File

@ -134,7 +134,7 @@ static int film_read_header(AVFormatContext *s,
/* initialize the decoder streams */ /* initialize the decoder streams */
if (film->video_type) { if (film->video_type) {
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
film->video_stream_index = st->index; film->video_stream_index = st->index;
@ -146,7 +146,7 @@ static int film_read_header(AVFormatContext *s,
} }
if (film->audio_type) { if (film->audio_type) {
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
film->audio_stream_index = st->index; film->audio_stream_index = st->index;

View File

@ -104,7 +104,7 @@ static int vmd_read_header(AVFormatContext *s,
else else
vmd->is_indeo3 = 0; vmd->is_indeo3 = 0;
/* start up the decoders */ /* start up the decoders */
vst = av_new_stream(s, 0); vst = avformat_new_stream(s, NULL);
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(vst, 33, 1, 10); 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 */ /* if sample rate is 0, assume no audio */
vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]); vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]);
if (vmd->sample_rate) { if (vmd->sample_rate) {
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
vmd->audio_stream_index = st->index; vmd->audio_stream_index = st->index;

View File

@ -71,7 +71,7 @@ static int siff_probe(AVProbeData *p)
static int create_audio_stream(AVFormatContext *s, SIFFContext *c) static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
{ {
AVStream *ast; AVStream *ast;
ast = av_new_stream(s, 0); ast = avformat_new_stream(s, NULL);
if (!ast) if (!ast)
return -1; return -1;
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; 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 avio_skip(pb, 16); //zeroes
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

View File

@ -154,7 +154,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
} }
/* init video codec */ /* init video codec */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
smk->videoindex = st->index; smk->videoindex = st->index;
@ -177,7 +177,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
for(i = 0; i < 7; i++) { for(i = 0; i < 7; i++) {
smk->indexes[i] = -1; smk->indexes[i] = -1;
if (smk->rates[i]) { if (smk->rates[i]) {
ast[i] = av_new_stream(s, 0); ast[i] = avformat_new_stream(s, NULL);
smk->indexes[i] = ast[i]->index; smk->indexes[i] = ast[i]->index;
ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
if (smk->aflags[i] & SMK_AUD_BINKAUD) { if (smk->aflags[i] & SMK_AUD_BINKAUD) {

View File

@ -110,7 +110,7 @@ static int sol_read_header(AVFormatContext *s,
else id = 0; else id = 0;
/* now we are ready: build format streams */ /* now we are ready: build format streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -51,7 +51,7 @@ static int sox_read_header(AVFormatContext *s,
double sample_rate, sample_rate_frac; double sample_rate, sample_rate_frac;
AVStream *st; AVStream *st;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -205,7 +205,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!s->nb_streams) { if (!s->nb_streams) {
/* first packet, create a stream */ /* first packet, create a stream */
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
if (!st) { if (!st) {
av_free_packet(pkt); av_free_packet(pkt);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -42,7 +42,7 @@ static int srt_probe(AVProbeData *p)
static int srt_read_header(AVFormatContext *s, AVFormatParameters *ap) 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) if (!st)
return -1; return -1;
av_set_pts_info(st, 64, 1, 1000); av_set_pts_info(st, 64, 1, 1000);

View File

@ -94,7 +94,7 @@ static int thp_read_header(AVFormatContext *s,
break; break;
/* Video component. */ /* Video component. */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -117,7 +117,7 @@ static int thp_read_header(AVFormatContext *s,
break; break;
/* Audio component. */ /* Audio component. */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -206,7 +206,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap)
seq->audio_buffer_full = 0; seq->audio_buffer_full = 0;
/* initialize the video decoder stream */ /* initialize the video decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -219,7 +219,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->height = SEQ_FRAME_H; st->codec->height = SEQ_FRAME_H;
/* initialize the audio decoder stream */ /* initialize the audio decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -73,10 +73,10 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (avio_rl32(pb) != TMV_TAG) if (avio_rl32(pb) != TMV_TAG)
return -1; return -1;
if (!(vst = av_new_stream(s, 0))) if (!(vst = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
if (!(ast = av_new_stream(s, 0))) if (!(ast = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ast->codec->sample_rate = avio_rl16(pb); ast->codec->sample_rate = avio_rl16(pb);

View File

@ -77,7 +77,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1; return -1;
} }
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -76,7 +76,7 @@ static int read_header(AVFormatContext *avctx,
{ {
TtyDemuxContext *s = avctx->priv_data; TtyDemuxContext *s = avctx->priv_data;
int width = 0, height = 0, ret = 0; int width = 0, height = 0, ret = 0;
AVStream *st = av_new_stream(avctx, 0); AVStream *st = avformat_new_stream(avctx, NULL);
AVRational framerate; AVRational framerate;
if (!st) { if (!st) {

View File

@ -40,7 +40,7 @@ static int txd_probe(AVProbeData * pd) {
static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) { static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st; AVStream *st;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

View File

@ -54,7 +54,7 @@ static int vc1t_read_header(AVFormatContext *s,
return -1; return -1;
/* init video codec */ /* init video codec */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;

View File

@ -52,7 +52,7 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap)
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
} }
avio_skip(pb, header_size); avio_skip(pb, header_size);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -64,7 +64,7 @@ static void add_metadata(AVFormatContext *s, const char *tag,
static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
VqfContext *c = s->priv_data; VqfContext *c = s->priv_data;
AVStream *st = av_new_stream(s, 0); AVStream *st = avformat_new_stream(s, NULL);
int chunk_tag; int chunk_tag;
int rate_flag = -1; int rate_flag = -1;
int header_size; int header_size;

View File

@ -273,7 +273,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
int ret; int ret;
/* parse fmt header */ /* parse fmt header */
*st = av_new_stream(s, 0); *st = avformat_new_stream(s, NULL);
if (!*st) if (!*st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -636,7 +636,7 @@ static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap)
return -1; return -1;
} }
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -163,7 +163,7 @@ static int wc3_read_header(AVFormatContext *s,
} while (fourcc_tag != BRCH_TAG); } while (fourcc_tag != BRCH_TAG);
/* initialize the decoder streams */ /* initialize the decoder streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, WC3_FRAME_FPS); 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->width = wc3->width;
st->codec->height = wc3->height; st->codec->height = wc3->height;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, WC3_FRAME_FPS); av_set_pts_info(st, 33, 1, WC3_FRAME_FPS);

View File

@ -144,7 +144,7 @@ static int wsaud_read_header(AVFormatContext *s,
wsaud->audio_bits = (((header[10] & 0x2) >> 1) + 1) * 8; wsaud->audio_bits = (((header[10] & 0x2) >> 1) + 1) * 8;
/* initialize the audio decoder stream */ /* initialize the audio decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, wsaud->audio_samplerate); 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; unsigned int chunk_size;
/* initialize the video decoder stream */ /* initialize the video decoder stream */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, VQA_FRAMERATE); 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 */ /* 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)) { 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) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
av_set_pts_info(st, 33, 1, VQA_FRAMERATE); av_set_pts_info(st, 33, 1, VQA_FRAMERATE);

View File

@ -481,7 +481,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
if (!filesize) if (!filesize)
goto done; goto done;
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
goto done; goto done;
av_dict_set(&st->metadata, "title", description, 0); av_dict_set(&st->metadata, "title", description, 0);

View File

@ -220,7 +220,7 @@ static int wv_read_header(AVFormatContext *s,
} }
/* now we are ready: build format streams */ /* now we are ready: build format streams */
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return -1; return -1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;

View File

@ -70,7 +70,7 @@ static int xa_read_header(AVFormatContext *s,
AVStream *st; AVStream *st;
/*Set up the XA Audio Decoder*/ /*Set up the XA Audio Decoder*/
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -150,7 +150,7 @@ static int xmv_read_header(AVFormatContext *s,
/* Video track */ /* Video track */
vst = av_new_stream(s, 0); vst = avformat_new_stream(s, NULL);
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -69,7 +69,7 @@ static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (tag != MKTAG('f', 'm', 't', ' ')) if (tag != MKTAG('f', 'm', 't', ' '))
return -1; return -1;
size = avio_rl32(pb); size = avio_rl32(pb);
st = av_new_stream(s, 0); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

View File

@ -56,7 +56,7 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap)
int frame_rate, ret; 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); video_stream = av_new_stream(s, 1);
// Extra data that will be passed to the decoder // Extra data that will be passed to the decoder

Some files were not shown because too many files have changed in this diff Show More