Browse Source

guess fps for the variable fps case

Originally committed as revision 3768 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 20 years ago
parent
commit
3e76d1b526
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/utils.c

+ 5
- 0
libavformat/utils.c View File

@@ -746,6 +746,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
int64_t new_diff= ABS(st->cur_dts - pkt->pts); int64_t new_diff= ABS(st->cur_dts - pkt->pts);
if(old_diff < new_diff && old_diff < (pkt->duration>>3)){ if(old_diff < new_diff && old_diff < (pkt->duration>>3)){
pkt->pts += pkt->duration; pkt->pts += pkt->duration;
// av_log(NULL, AV_LOG_DEBUG, "id:%d old:%Ld new:%Ld dur:%d cur:%Ld size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
} }
} }
@@ -1743,6 +1744,10 @@ int av_find_stream_info(AVFormatContext *ic)
st = ic->streams[i]; st = ic->streams[i];
if (!has_codec_parameters(&st->codec)) if (!has_codec_parameters(&st->codec))
break; break;
/* variable fps and no guess at the real fps */
if( st->codec.frame_rate >= 1000LL*st->codec.frame_rate_base
&& best_duration[i]== INT64_MAX)
break;
} }
if (i == ic->nb_streams) { if (i == ic->nb_streams) {
/* NOTE: if the format has no header, then we need to read /* NOTE: if the format has no header, then we need to read


Loading…
Cancel
Save