diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-06-07 09:49:04 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-06-07 09:49:04 +0000 |
commit | 5bafe0ce4463bad1c8443b0f4402e1ac38292ba8 (patch) | |
tree | 063d00cbbf1ea923ab9ed6fe1f5269a822b3d0c4 /libavformat/tta.c | |
parent | dc5c029f0285d6632837fd62a652dae7cd494113 (diff) | |
download | ffmpeg-5bafe0ce4463bad1c8443b0f4402e1ac38292ba8.tar.gz |
tta: replace datalen with nb_samples
This is less confusing.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r-- | libavformat/tta.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c index f9ef5975cf..ec006a8e70 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -57,7 +57,7 @@ static int tta_read_header(AVFormatContext *s) AVStream *st; int i, channels, bps, samplerate; uint64_t framepos, start_offset; - uint32_t datalen, crc; + uint32_t nb_samples, crc; if (s->pb->seekable) { ff_ape_parse_tag(s); @@ -80,9 +80,9 @@ static int tta_read_header(AVFormatContext *s) return AVERROR_INVALIDDATA; } - datalen = avio_rl32(s->pb); - if (!datalen) { - av_log(s, AV_LOG_ERROR, "invalid datalen\n"); + nb_samples = avio_rl32(s->pb); + if (!nb_samples) { + av_log(s, AV_LOG_ERROR, "invalid number of samples\n"); return AVERROR_INVALIDDATA; } @@ -93,10 +93,10 @@ static int tta_read_header(AVFormatContext *s) } c->frame_size = samplerate * 256 / 245; - c->last_frame_size = datalen % c->frame_size; + c->last_frame_size = nb_samples % c->frame_size; if (!c->last_frame_size) c->last_frame_size = c->frame_size; - c->totalframes = datalen / c->frame_size + (c->last_frame_size < c->frame_size); + c->totalframes = nb_samples / c->frame_size + (c->last_frame_size < c->frame_size); c->currentframe = 0; if(c->totalframes >= UINT_MAX/sizeof(uint32_t) || c->totalframes <= 0){ @@ -110,7 +110,7 @@ static int tta_read_header(AVFormatContext *s) avpriv_set_pts_info(st, 64, 1, samplerate); st->start_time = 0; - st->duration = datalen; + st->duration = nb_samples; framepos = avio_tell(s->pb) + 4*c->totalframes + 4; |