*/
#include "avformat.h"
+#include "internal.h"
static const uint8_t frame_size[4] = {24, 20, 4, 1};
{
AVStream *st;
- st = av_new_stream(s, 0);
+ st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->channels = 1;
st->codec->sample_rate = 8000;
- av_set_pts_info(st, 64, 1, st->codec->sample_rate);
+ avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
return 0;
}
{
int size, byte, ret;
- pkt->pos = url_ftell(s->pb);
- byte = get_byte(s->pb);
+ pkt->pos = avio_tell(s->pb);
+ byte = avio_r8(s->pb);
size = frame_size[byte & 3];
ret = av_new_packet(pkt, size);
pkt->duration = 240;
pkt->stream_index = 0;
- ret = get_buffer(s->pb, pkt->data + 1, size - 1);
+ ret = avio_read(s->pb, pkt->data + 1, size - 1);
if (ret < size - 1) {
av_free_packet(pkt);
return ret < 0 ? ret : AVERROR_EOF;