[libav-devel] [PATCH 063/264] mpc8: switch to codecpar

Anton Khirnov anton at khirnov.net
Sun Dec 20 10:09:20 CET 2015


---
 libavformat/mpc8.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 3bc868e..2349ea5 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -237,19 +237,19 @@ static int mpc8_read_header(AVFormatContext *s)
     st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
-    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
-    st->codec->codec_id = AV_CODEC_ID_MUSEPACK8;
-    st->codec->bits_per_coded_sample = 16;
+    st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+    st->codecpar->codec_id = AV_CODEC_ID_MUSEPACK8;
+    st->codecpar->bits_per_coded_sample = 16;
 
-    st->codec->extradata_size = 2;
-    st->codec->extradata = av_mallocz(st->codec->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
-    avio_read(pb, st->codec->extradata, st->codec->extradata_size);
+    st->codecpar->extradata_size = 2;
+    st->codecpar->extradata = av_mallocz(st->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
+    avio_read(pb, st->codecpar->extradata, st->codecpar->extradata_size);
 
-    st->codec->channels = (st->codec->extradata[1] >> 4) + 1;
-    st->codec->sample_rate = mpc8_rate[st->codec->extradata[0] >> 5];
-    avpriv_set_pts_info(st, 32, 1152  << (st->codec->extradata[1]&3)*2, st->codec->sample_rate);
+    st->codecpar->channels = (st->codecpar->extradata[1] >> 4) + 1;
+    st->codecpar->sample_rate = mpc8_rate[st->codecpar->extradata[0] >> 5];
+    avpriv_set_pts_info(st, 32, 1152  << (st->codecpar->extradata[1]&3)*2, st->codecpar->sample_rate);
     st->start_time = 0;
-    st->duration = c->samples / (1152 << (st->codec->extradata[1]&3)*2);
+    st->duration = c->samples / (1152 << (st->codecpar->extradata[1]&3)*2);
     size -= avio_tell(pb) - pos;
 
     if (pb->seekable) {
-- 
2.0.0



More information about the libav-devel mailing list