X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmtv.c;h=00da9a1e490a2e69c998152a5b8811596d39b3e1;hb=cd2f7ed0007f4803b6bd845366b2398abb32c355;hp=2fa48cc70520283c91461ba9f2a063b9daf71ca5;hpb=30ba924bc8cec04f53089adbf4ef51b52c4b4b72;p=ffmpeg diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 2fa48cc7052..00da9a1e490 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -27,13 +27,12 @@ #include "libavutil/bswap.h" #include "libavutil/intreadwrite.h" #include "avformat.h" +#include "internal.h" #define MTV_ASUBCHUNK_DATA_SIZE 500 #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,11 +117,11 @@ 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); - av_set_pts_info(st, 64, 1, mtv->video_fps); + avpriv_set_pts_info(st, 64, 1, mtv->video_fps); st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->codec->pix_fmt = PIX_FMT_RGB565; @@ -134,11 +133,11 @@ 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); - av_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE); + avpriv_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE); st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MP3; st->codec->bit_rate = mtv->audio_br; @@ -171,7 +170,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 +189,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) for(i=0;iimg_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;