mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 01:02:33 +00:00
avformat/utils: Exclude the header size when computing duration from bit_rate
This improves the estimate for MP3s with cover art tags. Fixes Ticket2931 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
f044fc0372
commit
e9c08e32d6
@ -2287,7 +2287,8 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
|
||||
if (ic->duration == AV_NOPTS_VALUE &&
|
||||
ic->bit_rate != 0) {
|
||||
filesize = ic->pb ? avio_size(ic->pb) : 0;
|
||||
if (filesize > 0) {
|
||||
if (filesize > ic->data_offset) {
|
||||
filesize -= ic->data_offset;
|
||||
for (i = 0; i < ic->nb_streams; i++) {
|
||||
st = ic->streams[i];
|
||||
if ( st->time_base.num <= INT64_MAX / ic->bit_rate
|
||||
|
Loading…
Reference in New Issue
Block a user