提交 3af69371 编写于 作者: Z Zhang Rui

ff_ffplay: introuce video_refresh_thread

上级 1deb07b2
...@@ -2355,6 +2355,16 @@ static VideoState *stream_open(FFPlayer *ffp, const char *filename, AVInputForma ...@@ -2355,6 +2355,16 @@ static VideoState *stream_open(FFPlayer *ffp, const char *filename, AVInputForma
// MERGE: options // MERGE: options
// MERGE: show_usage // MERGE: show_usage
// MERGE: show_help_default // MERGE: show_help_default
static void video_refresh_thread(VideoState *is) {
double remaining_time = 0.0;
while (is->abort_request) {
if (remaining_time > 0.0)
av_usleep((int64_t)(remaining_time * 1000000.0));
remaining_time = REFRESH_RATE;
if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh))
video_refresh(is, &remaining_time);
}
}
static int lockmgr(void **mtx, enum AVLockOp op) static int lockmgr(void **mtx, enum AVLockOp op)
{ {
...@@ -2425,7 +2435,7 @@ void ijkff_global_init() ...@@ -2425,7 +2435,7 @@ void ijkff_global_init()
FFPlayer *ffp = malloc(sizeof(FFPlayer)); FFPlayer *ffp = malloc(sizeof(FFPlayer));
stream_open(ffp, NULL, NULL); stream_open(ffp, NULL, NULL);
stream_close(ffp); stream_close(ffp);
video_refresh(ffp, NULL); video_refresh_thread(ffp);
alloc_picture(NULL); alloc_picture(NULL);
/* test link end */ /* test link end */
} }
......
...@@ -386,6 +386,9 @@ typedef struct FFPlayer { ...@@ -386,6 +386,9 @@ typedef struct FFPlayer {
/* extra fields */ /* extra fields */
int sar_num; int sar_num;
int sar_den; int sar_den;
SDL_Thread *refresh_video_tid;
SDL_Thread _refresh_video_tid;
} FFPlayer; } FFPlayer;
#define IJKFF_SAFE_FREE(p) do {free(p); p = NULL;} while(0) #define IJKFF_SAFE_FREE(p) do {free(p); p = NULL;} while(0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册