Mercurial > libavformat.hg
comparison utils.c @ 3501:efcdb01aa0bf libavformat
We cannot calculate the duration of vorbis packets even if we do know the
"minimal" frame_size.
| author | michael |
|---|---|
| date | Wed, 25 Jun 2008 18:15:04 +0000 |
| parents | e54614e83ba4 |
| children | 322e2fb56ce8 |
comparison
equal
deleted
inserted
replaced
| 3500:102f7d89c2c8 | 3501:efcdb01aa0bf |
|---|---|
| 536 */ | 536 */ |
| 537 static int get_audio_frame_size(AVCodecContext *enc, int size) | 537 static int get_audio_frame_size(AVCodecContext *enc, int size) |
| 538 { | 538 { |
| 539 int frame_size; | 539 int frame_size; |
| 540 | 540 |
| 541 if(enc->codec_id == CODEC_ID_VORBIS) | |
| 542 return -1; | |
| 543 | |
| 541 if (enc->frame_size <= 1) { | 544 if (enc->frame_size <= 1) { |
| 542 int bits_per_sample = av_get_bits_per_sample(enc->codec_id); | 545 int bits_per_sample = av_get_bits_per_sample(enc->codec_id); |
| 543 | |
| 544 if(enc->codec_id == CODEC_ID_VORBIS) | |
| 545 return -1; | |
| 546 | 546 |
| 547 if (bits_per_sample) { | 547 if (bits_per_sample) { |
| 548 if (enc->channels == 0) | 548 if (enc->channels == 0) |
| 549 return -1; | 549 return -1; |
| 550 frame_size = (size << 3) / (bits_per_sample * enc->channels); | 550 frame_size = (size << 3) / (bits_per_sample * enc->channels); |
