Commit 56e7852e authored by Alexander Reshetnikov's avatar Alexander Reshetnikov

Fixed a problem with AVI reading (removed avcodec_context)

parent a5a3c313
...@@ -218,7 +218,6 @@ struct CvCapture_FFMPEG ...@@ -218,7 +218,6 @@ struct CvCapture_FFMPEG
double dts_to_sec(int64_t dts); double dts_to_sec(int64_t dts);
AVFormatContext * ic; AVFormatContext * ic;
AVCodecContext * avcodec_context;
AVCodec * avcodec; AVCodec * avcodec;
int video_stream; int video_stream;
AVStream * video_st; AVStream * video_st;
...@@ -260,7 +259,6 @@ void CvCapture_FFMPEG::init() ...@@ -260,7 +259,6 @@ void CvCapture_FFMPEG::init()
img_convert_ctx = 0; img_convert_ctx = 0;
#endif #endif
avcodec_context = 0;
avcodec = 0; avcodec = 0;
frame_number = 0; frame_number = 0;
eps_zero = 0.000025; eps_zero = 0.000025;
...@@ -284,18 +282,6 @@ void CvCapture_FFMPEG::close() ...@@ -284,18 +282,6 @@ void CvCapture_FFMPEG::close()
video_st = NULL; video_st = NULL;
} }
if ( avcodec_context )
{
#if LIBAVFORMAT_BUILD > 4628
avcodec_close( avcodec_context );
#else
avcodec_close( &avcodec_context );
#endif
avcodec_context = NULL;
}
if( ic ) if( ic )
{ {
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2) #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2)
...@@ -331,10 +317,8 @@ bool CvCapture_FFMPEG::reopen() ...@@ -331,10 +317,8 @@ bool CvCapture_FFMPEG::reopen()
#if LIBAVFORMAT_BUILD > 4628 #if LIBAVFORMAT_BUILD > 4628
avcodec_close( video_st->codec ); avcodec_close( video_st->codec );
avcodec_close( avcodec_context );
#else #else
avcodec_close( &video_st->codec ); avcodec_close( &video_st->codec );
avcodec_close( &avcodec_context );
#endif #endif
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2) #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2)
av_close_input_file(ic); av_close_input_file(ic);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment