From 84ad31ff180fa089cd6bfd93c246336a16036455 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 18 Jun 2011 11:43:24 +0200 Subject: lavf: replace av_new_stream->avformat_new_stream part II. Manual replacements are done in this commit. In many cases, the id is some constant made up number (e.g. 0 for video and 1 for audio), which is then not used in the demuxer for anything. Those ids are removed. --- libavformat/mxg.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libavformat/mxg.c') diff --git a/libavformat/mxg.c b/libavformat/mxg.c index 5caa68a667..2b69f7204f 100644 --- a/libavformat/mxg.c +++ b/libavformat/mxg.c @@ -24,8 +24,6 @@ #include "avformat.h" #include "avio.h" -#define VIDEO_STREAM_INDEX 0 -#define AUDIO_STREAM_INDEX 1 #define DEFAULT_PACKET_SIZE 1024 #define OVERREAD_SIZE 3 @@ -44,14 +42,14 @@ static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap) MXGContext *mxg = s->priv_data; /* video parameters will be extracted from the compressed bitstream */ - video_st = av_new_stream(s, VIDEO_STREAM_INDEX); + video_st = avformat_new_stream(s, NULL); if (!video_st) return AVERROR(ENOMEM); video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; video_st->codec->codec_id = CODEC_ID_MXPEG; av_set_pts_info(video_st, 64, 1, 1000000); - audio_st = av_new_stream(s, AUDIO_STREAM_INDEX); + audio_st = avformat_new_stream(s, NULL); if (!audio_st) return AVERROR(ENOMEM); audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO; @@ -166,7 +164,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) } pkt->pts = pkt->dts = mxg->dts; - pkt->stream_index = VIDEO_STREAM_INDEX; + pkt->stream_index = 0; pkt->destruct = NULL; pkt->size = mxg->buffer_ptr - mxg->soi_ptr; pkt->data = mxg->soi_ptr; @@ -204,7 +202,7 @@ static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt) if (marker == APP13 && size >= 16) { /* audio data */ /* time (GMT) of first sample in usec since 1970, little-endian */ pkt->pts = pkt->dts = AV_RL64(startmarker_ptr + 8); - pkt->stream_index = AUDIO_STREAM_INDEX; + pkt->stream_index = 1; pkt->destruct = NULL; pkt->size = size - 14; pkt->data = startmarker_ptr + 16; -- cgit v1.2.3