diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-12-03 17:22:21 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-05 12:40:57 +0000 |
commit | 93dc8ed0a113ba0c66fe1191f942766d82664514 (patch) | |
tree | 449842e60d6ce4671b0c510c981b8fa49043591f /libavformat/pcm.c | |
parent | 99efd596267248ba5eae1b0e540d880368a402c3 (diff) | |
download | ffmpeg-93dc8ed0a113ba0c66fe1191f942766d82664514.tar.gz |
pcmdec: move read_packet function to pcm.c so it can be shared with other demuxers
While here remove pts/dts code, it is apparently not needed and cause
problems for demuxers that will use such function.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/pcm.c')
-rw-r--r-- | libavformat/pcm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/pcm.c b/libavformat/pcm.c index bba741de53..71f6a4f653 100644 --- a/libavformat/pcm.c +++ b/libavformat/pcm.c @@ -23,6 +23,24 @@ #include "avformat.h" #include "pcm.h" +#define RAW_SAMPLES 1024 + +int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt) +{ + int ret, size; + + size= RAW_SAMPLES*s->streams[0]->codec->block_align; + + ret= av_get_packet(s->pb, pkt, size); + + pkt->flags &= ~AV_PKT_FLAG_CORRUPT; + pkt->stream_index = 0; + if (ret < 0) + return ret; + + return ret; +} + int ff_pcm_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { |