Fix svace 2.2 issue 12/100712/1
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 29 Nov 2016 04:49:30 +0000 (13:49 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 29 Nov 2016 04:49:30 +0000 (13:49 +0900)
Change-Id: I20351b4b4241ca4994cedfe27cad56e4cb272a1d
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
formats/ffmpeg/mm_file_format_imelody.c
packaging/libmm-fileinfo.spec

index 4b3a1d5..e5b5e7c 100755 (executable)
@@ -526,8 +526,6 @@ __AvConvertIMelody2MIDI(char *pMelodyBuf, unsigned int *pBufLen)
        int trackSize;
        int repeat = 0;
        int repeatCount = 0;
-       char vol = '%';
-       int volInterval = 0;
 
        for (count = 0; count < AV_MIDI_NOTE_MAX; count++) {
                restSpec[count] = 0;
@@ -1060,80 +1058,6 @@ __AvConvertIMelody2MIDI(char *pMelodyBuf, unsigned int *pBufLen)
                        repeatCount = 0;
        }
 
-       if (vol != '%') {
-               switch (vol) {
-                       case '+':
-                               midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] + VOL_INTERVAL;
-                               break;
-                       case '-':
-                               midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] - VOL_INTERVAL;
-                               break;
-                       default:
-                               break;
-               }
-
-               if (Melody[0].vol != '%') {
-                       switch (Melody[0].vol) {
-                               case '+':
-                                       midiData[52 + (6 * noteCount + 1)] += VOL_INTERVAL;
-                                       break;
-                               case '-':
-                                       midiData[52 + (6 * noteCount + 1)] -= VOL_INTERVAL;
-                                       break;
-                               default:
-                                       break;
-                       }
-               }
-
-               if (midiData[52 + (6 * noteCount + 1)] > MIDI_LIMIT)
-                       midiData[52 + (6 * noteCount + 1)] = MIDI_LIMIT;
-
-               if ((midiData[52 + (6 * (noteCount - 1) + 1)] == 0 || midiData[52 + (6 * (noteCount - 1) + 1)] == 7) && vol == '-') {
-                       midiData[52 + (6 * noteCount + 1)] = 0;
-
-                       if (Melody[0].vol == '+')
-                               midiData[52 + (6 * noteCount + 1)] = 12;
-               }
-
-               if ((midiData[52 + (6 * (noteCount - 1) + 1)] == 12 || midiData[52 + (6 * (noteCount - 1) + 1)] == 19) && vol == '-' && Melody[0].vol == '-')
-                       midiData[52 + (6 * noteCount + 1)] = 0;
-       }
-
-       else if (Melody[0].vol != '%' && vol == '%' && repeat != 0) {
-               switch (Melody[0].vol) {
-                       case '+':
-                               midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] + VOL_INTERVAL;
-                               break;
-                       case '-':
-                               midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)] - VOL_INTERVAL;
-                               break;
-                       default:
-                               break;
-               }
-
-               if (midiData[52 + (6 * noteCount + 1)] > MIDI_LIMIT)
-                       midiData[52 + (6 * noteCount + 1)] = MIDI_LIMIT;
-
-               if ((midiData[52 + (6 * (noteCount - 1) + 1)] == 0 || midiData[52 + (6 * (noteCount - 1) + 1)] == 7) && Melody[0].vol == '-')
-                       midiData[52 + (6 * noteCount + 1)] = 0;
-       }
-
-       else if (Melody[0].vol == '%' && vol == '%' && repeat != 0)
-               midiData[52 + (6 * noteCount + 1)] = midiData[52 + (6 * (noteCount - 1) + 1)];
-
-       volInterval = midiData[52 + (6 * noteCount + 1)] - midiData[53];
-
-       for (repeatCount = 0; repeatCount < repeat; repeatCount++)
-               for (number = 6 * noteCount * repeatCount + 1; number < 6 * noteCount * (repeatCount + 1); number = number + 6) {
-                       midiData[52 + (number + 6 * noteCount)] = midiData[52 + number] + volInterval;
-
-                       if (midiData[52 + number] + volInterval > MIDI_LIMIT)
-                               midiData[52 + (number + 6 * noteCount)] = MIDI_LIMIT;
-
-                       if (midiData[52 + number] < volInterval * (-1))
-                               midiData[52 + (number + 6 * noteCount)] = 0;
-               }
-
        for (number = 1; number < 6 * noteCount * (repeat + 1); number = number + 6) {
                if (midiData[52 + number] > MIDI_LIMIT)
                        midiData[52 + number] = MIDI_LIMIT;
@@ -1142,19 +1066,6 @@ __AvConvertIMelody2MIDI(char *pMelodyBuf, unsigned int *pBufLen)
        pMelodyBuf = pMelodyStart;
        count = noteCount;
 
-       if (repeat != 0) {
-               while (*pMelodyBuf != '@')
-                       pMelodyBuf++;
-
-               pMelodyBuf++;
-
-               if (vol != '%')
-                       pMelodyBuf = pMelodyBuf + 2;
-
-               while (!(*pMelodyBuf == '*' || *pMelodyBuf == '#' || *pMelodyBuf == '&' || *pMelodyBuf == 'r' || *pMelodyBuf == 'V' || *pMelodyBuf == 'E' || (*pMelodyBuf >= 'a' && *pMelodyBuf <= 'g')))
-                       pMelodyBuf++;
-       }
-
        if (*pMelodyBuf != 'E' && *pMelodyBuf != ':') {
                pMelodyBuf--;
 
index 14edf9a..f539101 100755 (executable)
@@ -1,6 +1,6 @@
 Name:      libmm-fileinfo
 Summary:    Media Fileinfo
-Version:    0.6.50
+Version:    0.6.51
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0