ffplay: remove unnecessary if (cur_stream) checks

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Marton Balint 2011-08-21 15:06:10 +02:00 committed by Michael Niedermayer
parent 84506ebd48
commit ba571f6b4d

View File

@ -2694,27 +2694,21 @@ static void event_loop(VideoState *cur_stream)
break;
case SDLK_p:
case SDLK_SPACE:
if (cur_stream)
toggle_pause(cur_stream);
break;
case SDLK_s: //S: Step to next frame
if (cur_stream)
step_to_next_frame(cur_stream);
break;
case SDLK_a:
if (cur_stream)
stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
break;
case SDLK_v:
if (cur_stream)
stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
break;
case SDLK_t:
if (cur_stream)
stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
break;
case SDLK_w:
if (cur_stream)
toggle_audio_display(cur_stream);
break;
case SDLK_LEFT:
@ -2729,7 +2723,6 @@ static void event_loop(VideoState *cur_stream)
case SDLK_DOWN:
incr = -60.0;
do_seek:
if (cur_stream) {
if (seek_by_bytes) {
if (cur_stream->video_stream >= 0 && cur_stream->video_current_pos>=0){
pos= cur_stream->video_current_pos;
@ -2748,7 +2741,6 @@ static void event_loop(VideoState *cur_stream)
pos += incr;
stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
}
}
break;
default:
break;
@ -2767,7 +2759,6 @@ static void event_loop(VideoState *cur_stream)
break;
x= event.motion.x;
}
if (cur_stream) {
if(seek_by_bytes || cur_stream->ic->duration<=0){
uint64_t size= avio_size(cur_stream->ic->pb);
stream_seek(cur_stream, size*x/cur_stream->width, 0, 1);
@ -2791,15 +2782,12 @@ static void event_loop(VideoState *cur_stream)
ts += cur_stream->ic->start_time;
stream_seek(cur_stream, ts, 0, 0);
}
}
break;
case SDL_VIDEORESIZE:
if (cur_stream) {
screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
SDL_HWSURFACE|SDL_RESIZABLE|SDL_ASYNCBLIT|SDL_HWACCEL);
screen_width = cur_stream->width = event.resize.w;
screen_height= cur_stream->height= event.resize.h;
}
break;
case SDL_QUIT:
case FF_QUIT_EVENT: