summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-08-06 21:14:29 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-08-06 21:14:29 +0000
commitc7385375bc4775afe89d17429d6daad7719e387d (patch)
tree015c33e6010d1ebfa610e4906eac6b89a2c0c4a9 /libavformat
parentb43387d447bfbb8500d389e9f6a95c963702a2c7 (diff)
ensure that the codec_id detection in av_find_stream_info() does not
destroy the first dts values Originally committed as revision 9965 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b5693b5da3..dd2d6823a2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1970,11 +1970,20 @@ int av_find_stream_info(AVFormatContext *ic)
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
- if (codec_identified[st->index]) {
- av_read_frame_flush(ic);
- av_seek_frame(ic, st->index, 0.0, 0);
- url_fseek(&ic->pb, ic->data_offset, SEEK_SET);
+ if (codec_identified[st->index])
+ break;
+ }
+ //FIXME this is a mess
+ if(i!=ic->nb_streams){
+ av_read_frame_flush(ic);
+ for(i=0;i<ic->nb_streams;i++) {
+ st = ic->streams[i];
+ if (codec_identified[st->index]) {
+ av_seek_frame(ic, st->index, 0.0, 0);
+ }
+ st->cur_dts= st->first_dts;
}
+ url_fseek(&ic->pb, ic->data_offset, SEEK_SET);
}
#if 0