Commit e9c08e32 authored by Hendrik Leppkes's avatar Hendrik Leppkes Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f044fc03
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment