Lines Matching refs:mp3
64 /* mp3 read */
134 MP3DecContext *mp3 = s->priv_data;
136 int fill_index = (mp3->usetoc || fast_seek) && duration > 0;
153 mp3->xing_toc = 1;
171 MP3DecContext *mp3 = s->priv_data;
180 mp3->is_cbr = v == MKBETAG('I', 'n', 'f', 'o');
181 if (v != MKBETAG('X', 'i', 'n', 'g') && !mp3->is_cbr)
186 mp3->frames = avio_rb32(s->pb);
188 mp3->header_filesize = avio_rb32(s->pb);
189 if (fsize && mp3->header_filesize) {
191 min = FFMIN(fsize, mp3->header_filesize);
192 delta = FFMAX(fsize, mp3->header_filesize) - min;
193 if (fsize > mp3->header_filesize && delta > min >> 4) {
194 mp3->frames = 0;
203 read_xing_toc(s, mp3->header_filesize, av_rescale_q(mp3->frames,
257 mp3->start_pad = v>>12;
258 mp3-> end_pad = v&4095;
259 sti->start_skip_samples = mp3->start_pad + 528 + 1;
260 if (mp3->frames) {
261 sti->first_discard_sample = -mp3->end_pad + 528 + 1 + mp3->frames * (int64_t)spf;
262 sti->last_discard_sample = mp3->frames * (int64_t)spf;
268 av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3-> end_pad);
299 MP3DecContext *mp3 = s->priv_data;
309 mp3->header_filesize = avio_rb32(s->pb);
310 mp3->frames = avio_rb32(s->pb);
323 MP3DecContext *mp3 = s->priv_data;
340 mp3->frames = 0;
341 mp3->header_filesize = 0;
346 if (!mp3->frames && !mp3->header_filesize)
352 if (mp3->frames)
353 st->duration = av_rescale_q(mp3->frames, (AVRational){spf, c.sample_rate},
355 if (mp3->header_filesize && mp3->frames && !mp3->is_cbr)
356 st->codecpar->bit_rate = av_rescale(mp3->header_filesize, 8 * c.sample_rate, mp3->frames * (int64_t)spf);
364 MP3DecContext *mp3 = s->priv_data;
384 // lcm of all mp3 sample rates
394 mp3->filesize = avio_size(s->pb);
450 MP3DecContext *mp3 = s->priv_data;
456 if (mp3->filesize > ID3v1_TAG_SIZE && pos < mp3->filesize)
457 size= FFMIN(size, mp3->filesize - pos);
553 MP3DecContext *mp3 = s->priv_data;
559 int64_t filesize = mp3->header_filesize;
567 if (mp3->xing_toc && (mp3->usetoc || (fast_seek && !mp3->is_cbr))) {
579 if (!mp3->is_cbr)
594 if (mp3->is_cbr && ie == &ie1 && mp3->frames) {
595 int frame_duration = av_rescale(st->duration, 1, mp3->frames);
596 ie1.timestamp = frame_duration * av_rescale(best_pos - si->data_offset, mp3->frames, mp3->header_filesize);
609 .class_name = "mp3",
617 .name = "mp3",
625 .extensions = "mp2,mp3,m2a,mpa", /* XXX: use probe */