Fix playlist clips have no audio regression.

Fixes #816
parent ed5e0ed3
Pipeline #38176 canceled with stage
......@@ -16,7 +16,7 @@ the Free Software Foundation, either version 3 of the License, or
#include <QString>
#include <cstdlib>
AudioStreamInfo::AudioStreamInfo(const std::shared_ptr<Mlt::Producer> &producer, int audioStreamIndex)
AudioStreamInfo::AudioStreamInfo(const std::shared_ptr<Mlt::Producer> &producer, int audioStreamIndex, bool playlist)
: m_audioStreamIndex(audioStreamIndex)
, m_ffmpegAudioIndex(0)
, m_samplingRate(48000)
......@@ -25,6 +25,10 @@ AudioStreamInfo::AudioStreamInfo(const std::shared_ptr<Mlt::Producer> &producer,
{
// Fetch audio streams
int streams = producer->get_int("meta.media.nb_streams");
if (playlist) {
// Playlist clips do not provide stream info
m_audioStreams.insert(0, i18n("Audio"));
}
int streamIndex = 1;
for (int ix = 0; ix < streams; ix++) {
char property[200];
......
......@@ -23,7 +23,7 @@ class AudioStreamInfo
{
public:
// TODO make that access a shared ptr instead of raw
AudioStreamInfo(const std::shared_ptr<Mlt::Producer> &producer, int audioStreamIndex);
AudioStreamInfo(const std::shared_ptr<Mlt::Producer> &producer, int audioStreamIndex, bool playlist = false);
~AudioStreamInfo();
int samplingRate() const;
......
......@@ -262,7 +262,7 @@ void ClipController::getInfoForProducer()
m_clipType = ClipType::Unknown;
}
if (audioIndex > -1 || m_clipType == ClipType::Playlist) {
m_audioInfo = std::make_unique<AudioStreamInfo>(m_masterProducer, audioIndex);
m_audioInfo = std::make_unique<AudioStreamInfo>(m_masterProducer, audioIndex, true);
// Load stream effects
for (int stream : m_audioInfo->streams().keys()) {
QString streamEffect = m_properties->get(QString("kdenlive:stream:%1").arg(stream).toUtf8().constData());
......
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