pause unpause added

This commit is contained in:
MrBesen 2019-10-07 13:55:29 +02:00 committed by mrbesen
parent 9383885c0d
commit 57891c3761
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
2 changed files with 21 additions and 2 deletions

View File

@ -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()) {

5
notes Normal file
View File

@ -0,0 +1,5 @@
notes:
ffmpeg.c:
key scanning: 3905
mainloop: 4656
added: 4685