File tree Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Expand file tree Collapse file tree 2 files changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -114,22 +114,10 @@ status_t MediaPlayer::prepareVideo()
114
114
if (avcodec_open (mFFmpegStorage .video .codec_ctx , mFFmpegStorage .video .codec ) < 0 ) {
115
115
return INVALID_OPERATION;
116
116
}
117
- // Allocate video frame
118
- mFFmpegStorage .pFrame = avcodec_alloc_frame ();
119
117
120
118
mVideoWidth = mFFmpegStorage .video .codec_ctx ->width ;
121
119
mVideoHeight = mFFmpegStorage .video .codec_ctx ->height ;
122
120
mDuration = mFFmpegStorage .pFormatCtx ->duration ;
123
- mFFmpegStorage .img_convert_ctx = sws_getContext (mVideoWidth ,
124
- mVideoHeight ,
125
- mFFmpegStorage .video .codec_ctx ->pix_fmt ,
126
- mVideoWidth ,
127
- mVideoHeight ,
128
- PIX_FMT_RGB565,
129
- SWS_POINT,
130
- NULL ,
131
- NULL ,
132
- NULL );
133
121
134
122
return NO_ERROR;
135
123
}
@@ -191,9 +179,6 @@ status_t MediaPlayer::suspend() {
191
179
192
180
__android_log_print (ANDROID_LOG_ERROR, TAG, " suspended" );
193
181
194
- // Free the YUV frame
195
- av_free (mFFmpegStorage .pFrame );
196
-
197
182
// Close the codec
198
183
avcodec_close (mFFmpegStorage .video .codec_ctx );
199
184
avcodec_close (mFFmpegStorage .audio .codec_ctx );
Original file line number Diff line number Diff line change @@ -160,9 +160,7 @@ class MediaPlayer
160
160
161
161
// ffmpeg store struct
162
162
struct ffmpeg_fields_t {
163
- AVFrame *pFrame;
164
163
AVFormatContext *pFormatCtx;
165
- struct SwsContext *img_convert_ctx;
166
164
struct ffmpeg_video_t video;
167
165
struct ffmpeg_audio_t audio;
168
166
} mFFmpegStorage ;
You can’t perform that action at this time.
0 commit comments