summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-15 01:39:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-15 01:39:04 +0200
commit90bb2c78d6344537aa8c670334cffae2f2bb7259 (patch)
treeec263dc566e7fbebe312e4ca7d1d5d294d04fc91 /ffmpeg.c
parent34e838083e385a96640f07923b2b45798a12baa4 (diff)
ffmpeg: Allow seting and cycling through debug modes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 4277baff75..629d202257 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2603,11 +2603,33 @@ static int transcode(AVFormatContext **output_files,
do_pkt_dump = 1;
av_log_set_level(AV_LOG_DEBUG);
}
+ if (key == 'd' || key == 'D'){
+ int debug=0;
+ if(key == 'D') {
+ ist = ist_table[0];
+ debug = ist->st->codec->debug<<1;
+ if(!debug) debug = 1;
+ while(debug & (FF_DEBUG_DCT_COEFF|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) //unsupported, would just crash
+ debug += debug;
+ }else
+ scanf("%d", &debug);
+ for(i=0;i<nb_istreams;i++) {
+ ist = ist_table[i];
+ ist->st->codec->debug = debug;
+ }
+ for(i=0;i<nb_ostreams;i++) {
+ ost = ost_table[i];
+ ost->st->codec->debug = debug;
+ }
+ if(debug) av_log_set_level(AV_LOG_DEBUG);
+ fprintf(stderr,"debug=%d\n", debug);
+ }
if (key == '?'){
fprintf(stderr, "key function\n"
"? show this help\n"
"+ increase verbosity\n"
"- decrease verbosity\n"
+ "D cycle through available debug modes\n"
"h dump packets/hex press to cycle through the 3 states\n"
"q quit\n"
"s Show QP histogram\n"