From c170481aef3f524d1cb17a38e218dfc10a3f75f7 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sun, 24 Sep 2023 22:32:44 -0700 Subject: [PATCH] fix explicit audio_index and video_index not used The problem occurs when the mlt_service is `avformat` instead of `avformat-novalidate` and `audio_index` or `video_index` is supplied that is different than default but not `astream`/`vstream` properties (legacy project) properties. In that case, the explicit `audio_index` or `video_index` is ignored because `astream` and `vstream` are set to some default values. In that case, the project or command line fails to play the correct stream. TO reproduce `melt some-media-file audio_index=2`, for example (assuming there is a second audio track at index 2). regression in 52c5bde --- src/modules/avformat/producer_avformat.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 7479d7920..39a3717c6 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -250,16 +250,6 @@ mlt_producer producer_avformat_init(mlt_profile profile, const char *service, ch mlt_producer_close(producer); producer = NULL; } else if (self->seekable) { - mlt_properties_set_int(properties, - "astream", - relative_stream_index(self->audio_format, - AVMEDIA_TYPE_AUDIO, - self->audio_index)); - mlt_properties_set_int(properties, - "vstream", - relative_stream_index(self->video_format, - AVMEDIA_TYPE_VIDEO, - self->video_index)); // Close the file to release resources for large playlists - reopen later as needed if (self->audio_format) avformat_close_input(&self->audio_format);