Commit 4fd6e5af authored by Marton Balint's avatar Marton Balint

ffplay: fix order of setting show_mode

Without the fix the refresh event may have got called with unset show mode.

Fixes ticket #2174.
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 571ef42d
...@@ -2641,10 +2641,11 @@ static int read_thread(void *arg) ...@@ -2641,10 +2641,11 @@ static int read_thread(void *arg)
if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) { if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) {
ret = stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]); ret = stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]);
} }
is->refresh_tid = SDL_CreateThread(refresh_thread, is);
if (is->show_mode == SHOW_MODE_NONE) if (is->show_mode == SHOW_MODE_NONE)
is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT; is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT;
is->refresh_tid = SDL_CreateThread(refresh_thread, is);
if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) { if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) {
stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]); stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]);
} }
......
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