Branch Coverage

blib/lib/Linux/DVB/DVBT.pm
Criterion Covered Total %
branch 56 728 7.6


line true false branch
920 0 5 unless ($self->{'dvb'})
940 145 10 if exists $DEFAULTS{$_}
972 0 5 if (ref $self->{'dvb'})
1012 2 1 if (defined $level)
1052 0 0 if (defined $level)
1145 5 0 if (not $devices_href or keys %args)
1148 0 5 if (exists $args{'show'})
1156 0 0 if (-d $adap_d and $adap_d =~ /adapter(\d+)/)
1161 0 0 if ($fe_f =~ /frontend(\d+)/)
1168 0 0 if $DEBUG >= 10
1172 0 0 if $type ne 'DVB-T' and not $showall
1173 0 0 unless $type
1176 0 0 if (-l $fe_f)
1180 0 0 if ($target =~ m[/dev/dvb/adapter(\d+)/frontend(\d+)]) { }
1193 0 0 if $fe_f
1205 0 0 unless $devices_href->{$a}{'adapter_num'} <=> $devices_href->{$b}{'adapter_num'}
1211 0 5 if $DEBUG >= 10
1230 0 0 if ($error_str =~ /no error/i)
1272 31 124 if (exists $args{$field})
1314 0 6 if ($mode =~ /return/i) { }
6 0 elsif ($mode =~ /message/i) { }
0 0 elsif ($mode =~ /die/i) { }
1399 0 0 if $DEBUG >= 5
1412 0 0 if $DEBUG >= 5
1415 0 0 if ($self->dvb_closed)
1422 0 0 unless ($self->frontend_params)
1429 0 0 unless $self->_scan_freqs
1562 0 0 if $DEBUG >= 5
1563 0 0 if $DEBUG >= 5
1567 0 0 unless $self->_scan_freqs
1569 0 0 if $DEBUG >= 5
1577 0 0 if $DEBUG >= 5
1597 0 0 if ($VERBOSE >= 3)
1610 0 0 unless $ptsid eq $tsid
1615 0 0 $lcn ? :
1645 0 0 if $DEBUG >= 10
1648 0 0 unless (@$freqs_aref)
1651 0 0 if $DEBUG >= 10
1653 0 0 unless @$freqs_aref
1657 0 0 if (@$freqs_aref >= 2)
1662 0 0 if ($new_freq != $freq)
1667 0 0 if ($new_strength > $old_strength)
1669 0 0 if $VERBOSE
1682 0 0 if (exists $scan_href->{'lcn'}{$tsid} and exists $scan_href->{'lcn'}{$tsid}{$pnr})
1686 0 0 if ($scan_href->{'pr'}{$name}{'type'} == $SERVICE_TYPE{'hd-tv'})
1694 0 0 if (not defined $tsids{$tsid}{'frequency'} or $tsids{$tsid}{'frequency'} != $freq)
1706 0 0 if $DEBUG >= 10
1710 0 0 if $DEBUG >= 5
1711 0 0 if $DEBUG >= 5
1712 0 0 if $DEBUG >= 5
1720 0 0 unless ($chan =~ /\S+/)
1732 0 0 if $DEBUG >= 5
1737 0 0 if $DEBUG >= 5
1759 0 0 if (keys %{$$scan_href{'lcn'};})
1768 0 0 unless $chan
1769 0 0 unless exists $scan_href->{'pr'}{$chan}
1771 0 0 if ($DEBUG >= 5)
1773 0 0 defined $lcn_href->{'lcn'} ? :
1774 0 0 defined $lcn_href->{'visible'} ? :
1775 0 0 defined $lcn_href->{'service_type'} ? :
1782 0 0 if ($lcn_href and $lcn_href->{'lcn'})
1787 0 0 if $DEBUG >= 5
1789 0 0 unless ($lcn_href->{'visible'})
1797 0 0 unless $self->prune_channels
1800 0 0 if ($delete)
1803 0 0 if exists $scan_href->{'pr'}{$chan}
1805 0 0 if $DEBUG >= 5
1821 0 0 if ($scan_href->{'pr'}{$chan}{'type'} == $SERVICE_TYPE{'tv'} or $scan_href->{'pr'}{$chan}{'type'} == $SERVICE_TYPE{'hd-tv'})
1828 0 0 if ($scan_href->{'pr'}{$chan}{'type'} == $SERVICE_TYPE{'radio'})
1834 0 0 if $DEBUG >= 5
1836 0 0 if ($service_video or $service_audio) { }
1839 0 0 if $DEBUG >= 5
1842 0 0 if ($service_video) { }
1845 0 0 unless ($scan_href->{'pr'}{$chan}{'video'} and $scan_href->{'pr'}{$chan}{'audio'})
1854 0 0 unless ($scan_href->{'pr'}{$chan}{'audio'})
1870 0 0 unless $self->prune_channels
1872 0 0 if $delete
1877 0 0 if $DEBUG >= 5
1882 0 0 if $DEBUG >= 5
1900 0 0 if (exists $scan_href->{'freqs'}{$freq}) { }
0 0 elsif ($freq == $frontend_params_href->{'frequency'}) { }
1929 0 0 unless exists $FE_CAPABLE{$param}
1932 0 0 if ($$capabilities_href{$FE_CAPABLE{$param}})
1942 0 0 if $DEBUG >= 5
1943 0 0 if $DEBUG >= 5
1944 0 0 if $DEBUG >= 5
1948 0 0 if ($self->merge)
1950 0 0 if ($self->_scan_freqs) { }
1960 0 0 if $DEBUG >= 5
1969 0 0 unless $scan_href->{'freqs'}{$freq}{'tuned'}
1977 0 0 if $DEBUG >= 5
1983 0 0 if $DEBUG >= 5
1984 0 0 if $DEBUG >= 5
2014 0 0 unless $freq_file
2017 0 0 if ($self->dvb_closed)
2023 0 0 if $DEBUG
2031 0 0 if $DEBUG >= 2
2047 0 0 unless open my $fh, "<$freq_file"
2055 0 0 if ($line =~ /^\s*T\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i)
2059 0 0 if (exists $freqs_href->{$freq})
2088 0 0 if (exists $FE_PARAMS{$param}{$params{$param}})
2095 0 0 if $DEBUG >= 2
2104 0 0 unless @tuning_list
2134 0 0 unless Linux::DVB::DVBT::Freq::country_supported($iso3166)
2137 0 0 if ($self->dvb_closed)
2143 0 0 if $DEBUG
2151 0 0 if $DEBUG >= 2
2177 0 0 if (exists $freqs_href->{$freq})
2201 0 0 if $DEBUG >= 2
2209 0 0 unless @tuning_list
2238 0 0 if (not exists $tuning_href->{'freqfile'} and keys %{$$tuning_href{'freqfile'};})
2243 0 0 if $DEBUG >= 2
2247 0 0 if ($self->dvb_closed)
2253 0 0 if $DEBUG
2261 0 0 if $DEBUG >= 2
2280 0 0 if (exists $freqs_href->{$freq})
2296 0 0 if $DEBUG >= 2
2304 0 0 unless @tuning_list
2335 0 0 if ($self->scan_cb_start)
2358 0 0 if $DEBUG >= 2
2365 0 0 unless exists $freq_list{$freq_round}
2367 0 0 if $DEBUG >= 3
2370 0 0 if ($self->scan_cb_loop_start)
2376 0 0 if $freq_list{$f}
2379 0 0 if $callback_info{'estimated_percent'} > 97
2402 0 0 if ($frequency >= $MIN_FREQ)
2407 0 0 unless exists $FE_CAPABLE{$param}
2408 0 0 if $DEBUG >= 2
2411 0 0 unless ($$capabilities_href{$FE_CAPABLE{$param}})
2421 0 0 if $self->verbose
2426 0 0 if ($rc == 0) { }
2441 0 0 unless @tuning_list
2444 0 0 if $DEBUG >= 2
2448 0 0 unless $tuned
2452 0 0 if ($self->scan_cb_loop_start)
2458 0 0 if $freq_list{$f}
2461 0 0 if $callback_info{'estimated_percent'} > 98
2472 0 0 if $DEBUG >= 2
2484 0 0 if exists $tuning_href->{'freqs'}
2486 0 0 if $DEBUG >= 3
2491 0 0 if $freqs_href->{$freq}{'seen'}
2494 0 0 unless (exists $freq_list{$freq_round})
2500 0 0 if $DEBUG >= 2
2504 0 0 if $DEBUG >= 2
2507 0 0 if ($self->scan_cb_loop_end)
2513 0 0 if $freq_list{$f}
2516 0 0 if $callback_info{'estimated_percent'} > 99
2526 0 0 if $DEBUG >= 2
2531 0 0 if ($DEBUG)
2545 0 0 unless (exists $tsids{$tsid})
2560 0 0 if $DEBUG >= 2
2562 0 0 if ($VERBOSE)
2574 0 0 if ($line =~ /Set freq/i)
2578 0 0 if ($set and $this_set)
2583 0 0 if $this_set
2614 0 0 if ($self->scan_cb_end)
2694 0 0 if ($self->dvb_closed)
2703 0 0 if $DEBUG
2711 0 0 if ($rc == 0)
2737 0 0 if $DEBUG
2740 0 0 if ($video_pid and not $error)
2744 0 0 if ($audio_pid and not $error)
2748 0 0 if ($teletext_pid and not $error)
2752 0 0 if ($subtitle_pid and not $error)
2785 0 0 if ($self->dvb_closed)
2793 0 0 unless ($tuning_href)
2800 0 0 unless ($frontend_params_href)
2806 0 0 if ($self->set_frontend(%$frontend_params_href, 'timeout', $self->timeout))
2815 0 0 if ($self->set_demux($demux_params_href->{'video'}, $demux_params_href->{'audio'}, 0, 0, $frontend_params_href->{'tsid'}, $demux_params_href))
2852 5 0 unless ($tuning_href)
2856 0 5 if $DEBUG >= 20
2859 5 0 if $tuning_href
2894 0 0 unless ($channels_aref)
2903 0 0 if ($tuning_href)
2921 0 0 if (not $lcn_a && $lcn_b) { }
2925 0 0 unless $tuning_href->{'pr'}{$a}{'tsid'} <=> $tuning_href->{'pr'}{$b}{'tsid'}
2937 0 0 if $DEBUG >= 10
2938 0 0 if (exists $SERVICE_NAME{$type})
2984 0 0 if ($self->dvb_closed)
2991 0 0 unless ($self->frontend_params)
3032 0 0 if ($self->dvb_closed)
3040 0 0 unless ($tuning_href)
3047 0 0 if ($tsid) { }
3050 0 0 unless (exists $tuning_href->{'ts'}{$tsid})
3075 0 0 if ($error_code = $self->set_frontend(%$frontend_params_href, 'timeout', $self->timeout)) { }
3077 0 0 if $DEBUG
3080 0 0 if ($info{$tsid}{'error'} =~ /busy/i)
3136 0 0 if $DEBUG
3139 0 0 unless $file
3143 0 0 unless $seconds
3165 0 0 if $error
3172 0 0 if $DEBUG >= 10
3204 0 0 unless $file
3208 0 0 unless $seconds
3211 0 0 if ($self->dvb_closed)
3219 0 0 unless (-d $dir)
3222 0 0 unless mkpath([$dir], $DEBUG, 493)
3225 0 0 if $DEBUG
3229 0 0 if $rc
3359 0 0 if ($self->dvb_closed)
3370 0 0 if $DEBUG >= 2
3375 0 0 if ($channels_aref and $tuning_href)
3386 0 0 if (exists $tuning_href->{'pr'}{$channel})
3397 0 0 if $DEBUG >= 2
3406 0 0 unless ($self->frontend_params)
3409 0 0 if ($tuning_href)
3413 0 0 if ($DEBUG)
3423 0 0 if $DEBUG >= 2
3425 0 0 if $rc != 0
3438 0 0 unless ($self->frontend_params)
3449 0 0 if (@next_freq)
3452 0 0 if $DEBUG >= 2
3458 0 0 if $VERBOSE
3460 0 0 if $DEBUG >= 2
3478 0 0 if ($channel_lookup_href)
3485 0 0 if $DEBUG >= 2
3513 0 0 if $DEBUG >= 10
3514 0 0 if $DEBUG >= 10
3528 0 0 if ($epg_entry->{'start'} < $dates{$chan}{'start_min'})
3534 0 0 if ($epg_entry->{'stop'} > $dates{$chan}{'end_max'})
3606 0 0 $epg_flags & $EPG_FLAGS{'AUDIO_MONO'} ? :
0 0 $epg_flags & $EPG_FLAGS{'AUDIO_STEREO'} ? :
0 0 $epg_flags & $EPG_FLAGS{'AUDIO_DUAL'} ? :
0 0 $epg_flags & $EPG_FLAGS{'AUDIO_MULTI'} ? :
0 0 $epg_flags & $EPG_FLAGS{'AUDIO_SURROUND'} ? :
0 0 $epg_flags & $EPG_FLAGS{'AUDIO_HEAAC'} ? :
0 0 $epg_flags & $EPG_FLAGS{'VIDEO_4_3'} ? :
0 0 $epg_flags & $EPG_FLAGS{'VIDEO_16_9'} ? :
0 0 $epg_flags & $EPG_FLAGS{'VIDEO_HDTV'} ? :
0 0 $epg_flags & $EPG_FLAGS{'VIDEO_H264'} ? :
0 0 $epg_flags & $EPG_FLAGS{'SUBTITLES'} ? :
3616 0 0 unless ($epg{$chan}{$pid}{$field})
3623 0 0 if $DEBUG >= 2
3644 0 0 if $DEBUG
3694 0 0 if $DEBUG
3697 0 0 if ($pid < 0 or $pid > $MAX_PID)
3703 0 0 if ($self->dvb_closed)
3711 0 0 if $DEBUG >= 5
3714 0 0 if ($frontend_href)
3717 0 0 if $current_tsid ne $tsid
3721 0 0 unless ($frontend_href)
3723 0 0 if $DEBUG >= 5
3725 0 0 if ($tsid)
3727 0 0 if $DEBUG >= 5
3730 0 0 unless ($tuning_href)
3737 0 0 unless ($frontend_href)
3743 0 0 if ($self->set_frontend(%$frontend_href, 'timeout', $self->timeout))
3747 0 0 if $DEBUG >= 5
3752 0 0 unless ($frontend_href)
3761 0 0 if ($fd <= 0)
3767 0 0 if $DEBUG
3770 0 0 if (exists $frontend_href->{'tsid'}) { }
3836 0 0 unless ($self->dvb_closed)
4097 68 1 if ($arg =~ /(\S+)\s*=\s*([\'\"]{0,1})([^\2]*)\2/) { }
4104 67 434 if ($var =~ /$regexp/)
4113 1 67 unless ($valid)
4119 13 54 if ($var eq 'file') { }
4137 1 53 unless defined $current_file_href
4145 27 66 if ($var eq $genvar)
4152 27 26 if $handled
4155 14 12 if ($var eq 'pid')
4162 0 12 if ($var eq 'event_id')
4169 0 12 if ($var eq 'timeslip')
4172 0 0 if ($value =~ /both/i)
4176 0 0 if ($value =~ /start/i)
4184 0 12 if ($var eq 'max_timeslip')
4191 5 7 if ($var eq 'chan') { }
4202 1 6 unless defined $current_chan_href
4209 6 4 if ($var eq $chvar)
4217 0 6 if ($var eq 'sublang')
4234 1 7 unless ($spec_href->{'duration'})
4238 1 3 unless (@{$spec_href->{'pids'};} or @{$spec_href->{'chans'};})
4306 0 0 if $DEBUG >= 10
4310 0 0 unless ($tuning_href)
4316 0 0 if ($self->dvb_closed)
4340 0 0 if ($file)
4351 0 0 if ($files{$file}{'pids'})
4379 0 0 if ($href->{'event_id'} >= 0)
4382 0 0 if ($spec_href->{'timeslip'} =~ /start|both/)
4386 0 0 if ($spec_href->{'timeslip'} =~ /end|both/)
4392 0 0 unless ($href->{'timeslip_start'} or $href->{'timeslip_end'})
4406 0 0 if $self->{'_multiplex_info'}{'duration'} < $period
4421 0 0 unless ($frontend_params_href)
4428 0 0 if ($tsid ne $frontend_params_href->{'tsid'})
4437 0 0 if $error
4451 0 0 if $error
4453 0 0 if ($need_eit)
4466 0 0 if $DEBUG >= 15
4473 0 0 if $error
4479 0 0 if $pid_href->{'pidtype'} eq 'video'
4480 0 0 if $pid_href->{'pidtype'} eq 'audio'
4481 0 0 if $pid_href->{'pidtype'} eq 'subtitle'
4491 0 0 if ($need_eit)
4503 0 0 unless (@pid_info)
4507 0 0 if $new_pid_href
4509 0 0 if (not @pid_info) { }
0 0 elsif (@pid_info > 1) { }
4512 0 0 if ($options{'no-pid-check'}) { }
4528 0 0 if (not $tsid) { }
4537 0 0 if ($_->{'tsid'} eq $tsid)
4546 0 0 unless ($pid_href)
4558 0 0 if ($pid_href)
4560 0 0 if $DEBUG >= 15
4564 0 0 if (not defined $tsid && defined $pid_href->{'tsid'} or $tsid ne $pid_href->{'tsid'})
4571 0 0 if $error
4577 0 0 if $pid_href->{'pidtype'} eq 'video'
4578 0 0 if $pid_href->{'pidtype'} eq 'audio'
4579 0 0 if $pid_href->{'pidtype'} eq 'subtitle'
4592 0 0 unless ($demux_count)
4700 0 0 if $DEBUG >= 10
4728 0 0 if (exists $demux_href->{'demux_params'} and $demux_href->{'demux_params'})
4747 0 0 if $DEBUG >= 10
4748 0 0 if (lc $suffix ne '.ts')
4756 0 0 if $DEBUG >= 10
4773 0 0 unless (-d $destdir)
4775 0 0 unless mkpath([$destdir], $DEBUG, 493)
4780 0 0 unless open my $fh, ">$destfile"
4784 0 0 if $DEBUG >= 10
4801 0 0 if (exists $multiplex_info{'options'})
4806 0 0 if $error
4808 0 0 if $DEBUG
4840 0 0 if $DEBUG
4859 0 0 if (exists $href->{$field}{$pid})
4907 0 0 if $DEBUG >= 10
4918 0 0 if $DEBUG >= 10
4930 0 0 if ($error)
4938 0 0 if (@errors)
4980 0 10 if (_load_module('Debug::DumpObj')) { }
4988 10 0 if (_load_module('Data::Dumper')) { }
5010 10 10 if (eval "require $mod") { }
5063 0 0 if (defined $self->adapter)
5066 0 0 if defined $adap
5067 0 0 if defined $fe
5072 0 0 unless (defined $self->adapter_num)
5075 0 0 if (scalar @$info_aref) { }
5090 0 0 unless (defined $self->frontend_num)
5093 0 0 if (scalar @$info_aref) { }
5099 0 0 if ($device_href->{'adapter_num'} == $adapter)
5115 0 0 unless (defined $self->_device_index)
5122 0 0 if ($device_href->{'adapter_num'} == $adapter and $device_href->{'frontend_num'} == $fe)
5129 0 0 unless (defined $self->_device_index)
5231 0 0 if $DEBUG >= 10
5232 0 0 if $DEBUG >= 15
5250 0 0 if $demux_href->{'demux_params'}
5253 0 0 if ($demux_href->{'pidtype'} ne 'audio' and $demux_href->{'pidtype'} ne 'video')
5261 0 0 if $DEBUG >= 10
5262 0 0 if $DEBUG >= 10
5263 0 0 if $DEBUG >= 10
5266 0 0 if ($add_si)
5268 0 0 if (not $pmt) { }
5283 0 0 if $DEBUG >= 10
5286 0 0 unless defined $pid_href->{'pid'}
5287 0 0 if exists $pids{$pid_href->{'pid'}}
5289 0 0 if $DEBUG >= 10
5290 0 0 unless defined $pid_href->{'pid'}
5292 0 0 if $DEBUG >= 10
5296 0 0 if $error
5305 0 0 if $DEBUG >= 15
5344 0 0 if (exists $SI_LOOKUP{$pid})
5355 0 0 if (not $pid_href and $pmt)
5389 43 23 if defined $new_value
5392 0 66 if ($name =~ /^undef_(\w+)$/)
5400 0 66 unless (exists $FIELDS{$name})
5408 43 23 if ($set)