summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-05-15 12:38:33 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-05-15 12:38:33 +0000
commita959f0ea7a2c27e38f26bdb526d7b4c49cc37f86 (patch)
treead1724a1e61bf7663c8057b94dd7db3c360b0828
parentfce9551efc1495d48f797fda0a85999007840dc5 (diff)
fix pcm_s24be demuxing, simplify
Originally committed as revision 5381 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/aiff.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/libavformat/aiff.c b/libavformat/aiff.c
index adf4be7f2f..00dc7c12b7 100644
--- a/libavformat/aiff.c
+++ b/libavformat/aiff.c
@@ -399,37 +399,20 @@ got_sound:
static int aiff_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
- offset_t pos;
- int res, size;
+ AVStream *st = s->streams[0];
+ int res;
/* End of stream may be reached */
if (url_feof(&s->pb))
return AVERROR_IO;
- /* Need to know if reached the end sound data */
- size = MAX_SIZE;
- if (s->file_size) {
- pos = url_ftell (&s->pb) - s->file_size;
- if (pos >= s->file_size)
- size = 0;
- else if (pos + MAX_SIZE >= s->file_size)
- size = s->file_size - pos;
- }
-
/* Now for that packet */
- res = av_get_packet (&s->pb, pkt, MAX_SIZE);
+ res = av_get_packet(&s->pb, pkt, (MAX_SIZE / st->codec->block_align) * st->codec->block_align);
if (res < 0)
return res;
/* Only one stream in an AIFF file */
pkt->stream_index = 0;
-
- /* Finaly fix the read to a block */
- if (size <= res)
- pkt->size = size - (size % s->streams[0]->codec->block_align);
- else
- pkt->size = res - (res % s->streams[0]->codec->block_align);
-
return 0;
}