Skip to content

Commit 0a1e72f

Browse files
committed
remove unused code
1 parent fdf11fc commit 0a1e72f

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

jni/libmediaplayer/mediaplayer.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,10 @@ status_t MediaPlayer::prepareVideo()
114114
if (avcodec_open(mFFmpegStorage.video.codec_ctx, mFFmpegStorage.video.codec) < 0) {
115115
return INVALID_OPERATION;
116116
}
117-
// Allocate video frame
118-
mFFmpegStorage.pFrame = avcodec_alloc_frame();
119117

120118
mVideoWidth = mFFmpegStorage.video.codec_ctx->width;
121119
mVideoHeight = mFFmpegStorage.video.codec_ctx->height;
122120
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);
133121

134122
return NO_ERROR;
135123
}
@@ -191,9 +179,6 @@ status_t MediaPlayer::suspend() {
191179

192180
__android_log_print(ANDROID_LOG_ERROR, TAG, "suspended");
193181

194-
// Free the YUV frame
195-
av_free(mFFmpegStorage.pFrame);
196-
197182
// Close the codec
198183
avcodec_close(mFFmpegStorage.video.codec_ctx);
199184
avcodec_close(mFFmpegStorage.audio.codec_ctx);

jni/libmediaplayer/mediaplayer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ class MediaPlayer
160160

161161
// ffmpeg store struct
162162
struct ffmpeg_fields_t {
163-
AVFrame *pFrame;
164163
AVFormatContext *pFormatCtx;
165-
struct SwsContext *img_convert_ctx;
166164
struct ffmpeg_video_t video;
167165
struct ffmpeg_audio_t audio;
168166
} mFFmpegStorage;

0 commit comments

Comments
 (0)