ismindex: Use the individual stream duration instead of the global one

The stream duration is used for calculating the duration of the
last fragment easily without manually parsing anything else than
the mfra/tfra atoms. When the global file duration was used
previously, the duration of the last fragment could end up wrong
if the streams weren't equally long.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2013-10-03 01:52:37 +03:00
parent b698542ad8
commit d347a7b248

View File

@ -320,8 +320,7 @@ static int handle_file(struct Tracks *tracks, const char *file, int split)
track->bitrate = st->codec->bit_rate; track->bitrate = st->codec->bit_rate;
track->track_id = st->id; track->track_id = st->id;
track->timescale = st->time_base.den; track->timescale = st->time_base.den;
track->duration = av_rescale_rnd(ctx->duration, track->timescale, track->duration = st->duration;
AV_TIME_BASE, AV_ROUND_UP);
track->is_audio = st->codec->codec_type == AVMEDIA_TYPE_AUDIO; track->is_audio = st->codec->codec_type == AVMEDIA_TYPE_AUDIO;
track->is_video = st->codec->codec_type == AVMEDIA_TYPE_VIDEO; track->is_video = st->codec->codec_type == AVMEDIA_TYPE_VIDEO;