AVInputFormat *iformat;
int no_background;
int abort_request;
+ int force_refresh;
int paused;
int last_paused;
int seek_req;
SDL_Event event;
event.type = FF_REFRESH_EVENT;
event.user.data1 = opaque;
- if (!is->refresh) {
+ if (!is->refresh && (!is->paused || is->force_refresh)) {
is->refresh = 1;
SDL_PushEvent(&event);
}
goto retry;
}
+ if (is->paused)
+ goto display;
+
/* compute nominal last_duration */
last_duration = vp->pts - is->frame_last_pts;
if (last_duration > 0 && last_duration < 10.0) {
}
}
+display:
/* display picture */
if (!display_disable)
video_display(is);
- pictq_next_picture(is);
+ if (!is->paused)
+ pictq_next_picture(is);
}
} else if (is->audio_st) {
/* draw the next audio frame */
if (!display_disable)
video_display(is);
}
+ is->force_refresh = 0;
if (show_status) {
static int64_t last_time;
int64_t cur_time;
w = codec->width;
h = codec->height;
- if(av_image_check_size(w, h, 0, codec))
+ if(av_image_check_size(w, h, 0, codec) || codec->pix_fmt<0)
return -1;
avcodec_align_dimensions2(codec, &w, &h, stride);
} else {
picref = avfilter_get_video_buffer(link, AV_PERM_WRITE, link->w, link->h);
av_image_copy(picref->data, picref->linesize,
- priv->frame->data, priv->frame->linesize,
+ (const uint8_t **)(void **)priv->frame->data, priv->frame->linesize,
picref->format, link->w, link->h);
}
av_free_packet(&pkt);
break;
case SDLK_f:
toggle_full_screen(cur_stream);
+ cur_stream->force_refresh = 1;
break;
case SDLK_p:
case SDLK_SPACE:
break;
case SDLK_w:
toggle_audio_display(cur_stream);
+ cur_stream->force_refresh = 1;
break;
case SDLK_PAGEUP:
incr = 600.0;
break;
}
break;
+ case SDL_VIDEOEXPOSE:
+ cur_stream->force_refresh = 1;
+ break;
case SDL_MOUSEBUTTONDOWN:
if (exit_on_mousedown) {
do_exit(cur_stream);
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
screen_width = cur_stream->width = event.resize.w;
screen_height = cur_stream->height = event.resize.h;
+ cur_stream->force_refresh = 1;
break;
case SDL_QUIT:
case FF_QUIT_EVENT:
}
av_init_packet(&flush_pkt);
- flush_pkt.data = "FLUSH";
+ flush_pkt.data = (char *)(intptr_t)"FLUSH";
is = stream_open(input_filename, file_iformat);
if (!is) {