|  | @@ -151,15 +151,12 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	// Allocate video frame
 | 
	
		
			
				|  |  | -#ifdef _MSC_VER
 | 
	
		
			
				|  |  | +#if LIBAVUTIL_VERSION_MAJOR > 51
 | 
	
		
			
				|  |  |  	frame = av_frame_alloc();
 | 
	
		
			
				|  |  | -#else
 | 
	
		
			
				|  |  | -#if LIBAVUTIL_VERSION_MAJOR > 52
 | 
	
		
			
				|  |  | -	frame = av_alloc_frame();
 | 
	
		
			
				|  |  |  #else
 | 
	
		
			
				|  |  |  	frame = avcodec_alloc_frame();
 | 
	
		
			
				|  |  |  #endif
 | 
	
		
			
				|  |  | -#endif
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	//setup scaling
 | 
	
		
			
				|  |  |  	
 | 
	
	
		
			
				|  | @@ -396,15 +393,12 @@ void CVideoPlayer::close()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	if (frame)
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  | -#ifndef _MSC_VER
 | 
	
		
			
				|  |  | -#if LIBAVUTIL_VERSION_MAJOR > 52
 | 
	
		
			
				|  |  | -		av_frame_free(frame);
 | 
	
		
			
				|  |  | -#endif
 | 
	
		
			
				|  |  | +#if LIBAVUTIL_VERSION_MAJOR > 51
 | 
	
		
			
				|  |  | +		av_frame_free(&frame);//will be set to null
 | 
	
		
			
				|  |  |  #else
 | 
	
		
			
				|  |  |  		av_free(frame);
 | 
	
		
			
				|  |  | +		frame = nullptr;		
 | 
	
		
			
				|  |  |  #endif
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -		frame = nullptr;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	if (codec)
 |