diff MediaPlayer.cpp @ 2380:56f87a5c402b

Merge
author Grumpy7
date Sat, 21 Jun 2014 00:42:34 +0200
parents 6eb63623cbe8
children 5d866ee28376 c4d286e4bb80
line wrap: on
line diff
--- a/MediaPlayer.cpp	Sat Jun 21 00:41:20 2014 +0200
+++ b/MediaPlayer.cpp	Sat Jun 21 00:42:34 2014 +0200
@@ -489,9 +489,9 @@
 	  // любой, для которых критические частоты в два раза меньше частота дискретизации
       sample_rate_half = (sample_rate + 1) / 2;	                    //22050
       if (dec_ctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
-         root = 2.0 / (sqrt(frame_len) * 32768.0);
+         root = 2.0 / (sqrt(float(frame_len)) * 32768.0);
       else
-         root = frame_len / (sqrt(frame_len) * 32768.0);
+         root = frame_len / (sqrt(float(frame_len)) * 32768.0);
       for (i = 0; i < 96; i++) 
 	  {
          /* constant is result of 0.066399999/log10(M_E) */
@@ -727,7 +727,7 @@
 
             device_buffer = provider->CreateTrack16(audio.dec_ctx->channels, audio.dec_ctx->sample_rate, 2, num_audio_samples, audio_plain_data.Ptr());
 
-            ReleaseAvcodec();
+            Release();
             return true;
           }
         }
@@ -813,6 +813,7 @@
 	  delete decoding_frame;
       if (last_resampled_frame_data[0])
         av_freep(&last_resampled_frame_data[0]);
+
     }
 
     bool Load(const wchar_t *filename, int dst_width, int dst_height, int cache_ms)	//Загрузка
@@ -990,7 +991,7 @@
           last_resampled_frame_num = desired_frame_number;
           memcpy(last_resampled_frame_data, rescaled_data, sizeof(rescaled_data));
           memcpy(last_resampled_frame_linesize, rescaled_linesize, sizeof(rescaled_linesize));
-          //вроде должен быть av_freep(&rescaled_data[0]);
+          //av_freep(&rescaled_data[0]);//вроде должен быть 
         }
       }
       else