From 47ea04ff1058cfd9cf780ad27eae5260a2a84353 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Mon, 26 Oct 2015 21:07:33 +0100 Subject: lavu/opt: enhance printing durations. Trim unneeded leading components and trailing zeros. Move the formating code in a separate function. Use the function also to format the default value, it was currently printed as plain integer, inconsistent to the way it is parsed. --- tests/ref/fate/opt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt index e9132a5a1b..7b47d429c5 100644 --- a/tests/ref/fate/opt +++ b/tests/ref/fate/opt @@ -31,7 +31,7 @@ TestContext AVOptions: -pix_fmt E....... set pixfmt (default 0bgr) -sample_fmt E....... set samplefmt (default s16) -video_rate E....... set videorate (default "25") - -duration E....... set duration (default 1000) + -duration E....... set duration (default 0.001) -color E....... set color (default "pink") -cl E....... set channel layout (default 0x137) -bin E....... set binary value @@ -97,7 +97,7 @@ name: bool2 default:1 error: name: bool3 default:1 error: Test av_opt_serialize() -num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0:00:00.001000,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false +num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false Setting entry with key 'num' to value '0' Setting entry with key 'toggle' to value '1' Setting entry with key 'rational' to value '1/1' @@ -108,7 +108,7 @@ Setting entry with key 'size' to value '200x300' Setting entry with key 'pix_fmt' to value '0bgr' Setting entry with key 'sample_fmt' to value 's16' Setting entry with key 'video_rate' to value '25/1' -Setting entry with key 'duration' to value '0:00:00.001000' +Setting entry with key 'duration' to value '0.001' Setting entry with key 'color' to value '0xffc0cbff' Setting entry with key 'cl' to value '0x137' Setting entry with key 'bin' to value '62696E00' @@ -120,7 +120,7 @@ Setting entry with key 'dbl' to value '0.333333' Setting entry with key 'bool1' to value 'auto' Setting entry with key 'bool2' to value 'true' Setting entry with key 'bool3' to value 'false' -num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0:00:00.001000,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false +num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false Testing av_set_options_string() Setting options string '' -- cgit v1.2.3