diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 2abbc0ff29..c59ad81968 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -4062,6 +4062,9 @@ static int check_keyboard_interaction(int64_t cur_time) if(debug) av_log_set_level(AV_LOG_DEBUG); fprintf(stderr,"debug=%d\n", debug); } + if (key == 'p'){ + return 1; + } if (key == '?'){ fprintf(stderr, "key function\n" "? show this help\n" @@ -4073,6 +4076,7 @@ static int check_keyboard_interaction(int64_t cur_time) "h dump packets/hex press to cycle through the 3 states\n" "q quit\n" "s Show QP histogram\n" + "p pause / resume\n" ); } return 0; @@ -4767,9 +4771,19 @@ static int transcode(void) int64_t cur_time= av_gettime_relative(); /* if 'q' pressed, exits */ - if (stdin_interaction) - if (check_keyboard_interaction(cur_time) < 0) + if (stdin_interaction) { + int64_t kbinteractionresult = check_keyboard_interaction(cur_time); + if (kbinteractionresult < 0) break; + if(kbinteractionresult == 1) { //pause + fprintf(stderr, "Paused\r"); + + //wait for key + getchar(); + + fprintf(stderr, "Unpaused\n"); + } + } /* check if there's any stream where output is still needed */ if (!need_output()) { diff --git a/notes b/notes new file mode 100644 index 0000000000..49e635e551 --- /dev/null +++ b/notes @@ -0,0 +1,5 @@ +notes: + ffmpeg.c: + key scanning: 3905 + mainloop: 4656 + added: 4685