mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
frame stepping patch by (Wolfgang Hesseler <qv at multimediaware dot com>)
Originally committed as revision 2632 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
2c293402b0
commit
bba04f1e9d
18
ffplay.c
18
ffplay.c
@ -166,6 +166,7 @@ static int show_status;
|
|||||||
static int av_sync_type = AV_SYNC_AUDIO_MASTER;
|
static int av_sync_type = AV_SYNC_AUDIO_MASTER;
|
||||||
static int64_t start_time = AV_NOPTS_VALUE;
|
static int64_t start_time = AV_NOPTS_VALUE;
|
||||||
static int debug = 0;
|
static int debug = 0;
|
||||||
|
static int step = 0;
|
||||||
|
|
||||||
/* current context */
|
/* current context */
|
||||||
static int is_full_screen;
|
static int is_full_screen;
|
||||||
@ -919,6 +920,9 @@ static int video_thread(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
av_free_packet(pkt);
|
av_free_packet(pkt);
|
||||||
|
if (step)
|
||||||
|
if (cur_stream)
|
||||||
|
stream_pause(cur_stream);
|
||||||
}
|
}
|
||||||
the_end:
|
the_end:
|
||||||
av_free(frame);
|
av_free(frame);
|
||||||
@ -1584,6 +1588,17 @@ void toggle_pause(void)
|
|||||||
{
|
{
|
||||||
if (cur_stream)
|
if (cur_stream)
|
||||||
stream_pause(cur_stream);
|
stream_pause(cur_stream);
|
||||||
|
step = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void step_to_next_frame(void)
|
||||||
|
{
|
||||||
|
if (cur_stream) {
|
||||||
|
if (cur_stream->paused)
|
||||||
|
cur_stream->paused=0;
|
||||||
|
cur_stream->video_current_pts = get_video_clock(cur_stream);
|
||||||
|
}
|
||||||
|
step = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void do_exit(void)
|
void do_exit(void)
|
||||||
@ -1627,6 +1642,9 @@ void event_loop(void)
|
|||||||
case SDLK_SPACE:
|
case SDLK_SPACE:
|
||||||
toggle_pause();
|
toggle_pause();
|
||||||
break;
|
break;
|
||||||
|
case SDLK_s: //S: Step to next frame
|
||||||
|
step_to_next_frame();
|
||||||
|
break;
|
||||||
case SDLK_a:
|
case SDLK_a:
|
||||||
if (cur_stream)
|
if (cur_stream)
|
||||||
stream_cycle_channel(cur_stream, CODEC_TYPE_AUDIO);
|
stream_cycle_channel(cur_stream, CODEC_TYPE_AUDIO);
|
||||||
|
Loading…
Reference in New Issue
Block a user