]> git.sesse.net Git - kdenlive/blobdiff - src/lib/audio/audioInfo.cpp
Use QLatin1String
[kdenlive] / src / lib / audio / audioInfo.cpp
index c467a96aa59d4393d2fff5bb6f55e3adcc85ba2f..e9b88c49d47eaed3195874b13b1cd5b728082231 100644 (file)
 #include <iostream>
 #include <cstdlib>
 
-AudioInfo::AudioInfo(Mlt::Producer *producer)
+AudioInfo::AudioInfo(Mlt::Producer *producer) :
+    m_producer(NULL)
 {
     // Since we already receive an MLT producer, we do not need to initialize MLT:
     // Mlt::Factory::init(NULL);
 
     // Get the number of streams and add the information of each of them if it is an audio stream.
-    int streams = atoi(producer->get("meta.media.nb_streams"));
-    for (int i = 0; i < streams; i++) {
-        QByteArray propertyName = QString("meta.media.%1.stream.type").arg(i).toLocal8Bit();
-
-        if (strcmp("audio", producer->get(propertyName.data())) == 0) {
+    int streams = producer->get_int("meta.media.nb_streams");
+    for (int i = 0; i < streams; ++i) {
+        QByteArray propertyName = QString::fromLatin1("meta.media.%1.stream.type").arg(i).toLocal8Bit();
+        const char* streamtype = producer->get(propertyName.data());
+        if (streamtype && strcmp("audio", streamtype) == 0) {
             m_list << new AudioStreamInfo(producer, i);
         }
-
     }
 }