]> git.sesse.net Git - kdenlive/commitdiff
Use new MLT names for audio frequency/channels, fixes broken audio thumbs
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 26 Dec 2012 08:58:18 +0000 (09:58 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 26 Dec 2012 08:58:18 +0000 (09:58 +0100)
src/renderer.cpp

index 4d146bf5430ef8ac879224511740dd348d3d9a3d..0d104aa2b1cae884f04b34df43eb04cd8be438f5 100644 (file)
@@ -984,8 +984,13 @@ void Render::processFileProperties()
         Mlt::Frame *frame = producer->get_frame();
         if (frame && frame->is_valid()) {
             filePropertyMap["frame_size"] = QString::number(frame->get_int("width")) + 'x' + QString::number(frame->get_int("height"));
-            filePropertyMap["frequency"] = QString::number(frame->get_int("frequency"));
-            filePropertyMap["channels"] = QString::number(frame->get_int("channels"));
+           int af = frame->get_int("audio_frequency");
+           int ac = frame->get_int("audio_channels");
+           // keep for compatibility with MLT <= 0.8.6
+           if (af == 0) af = frame->get_int("frequency");
+           if (ac == 0) ac = frame->get_int("channels");
+            filePropertyMap["frequency"] = QString::number(af);
+            filePropertyMap["channels"] = QString::number(ac);
             if (!filePropertyMap.contains("aspect_ratio")) filePropertyMap["aspect_ratio"] = frame->get("aspect_ratio");
 
             if (frame->get_int("test_image") == 0) {