aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-12-03 17:37:06 +0000
committerPaul B Mahol <onemda@gmail.com>2012-12-05 12:40:57 +0000
commitacac16b5c78366917d166d91ade01b713b9703e5 (patch)
tree9f99ad7a379b450d6c548798fae0f26e96a42925
parentc090b5427d89a58d99d75def05f0a353f132dc69 (diff)
downloadffmpeg-acac16b5c78366917d166d91ade01b713b9703e5.tar.gz
soxdec: use ff_pcm_read_packet()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavformat/soxdec.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index 4c951bbd73..159fd9a7a7 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -124,31 +124,11 @@ static int sox_read_header(AVFormatContext *s)
return 0;
}
-#define SOX_SAMPLES 1024
-
-static int sox_read_packet(AVFormatContext *s,
- AVPacket *pkt)
-{
- int ret, size;
-
- if (url_feof(s->pb))
- return AVERROR_EOF;
-
- size = SOX_SAMPLES*s->streams[0]->codec->block_align;
- ret = av_get_packet(s->pb, pkt, size);
- if (ret < 0)
- return AVERROR(EIO);
- pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
- pkt->stream_index = 0;
-
- return 0;
-}
-
AVInputFormat ff_sox_demuxer = {
.name = "sox",
.long_name = NULL_IF_CONFIG_SMALL("SoX native"),
.read_probe = sox_probe,
.read_header = sox_read_header,
- .read_packet = sox_read_packet,
+ .read_packet = ff_pcm_read_packet,
.read_seek = ff_pcm_read_seek,
};