Skip to content

Commit

Permalink
ffprobe: add missing separator when printing side data in compact output
Browse files Browse the repository at this point in the history
Should fix ticket #7153

Signed-off-by: James Almer <[email protected]>
  • Loading branch information
jamrial committed Dec 22, 2021
1 parent 18ad360 commit 131dbb9
Show file tree
Hide file tree
Showing 16 changed files with 783 additions and 817 deletions.
4 changes: 3 additions & 1 deletion fftools/ffprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,10 @@ static void compact_print_section_header(WriterContext *wctx)
if (parent_section && compact->has_nested_elems[wctx->level-1] &&
(section->flags & SECTION_FLAG_IS_ARRAY)) {
compact->terminate_line[wctx->level-1] = 0;
printf("\n");
}
if (parent_section && !(parent_section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)) &&
wctx->level && wctx->nb_item[wctx->level-1])
printf("%c", compact->item_sep);
if (compact->print_section &&
!(section->flags & (SECTION_FLAG_IS_WRAPPER|SECTION_FLAG_IS_ARRAY)))
printf("%s%c", section->name, compact->item_sep);
Expand Down
66 changes: 22 additions & 44 deletions tests/ref/fate/concat-demuxer-simple1-lavf-mxf
Original file line number Diff line number Diff line change
Expand Up @@ -78,48 +78,26 @@ video|0|27|1.080000|27|1.080000|1|0.040000|10840|491008|__
audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|502272|K_
video|0|28|1.120000|28|1.120000|1|0.040000|13350|506880|__
audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|520704|K_
video|0|25|1.000000|24|0.960000|1|0.040000|24801|7168|K_|1
Strings Metadata
audio|1|48000|1.000000|48000|1.000000|1920|0.040000|3840|32256|K_|1
Strings Metadata
video|0|28|1.120000|25|1.000000|1|0.040000|16743|36864|__|1
Strings Metadata
audio|1|49920|1.040000|49920|1.040000|1920|0.040000|3840|53760|K_|1
Strings Metadata
video|0|26|1.040000|26|1.040000|1|0.040000|13812|58368|__|1
Strings Metadata
audio|1|51840|1.080000|51840|1.080000|1920|0.040000|3840|72704|K_|1
Strings Metadata
video|0|27|1.080000|27|1.080000|1|0.040000|13607|77312|__|1
Strings Metadata
audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|91136|K_|1
Strings Metadata
video|0|31|1.240000|28|1.120000|1|0.040000|16158|95744|__|1
Strings Metadata
audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|112128|K_|1
Strings Metadata
video|0|29|1.160000|29|1.160000|1|0.040000|13943|116736|__|1
Strings Metadata
audio|1|57600|1.200000|57600|1.200000|1920|0.040000|3840|131072|K_|1
Strings Metadata
video|0|30|1.200000|30|1.200000|1|0.040000|11223|135680|__|1
Strings Metadata
audio|1|59520|1.240000|59520|1.240000|1920|0.040000|3840|146944|K_|1
Strings Metadata
video|0|34|1.360000|31|1.240000|1|0.040000|20298|151552|__|1
Strings Metadata
audio|1|61440|1.280000|61440|1.280000|1920|0.040000|3840|172032|K_|1
Strings Metadata
video|0|32|1.280000|32|1.280000|1|0.040000|13341|176640|__|1
Strings Metadata
audio|1|63360|1.320000|63360|1.320000|1920|0.040000|3840|190464|K_|1
Strings Metadata
video|0|33|1.320000|33|1.320000|1|0.040000|12362|195072|__|1
Strings Metadata
audio|1|65280|1.360000|65280|1.360000|1920|0.040000|3840|207872|K_|1
Strings Metadata
video|0|37|1.480000|34|1.360000|1|0.040000|24786|212480|K_|1
Strings Metadata
0|mpeg2video|4|video|[0][0][0][0]|0x0000|352|288|0|0|0|0|1|1:1|11:9|yuv420p|8|tv|unknown|unknown|unknown|left|progressive|1|N/A|25/1|25/1|1/25|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|51|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001
CPB properties|0|0|0|49152|-1
video|0|25|1.000000|24|0.960000|1|0.040000|24801|7168|K_|1|Strings Metadata
audio|1|48000|1.000000|48000|1.000000|1920|0.040000|3840|32256|K_|1|Strings Metadata
video|0|28|1.120000|25|1.000000|1|0.040000|16743|36864|__|1|Strings Metadata
audio|1|49920|1.040000|49920|1.040000|1920|0.040000|3840|53760|K_|1|Strings Metadata
video|0|26|1.040000|26|1.040000|1|0.040000|13812|58368|__|1|Strings Metadata
audio|1|51840|1.080000|51840|1.080000|1920|0.040000|3840|72704|K_|1|Strings Metadata
video|0|27|1.080000|27|1.080000|1|0.040000|13607|77312|__|1|Strings Metadata
audio|1|53760|1.120000|53760|1.120000|1920|0.040000|3840|91136|K_|1|Strings Metadata
video|0|31|1.240000|28|1.120000|1|0.040000|16158|95744|__|1|Strings Metadata
audio|1|55680|1.160000|55680|1.160000|1920|0.040000|3840|112128|K_|1|Strings Metadata
video|0|29|1.160000|29|1.160000|1|0.040000|13943|116736|__|1|Strings Metadata
audio|1|57600|1.200000|57600|1.200000|1920|0.040000|3840|131072|K_|1|Strings Metadata
video|0|30|1.200000|30|1.200000|1|0.040000|11223|135680|__|1|Strings Metadata
audio|1|59520|1.240000|59520|1.240000|1920|0.040000|3840|146944|K_|1|Strings Metadata
video|0|34|1.360000|31|1.240000|1|0.040000|20298|151552|__|1|Strings Metadata
audio|1|61440|1.280000|61440|1.280000|1920|0.040000|3840|172032|K_|1|Strings Metadata
video|0|32|1.280000|32|1.280000|1|0.040000|13341|176640|__|1|Strings Metadata
audio|1|63360|1.320000|63360|1.320000|1920|0.040000|3840|190464|K_|1|Strings Metadata
video|0|33|1.320000|33|1.320000|1|0.040000|12362|195072|__|1|Strings Metadata
audio|1|65280|1.360000|65280|1.360000|1920|0.040000|3840|207872|K_|1|Strings Metadata
video|0|37|1.480000|34|1.360000|1|0.040000|24786|212480|K_|1|Strings Metadata
0|mpeg2video|4|video|[0][0][0][0]|0x0000|352|288|0|0|0|0|1|1:1|11:9|yuv420p|8|tv|unknown|unknown|unknown|left|progressive|1|N/A|25/1|25/1|1/25|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|51|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001|CPB properties|0|0|0|49152|-1
1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|1|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|768000|N/A|N/A|N/A|N/A|50|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001
33 changes: 11 additions & 22 deletions tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,15 @@ video|0|28|1.120000|28|1.120000|1|0.040000|150000|4905984|K_
audio|1|53760|1.120000|53760|1.120000|1920|0.040000|7680|5056512|K_
video|0|29|1.160000|29|1.160000|1|0.040000|150000|5118976|K_
audio|1|55680|1.160000|55680|1.160000|1920|0.040000|7680|5269504|K_
video|0|30|1.200000|30|1.200000|1|0.040000|150000|1072128|K_|1
Strings Metadata
audio|1|57600|1.200000|57600|1.200000|1920|0.040000|7680|1222656|K_|1
Strings Metadata
video|0|31|1.240000|31|1.240000|1|0.040000|150000|1285120|K_|1
Strings Metadata
audio|1|59520|1.240000|59520|1.240000|1920|0.040000|7680|1435648|K_|1
Strings Metadata
video|0|32|1.280000|32|1.280000|1|0.040000|150000|1498112|K_|1
Strings Metadata
audio|1|61440|1.280000|61440|1.280000|1920|0.040000|7680|1648640|K_|1
Strings Metadata
video|0|33|1.320000|33|1.320000|1|0.040000|150000|1711104|K_|1
Strings Metadata
audio|1|63360|1.320000|63360|1.320000|1920|0.040000|7680|1861632|K_|1
Strings Metadata
video|0|34|1.360000|34|1.360000|1|0.040000|150000|1924096|K_|1
Strings Metadata
audio|1|65280|1.360000|65280|1.360000|1920|0.040000|7680|2074624|K_|1
Strings Metadata
0|mpeg2video|0|video|[0][0][0][0]|0x0000|720|608|0|0|0|0|0|1:1|45:38|yuv422p|5|tv|unknown|unknown|unknown|topleft|tb|1|N/A|25/1|25/1|1/25|0|0.000000|N/A|N/A|30000000|N/A|N/A|N/A|N/A|35|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001
CPB properties|30000000|0|0|1212416|-1
video|0|30|1.200000|30|1.200000|1|0.040000|150000|1072128|K_|1|Strings Metadata
audio|1|57600|1.200000|57600|1.200000|1920|0.040000|7680|1222656|K_|1|Strings Metadata
video|0|31|1.240000|31|1.240000|1|0.040000|150000|1285120|K_|1|Strings Metadata
audio|1|59520|1.240000|59520|1.240000|1920|0.040000|7680|1435648|K_|1|Strings Metadata
video|0|32|1.280000|32|1.280000|1|0.040000|150000|1498112|K_|1|Strings Metadata
audio|1|61440|1.280000|61440|1.280000|1920|0.040000|7680|1648640|K_|1|Strings Metadata
video|0|33|1.320000|33|1.320000|1|0.040000|150000|1711104|K_|1|Strings Metadata
audio|1|63360|1.320000|63360|1.320000|1920|0.040000|7680|1861632|K_|1|Strings Metadata
video|0|34|1.360000|34|1.360000|1|0.040000|150000|1924096|K_|1|Strings Metadata
audio|1|65280|1.360000|65280|1.360000|1920|0.040000|7680|2074624|K_|1|Strings Metadata
0|mpeg2video|0|video|[0][0][0][0]|0x0000|720|608|0|0|0|0|0|1:1|45:38|yuv422p|5|tv|unknown|unknown|unknown|topleft|tb|1|N/A|25/1|25/1|1/25|0|0.000000|N/A|N/A|30000000|N/A|N/A|N/A|N/A|35|22|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001|CPB properties|30000000|0|0|1212416|-1
1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|2|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|1536000|N/A|N/A|N/A|N/A|35|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001
Loading

0 comments on commit 131dbb9

Please sign in to comment.