summaryrefslogtreecommitdiff
path: root/libavformat/mtv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-06-18 11:43:24 +0200
committerAnton Khirnov <anton@khirnov.net>2011-10-19 17:02:11 +0200
commit84ad31ff180fa089cd6bfd93c246336a16036455 (patch)
tree13dfd7e1445d6eafda50c6e3dd98030f464579af /libavformat/mtv.c
parent3b3bbdd3e63a3a1eaf69b861f72cf74f1669afe1 (diff)
downloadffmpeg-84ad31ff180fa089cd6bfd93c246336a16036455.tar.gz
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.
Diffstat (limited to 'libavformat/mtv.c')
-rw-r--r--libavformat/mtv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 59f13fe704..16e4c90eeb 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -32,8 +32,6 @@
#define MTV_HEADER_SIZE 512
#define MTV_AUDIO_PADDING_SIZE 12
#define AUDIO_SAMPLING_RATE 44100
-#define VIDEO_SID 0
-#define AUDIO_SID 1
typedef struct MTVDemuxContext {
@@ -118,7 +116,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
// video - raw rgb565
- st = av_new_stream(s, VIDEO_SID);
+ st = avformat_new_stream(s, NULL);
if(!st)
return AVERROR(ENOMEM);
@@ -134,7 +132,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
// audio - mp3
- st = av_new_stream(s, AUDIO_SID);
+ st = avformat_new_stream(s, NULL);
if(!st)
return AVERROR(ENOMEM);
@@ -171,7 +169,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
pkt->pos -= MTV_AUDIO_PADDING_SIZE;
- pkt->stream_index = AUDIO_SID;
+ pkt->stream_index = 1;
}else
{
@@ -190,7 +188,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
for(i=0;i<mtv->img_segment_size/2;i++)
*((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i));
#endif
- pkt->stream_index = VIDEO_SID;
+ pkt->stream_index = 0;
}
return ret;