Commit 47a57c68 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '583a287f'

* commit '583a287f':
  ismindex: Calculate the file duration among the included tracks
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 5de251a3 583a287f
...@@ -298,8 +298,6 @@ static int handle_file(struct Tracks *tracks, const char *file, int split) ...@@ -298,8 +298,6 @@ static int handle_file(struct Tracks *tracks, const char *file, int split)
fprintf(stderr, "No streams found in %s\n", file); fprintf(stderr, "No streams found in %s\n", file);
goto fail; goto fail;
} }
if (!tracks->duration)
tracks->duration = ctx->duration;
for (i = 0; i < ctx->nb_streams; i++) { for (i = 0; i < ctx->nb_streams; i++) {
struct Track **temp; struct Track **temp;
...@@ -338,6 +336,10 @@ static int handle_file(struct Tracks *tracks, const char *file, int split) ...@@ -338,6 +336,10 @@ static int handle_file(struct Tracks *tracks, const char *file, int split)
continue; continue;
} }
tracks->duration = FFMAX(tracks->duration,
av_rescale_rnd(track->duration, AV_TIME_BASE,
track->timescale, AV_ROUND_UP));
if (track->is_audio) { if (track->is_audio) {
if (tracks->audio_track < 0) if (tracks->audio_track < 0)
tracks->audio_track = tracks->nb_tracks; tracks->audio_track = tracks->nb_tracks;
......
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