]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/apc.c
avio: deprecate url_fget_max_packet_size
[ffmpeg] / libavformat / apc.c
index 2e102a6ad785cabe804ea7cc442771a27a665b1b..bf93fc1522b10e2502489a6285fca9c6961eb3f3 100644 (file)
@@ -32,22 +32,22 @@ static int apc_probe(AVProbeData *p)
 
 static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    ByteIOContext *pb = s->pb;
+    AVIOContext *pb = s->pb;
     AVStream *st;
 
-    get_le32(pb); /* CRYO */
-    get_le32(pb); /* _APC */
-    get_le32(pb); /* 1.20 */
+    avio_rl32(pb); /* CRYO */
+    avio_rl32(pb); /* _APC */
+    avio_rl32(pb); /* 1.20 */
 
     st = av_new_stream(s, 0);
     if (!st)
         return AVERROR(ENOMEM);
 
-    st->codec->codec_type = CODEC_TYPE_AUDIO;
+    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS;
 
-    get_le32(pb); /* number of samples */
-    st->codec->sample_rate = get_le32(pb);
+    avio_rl32(pb); /* number of samples */
+    st->codec->sample_rate = avio_rl32(pb);
 
     st->codec->extradata_size = 2 * 4;
     st->codec->extradata = av_malloc(st->codec->extradata_size +
@@ -56,14 +56,14 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap)
         return AVERROR(ENOMEM);
 
     /* initial predictor values for adpcm decoder */
-    get_buffer(pb, st->codec->extradata, 2 * 4);
+    avio_read(pb, st->codec->extradata, 2 * 4);
 
     st->codec->channels = 1;
-    if (get_le32(pb))
+    if (avio_rl32(pb))
         st->codec->channels = 2;
 
-    st->codec->bits_per_sample = 4;
-    st->codec->bit_rate = st->codec->bits_per_sample * st->codec->channels
+    st->codec->bits_per_coded_sample = 4;
+    st->codec->bit_rate = st->codec->bits_per_coded_sample * st->codec->channels
                           * st->codec->sample_rate;
     st->codec->block_align = 1;
 
@@ -80,9 +80,9 @@ static int apc_read_packet(AVFormatContext *s, AVPacket *pkt)
     return 0;
 }
 
-AVInputFormat apc_demuxer = {
+AVInputFormat ff_apc_demuxer = {
     "apc",
-    "CRYO APC format",
+    NULL_IF_CONFIG_SMALL("CRYO APC format"),
     0,
     apc_probe,
     apc_read_header,