- // Get frame rate
- int vindex = producer->get_int("video_index");
-
- // List streams
- int streams = producer->get_int("meta.media.nb_streams");
- QList <int> audio_list;
- QList <int> video_list;
- for (int i = 0; i < streams; i++) {
- QByteArray propertyName = QString("meta.media.%1.stream.type").arg(i).toLocal8Bit();
- QString type = producer->get(propertyName.data());
- if (type == "audio") audio_list.append(i);
- else if (type == "video") video_list.append(i);
- }
-
- if (!info.xml.hasAttribute("video_index") && video_list.count() > 1) {
- // Clip has more than one video stream, ask which one should be used
- QMap <QString, QString> data;
- if (info.xml.hasAttribute("group")) data.insert("group", info.xml.attribute("group"));
- if (info.xml.hasAttribute("groupId")) data.insert("groupId", info.xml.attribute("groupId"));
- emit multiStreamFound(path, audio_list, video_list, data);
- // Force video index so that when reloading the clip we don't ask again for other streams
- filePropertyMap["video_index"] = QString::number(vindex);
- }
-
- if (vindex > -1) {
- snprintf(property, sizeof(property), "meta.media.%d.stream.frame_rate", vindex);
- if (producer->get(property))
- filePropertyMap["fps"] = producer->get(property);
+ int vindex = -1;
+ const QString mltService = producer->get("mlt_service");
+ if (mltService == "xml" || mltService == "consumer") {
+ // MLT playlist, create producer with blank profile to get real profile info
+ // TODO: is there an easier way to get this info (original source clip profile) from MLT?
+ Mlt::Profile *original_profile = new Mlt::Profile();
+ Mlt::Producer *tmpProd = new Mlt::Producer(*original_profile, path.toUtf8().constData());
+ filePropertyMap["progressive"] = QString::number(original_profile->progressive());
+ filePropertyMap["colorspace"] = QString::number(original_profile->colorspace());
+ filePropertyMap["fps"] = QString::number(original_profile->fps());
+ filePropertyMap["aspect_ratio"] = QString::number(original_profile->sar());
+ delete tmpProd;
+ delete original_profile;