aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-05-22 08:47:09 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-05-22 08:47:09 +0000
commitcefe0607dd751b58d08e7dca4a0c381e917f30d9 (patch)
tree30ebba3780627ddae88a8ff90678f2c1fd0075d7
parentded8477def9598d5c41208a74a6875e394da01c1 (diff)
downloadffmpeg-cefe0607dd751b58d08e7dca4a0c381e917f30d9.tar.gz
av_find_stream_info() end check fixes
10l (wrong time base) use timestamps if duration isnt available Originally committed as revision 4301 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9927cfca66..9791cc2686 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1797,7 +1797,7 @@ int av_find_stream_info(AVFormatContext *ic)
if (pkt->duration != 0)
st->codec_info_nb_frames++;
- if(st->codec.codec_type == CODEC_TYPE_VIDEO){
+ {
int index= pkt->stream_index;
int64_t last= last_dts[index];
int64_t duration= pkt->dts - last;
@@ -1811,6 +1811,8 @@ int av_find_stream_info(AVFormatContext *ic)
duration_sum[index] += duration;
duration_count[index]+= factor;
}
+ if(st->codec_info_nb_frames == 0)
+ st->codec_info_duration += duration;
}
last_dts[pkt->stream_index]= pkt->dts;
}
@@ -1835,7 +1837,7 @@ int av_find_stream_info(AVFormatContext *ic)
(st->codec.codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
try_decode_frame(st, pkt->data, pkt->size);
- if (st->codec_info_duration >= MAX_STREAM_DURATION) {
+ if (av_rescale_q(st->codec_info_duration, st->time_base, AV_TIME_BASE_Q) >= MAX_STREAM_DURATION) {
break;
}
count++;