mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-02 04:52:09 +00:00
ismindex: Calculate the file duration among the included tracks
If the input file contains other tracks (non video/audio) that aren't included in ismindex, the global file duration as returned by libavformat might not be equal to the maximum of the duration of the actual included tracks. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
d347a7b248
commit
583a287f6f
@ -292,8 +292,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;
|
||||||
@ -332,6 +330,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;
|
||||||
|
Loading…
Reference in New Issue
Block a user