pause unpause added
This commit is contained in:
parent
9383885c0d
commit
57891c3761
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue