Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37766056
en ru br
ALT Linux repos
S:3.4-alt3

Group :: Video
RPM: dvblast

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: dvblast-3.4-alt3.patch
Download


 .gear/rules                                        |   2 +
 .../tags/4c47520fb37c03b1c75da1a2c34e3766f44ec3df  |   6 ++
 .gear/tags/list                                    |   1 +
 .gitlab-ci.yml                                     |  35 ++++++
 NEWS                                               |   6 ++
 config.h                                           |   3 +-
 demux.c                                            |  78 +++++++++++---
 dvblast.c                                          |  18 ++--
 dvblast.h                                          |   3 +-
 dvblast.spec                                       | 119 +++++++++++++++++++++
 dvblastctl.c                                       |  13 ++-
 en50221.c                                          |   5 +
 udp.c                                              |   7 +-
 util.c                                             |   2 +-
 14 files changed, 264 insertions(+), 34 deletions(-)
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..4fcfd99
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,2 @@
+tar: @version@:.
+diff: @version@:. .
diff --git a/.gear/tags/4c47520fb37c03b1c75da1a2c34e3766f44ec3df b/.gear/tags/4c47520fb37c03b1c75da1a2c34e3766f44ec3df
new file mode 100644
index 0000000..876ae81
--- /dev/null
+++ b/.gear/tags/4c47520fb37c03b1c75da1a2c34e3766f44ec3df
@@ -0,0 +1,6 @@
+object 82c3fb4e343516605730bb137b20ee3ea6bf63de
+type commit
+tag 3.4
+tagger Christophe Massiot <cmassiot@openheadend.tv> 1537711574 +0200
+
+3.4 release
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..5570653
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+4c47520fb37c03b1c75da1a2c34e3766f44ec3df 3.4
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6b26c51
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,35 @@
+stages:
+    - build
+
+variables:
+    LIBEV_VERSION: "4.33"
+    LIBEV_SHA256SUM: "507eb7b8d1015fbec5b935f34ebed15bf346bed04a11ab82b8eee848c4205aea"
+
+.build-template:
+    stage: build
+    script: |
+        curl -O http://dist.schmorp.de/libev/Attic/libev-${LIBEV_VERSION}.tar.gz
+        echo "$LIBEV_SHA256SUM  libev-${LIBEV_VERSION}.tar.gz" | shasum -a 256 -c -
+        tar xf libev-${LIBEV_VERSION}.tar.gz
+        cd libev-${LIBEV_VERSION}
+        ./configure --prefix=`pwd`/../deps/
+        make -j $(getconf _NPROCESSORS_ONLN)
+        make install
+        cd ..
+        git clone https://code.videolan.org/videolan/bitstream
+        CFLAGS="-Ideps/include -I./" LDFLAGS="-Ldeps/lib" make -j $(getconf _NPROCESSORS_ONLN)
+
+build-debian:
+    image: registry.videolan.org/vlc-debian-unstable:20200529132440
+    tags:
+        - debian
+        - amd64
+    extends:
+        - .build-template
+
+build-macos:
+    tags:
+        - amd64
+        - catalina
+    extends:
+        - .build-template
diff --git a/NEWS b/NEWS
index 833d09f..481cb14 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Changes between 3.4 and 3.5:
+----------------------------
+  * Print bitrate status for each service
+  * Fix passing through the EITp/f without EPG tables (broken in 3.3)
+  * Add new option --udp-lock-timeout
+
 Changes between 3.3 and 3.4:
 ----------------------------
   * Fix segfault with dvblastctl when getting large tables
diff --git a/config.h b/config.h
index 249cbf5..968cb25 100644
--- a/config.h
+++ b/config.h
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * config.h
  *****************************************************************************
- * Copyright (C) 2004, 2008-2011 VideoLAN
+ * Copyright (C) 2004, 2008-2011, 2020 VideoLAN
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Andy Gatward <a.j.gatward@reading.ac.uk>
@@ -50,6 +50,7 @@
 #define MAX_EIT_RETENTION 500000 /* 500 ms */
 #define DEFAULT_FRONTEND_TIMEOUT 30000000 /* 30 s */
 #define EXIT_STATUS_FRONTEND_TIMEOUT 100
+#define DEFAULT_UDP_LOCK_TIMEOUT 5000000 /* 5 s */
 
 // Compatability defines
 #if defined(__APPLE__)
diff --git a/demux.c b/demux.c
index 01452af..57bde1b 100644
--- a/demux.c
+++ b/demux.c
@@ -80,6 +80,9 @@ typedef struct ts_pid_t
 
     int i_pes_status; /* pes + unscrambled */
     struct ev_timer timeout_watcher;
+
+    /* last service selecting this pid, only used for statistics */
+    uint16_t i_sid;
 } ts_pid_t;
 
 struct eit_sections {
@@ -95,6 +98,7 @@ typedef struct sid_t
     uint16_t i_sid, i_pmt_pid;
     uint8_t *p_current_pmt;
     struct eit_sections eit_table[MAX_EIT_TABLES];
+    unsigned long i_packets_passed;
 } sid_t;
 
 mtime_t i_wallclock = 0;
@@ -269,12 +273,13 @@ static inline sid_t *FindSID( uint16_t i_sid )
  *****************************************************************************/
 static void PrintCb( struct ev_loop *loop, struct ev_timer *w, int revents )
 {
+    int i;
     uint64_t i_bitrate = i_nb_packets * TS_SIZE * 8 * 1000000 / i_print_period;
     switch (i_print_type)
     {
         case PRINT_XML:
             fprintf(print_fh,
-                    "<STATUS type=\"bitrate\" status=\"%d\" value=\"%"PRIu64"\" />\n",
+                    "<STATUS type=\"bitrate\" status=\"%d\" value=\"%"PRIu64"\">",
                     i_bitrate ? 1 : 0, i_bitrate);
             break;
         case PRINT_TEXT:
@@ -285,6 +290,36 @@ static void PrintCb( struct ev_loop *loop, struct ev_timer *w, int revents )
     }
     i_nb_packets = 0;
 
+    for ( i = 0; i < i_nb_sids; i++ )
+    {
+        sid_t *p_sid = pp_sids[i];
+        uint64_t i_bitrate = p_sid->i_packets_passed * TS_SIZE * 8 * 1000000 / i_print_period;
+        switch (i_print_type)
+        {
+            case PRINT_XML:
+                fprintf(print_fh,
+                        "<PROGRAM number=\"%u\" bitrate=\"%"PRIu64"\"/>",
+                        p_sid->i_sid, i_bitrate);
+                break;
+            case PRINT_TEXT:
+                fprintf(print_fh, " - program number %u bitrate: %"PRIu64"\n",
+                        p_sid->i_sid, i_bitrate);
+                break;
+            default:
+                break;
+        }
+        p_sid->i_packets_passed = 0;
+    }
+
+    switch (i_print_type)
+    {
+        case PRINT_XML:
+            fprintf(print_fh, "</STATUS>\n");
+            break;
+        default:
+            break;
+    }
+
     if ( i_nb_invalids )
     {
         switch (i_print_type)
@@ -544,6 +579,13 @@ static void demux_Handle( block_t *p_ts )
     if ( p_pid->info.i_first_packet_ts == 0 )
         p_pid->info.i_first_packet_ts = i_wallclock;
 
+    if ( i_print_period && p_pid->i_sid > 0 )
+    {
+        sid_t *p_sid = FindSID( p_pid->i_sid );
+        if ( p_sid != NULL )
+            p_sid->i_packets_passed++;
+    }
+
     if ( i_pid != PADDING_PID && p_pid->i_last_cc != -1
           && !ts_check_duplicate( i_cc, p_pid->i_last_cc )
           && ts_check_discontinuity( i_cc, p_pid->i_last_cc ) )
@@ -1079,6 +1121,8 @@ static void SelectPID( uint16_t i_sid, uint16_t i_pid, bool b_pcr )
 {
     int i;
 
+    p_pids[i_pid].i_sid = i_sid;
+
     for ( i = 0; i < i_nb_outputs; i++ )
     {
         if ( (pp_outputs[i]->config.i_config & OUTPUT_VALID)
@@ -1102,6 +1146,8 @@ static void UnselectPID( uint16_t i_sid, uint16_t i_pid )
 {
     int i;
 
+    p_pids[i_pid].i_sid = 0;
+
     for ( i = 0; i < i_nb_outputs; i++ )
         if ( (pp_outputs[i]->config.i_config & OUTPUT_VALID)
               && pp_outputs[i]->config.i_sid == i_sid
@@ -1118,6 +1164,7 @@ static void SelectPMT( uint16_t i_sid, uint16_t i_pid )
 
     p_pids[i_pid].i_psi_refcount++;
     p_pids[i_pid].b_pes = false;
+    p_pids[i_pid].i_sid = i_sid;
 
     if ( b_select_pmts )
         SetPID( i_pid );
@@ -1131,6 +1178,8 @@ static void UnselectPMT( uint16_t i_sid, uint16_t i_pid )
 {
     int i;
 
+    p_pids[i_pid].i_sid = 0;
+
     p_pids[i_pid].i_psi_refcount--;
     if ( !p_pids[i_pid].i_psi_refcount )
         psi_assemble_reset( &p_pids[i_pid].p_psi_buffer,
@@ -1427,17 +1476,22 @@ static void SendSDT( mtime_t i_dts )
 /*****************************************************************************
  * SendEIT
  *****************************************************************************/
-static bool handle_epg( int i_table_id )
+static bool IsEITpf( int i_table_id )
+{
+    return i_table_id == EIT_TABLE_ID_PF_ACTUAL;
+}
+
+static bool IsEPG( int i_table_id )
 {
-    return (i_table_id == EIT_TABLE_ID_PF_ACTUAL ||
-       (i_table_id >= EIT_TABLE_ID_SCHED_ACTUAL_FIRST &&
-        i_table_id <= EIT_TABLE_ID_SCHED_ACTUAL_LAST));
+    /* We only handle EPG for the current (actual) TS, not others. */
+    return i_table_id >= EIT_TABLE_ID_SCHED_ACTUAL_FIRST &&
+           i_table_id <= EIT_TABLE_ID_SCHED_ACTUAL_LAST;
 }
 
 static void SendEIT( sid_t *p_sid, mtime_t i_dts, uint8_t *p_eit )
 {
     uint8_t i_table_id = psi_get_tableid( p_eit );
-    bool b_epg = handle_epg( i_table_id );
+    bool b_epg = IsEPG( i_table_id );
     uint16_t i_onid = eit_get_onid(p_eit);
     int i;
 
@@ -2242,7 +2296,7 @@ char *demux_Iconv(void *_unused, const char *psz_encoding,
     /* converted strings can be up to six times larger */
     i_out_length = i_length * 6;
     p = psz_string = malloc(i_out_length);
-    if (iconv(iconv_handle, &p_string, &i_length, &p, &i_out_length) == -1) {
+    if (iconv(iconv_handle, &p_string, &i_length, &p, &i_out_length) == (size_t)-1) {
         msg_Warn(NULL, "couldn't convert from %s to %s (%m)", psz_encoding,
                 psz_native_charset);
         free(psz_string);
@@ -3035,17 +3089,13 @@ static void HandleEIT( uint16_t i_pid, uint8_t *p_eit, mtime_t i_dts )
         return;
     }
 
-    bool b_epg = handle_epg( i_table_id );
-    if ( ! b_epg )
-        goto out_eit;
-
     /* We do not use psi_table_* primitives as the spec allows for holes in
      * section numbering, and there is no sure way to know whether you have
      * gathered all sections. */
     uint8_t i_section = psi_get_section(p_eit);
     uint8_t eit_table_id = i_table_id - EIT_TABLE_ID_PF_ACTUAL;
     if (eit_table_id >= MAX_EIT_TABLES)
-        goto out_eit;
+        goto out_eit; /* can't happen */
     if (p_sid->eit_table[eit_table_id].data[i_section] != NULL &&
         psi_compare(p_sid->eit_table[eit_table_id].data[i_section], p_eit)) {
         /* Identical section. Shortcut. */
@@ -3067,8 +3117,6 @@ static void HandleEIT( uint16_t i_pid, uint8_t *p_eit, mtime_t i_dts )
 
 out_eit:
     SendEIT( p_sid, i_dts, p_eit );
-    if ( ! b_epg )
-        free( p_eit );
 }
 
 /*****************************************************************************
@@ -3126,7 +3174,7 @@ static void HandleSection( uint16_t i_pid, uint8_t *p_section, mtime_t i_dts )
         break;
 
     default:
-        if ( handle_epg( i_table_id ) )
+        if ( IsEITpf( i_table_id ) || IsEPG( i_table_id ) )
         {
             HandleEIT( i_pid, p_section, i_dts );
             break;
diff --git a/dvblast.c b/dvblast.c
index a1ce8bd..4b47890 100644
--- a/dvblast.c
+++ b/dvblast.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * dvblast.c
  *****************************************************************************
- * Copyright (C) 2004, 2008-2011, 2015 VideoLAN
+ * Copyright (C) 2004, 2008-2011, 2015, 2020 VideoLAN
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Andy Gatward <a.j.gatward@reading.ac.uk>
@@ -103,6 +103,7 @@ bool b_print_enabled = false;
 FILE *print_fh;
 mtime_t i_print_period = 0;
 mtime_t i_es_timeout = 0;
+mtime_t i_udp_lock_timeout = DEFAULT_UDP_LOCK_TIMEOUT;
 
 int i_verbose = DEFAULT_VERBOSITY;
 int i_syslog = 0;
@@ -241,7 +242,7 @@ static uint8_t *config_striconv( const char *psz_string,
     size_t i_available = i_output;
     char *p_output = malloc( i_output );
     char *p = p_output;
-    if ( iconv( conf_iconv, &psz_tmp, &i_input, &p, &i_available ) == -1 )
+    if ( iconv( conf_iconv, &psz_tmp, &i_input, &p, &i_available ) == (size_t)-1 )
     {
         free( p_output );
 
@@ -634,7 +635,7 @@ void usage()
         "[-W] [-Y] [-l] [-g <logger ident>] [-Z <mrtg file>] [-V] [-h] [-B <provider_name>] "
         "[-1 <mis_id>] [-2 <size>] [-5 <DVBS|DVBS2|DVBC_ANNEX_A|DVBC_ANNEX_B|DVBT|DVBT2|ATSC|ISDBT>] -y <ca_dev_number> "
         "[-J <DVB charset>] [-Q <quit timeout>] [-0 pid_mapping] [-x <text|xml>]"
-        "[-6 <print period>] [-7 <ES timeout>]" );
+        "[-6 <print period>] [-7 <ES timeout>] [-4 <UDP lock timeout>]" );
 
     msg_Raw( NULL, "Input:" );
 #ifdef HAVE_ASI_SUPPORT
@@ -716,6 +717,7 @@ void usage()
     msg_Raw( NULL, "  -Q --quit-timeout     when locked, quit after this delay (in ms), or after the first lock timeout" );
     msg_Raw( NULL, "  -6 --print-period     periodicity at which we print bitrate and errors (in ms)" );
     msg_Raw( NULL, "  -7 --es-timeout       time of inactivy before which a PID is reported down (in ms)" );
+    msg_Raw( NULL, "  -4 --udp lock-timeout time of inactivy before which a UDP stream is reported down (in ms)" );
     msg_Raw( NULL, "  -r --remote-socket <remote socket>" );
     msg_Raw( NULL, "  -Z --mrtg-file <file> Log input packets and errors into mrtg-file" );
     msg_Raw( NULL, "  -V --version          only display the version" );
@@ -740,8 +742,7 @@ int main( int i_argc, char **pp_argv )
         usage();
 
     /*
-     * The only short options left are: 4
-     * Use them wisely.
+     * No short options are left.
      */
     static const struct option long_options[] =
     {
@@ -802,6 +803,7 @@ int main( int i_argc, char **pp_argv )
         { "quit-timeout",    required_argument, NULL, 'Q' },
         { "print-period",    required_argument, NULL, '6' },
         { "es-timeout",      required_argument, NULL, '7' },
+        { "udp-lock-timeout", required_argument, NULL, '4' },
         { "quiet",           no_argument,       NULL, 'q' },
         { "help",            no_argument,       NULL, 'h' },
         { "version",         no_argument,       NULL, 'V' },
@@ -812,7 +814,7 @@ int main( int i_argc, char **pp_argv )
         { 0, 0, 0, 0 }
     };
 
-    while ( (c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:5:f:F:R:s:S:k:v:pb:I:m:P:K:G:H:X:O:uwUTL:E:d:3D:A:lg:zCWYeM:N:j:J:B:x:Q:6:7:hVZ:y:0:1:2:9:", long_options, NULL)) != -1 )
+    while ( (c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:5:f:F:R:s:S:k:v:pb:I:m:P:K:G:H:X:O:uwUTL:E:d:3D:A:lg:zCWYeM:N:j:J:B:x:Q:6:7:4:hVZ:y:0:1:2:9:", long_options, NULL)) != -1 )
     {
         switch ( c )
         {
@@ -1153,6 +1155,10 @@ int main( int i_argc, char **pp_argv )
             i_es_timeout = strtoll( optarg, NULL, 0 ) * 1000;
             break;
 
+        case '4':
+            i_udp_lock_timeout = strtoll( optarg, NULL, 0 ) * 1000;
+            break;
+
         case 'V':
             DisplayVersion();
             exit(0);
diff --git a/dvblast.h b/dvblast.h
index ba71c1f..b1d2201 100644
--- a/dvblast.h
+++ b/dvblast.h
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * dvblast.h
  *****************************************************************************
- * Copyright (C) 2004, 2008-2011, 2015-2016 VideoLAN
+ * Copyright (C) 2004, 2008-2011, 2015-2016, 2020 VideoLAN
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Andy Gatward <a.j.gatward@reading.ac.uk>
@@ -264,6 +264,7 @@ extern bool b_print_enabled;
 extern FILE *print_fh;
 extern mtime_t i_print_period;
 extern mtime_t i_es_timeout;
+extern mtime_t i_udp_lock_timeout;
 
 /* pid mapping */
 extern bool b_do_remap;
diff --git a/dvblast.spec b/dvblast.spec
new file mode 100644
index 0000000..c3dda9a
--- /dev/null
+++ b/dvblast.spec
@@ -0,0 +1,119 @@
+Name: dvblast
+Version: 3.4
+Release: alt3
+
+Summary: Video/Audio streaming application based on the linux-dvb API
+License: GPLv2+
+Group: Video
+Url: http://www.videolan.org/projects/dvblast.html
+Packager: Alexei Takaseev <taf@altlinux.ru>
+
+Source: %name-%version.tar
+Patch0: %name-%version-%release.patch
+
+BuildRequires: bitstream-headers libev-devel
+
+%description 
+DVBlast is a simple and powerful streaming application based on the
+linux-dvb API. It opens a DVB device, tunes it, places PID filters,
+configures a CAM module, and demultiplexes the packets to several RTP
+outputs.
+
+DVBlast is designed to be the core of a custom IRD or CID, based on
+a PC with Linux-supported DVB cards.
+
+DVBlast does not do any kind of processing on the elementary streams,
+such as transcoding, PID remapping or remultiplexing. It does not
+stream from plain files, only DVB devices. If you were looking for
+these features, switch to VLC.
+
+%prep
+%setup
+%patch0 -p1
+
+%build
+%make
+
+%install
+mkdir -p %buildroot%_bindir
+install -pm755 dvblast %buildroot%_bindir/dvblast
+install -pm755 dvblastctl %buildroot%_bindir/dvblastctl
+install -pm755 dvblast_mmi.sh %buildroot%_bindir/dvblast_mmi.sh
+install -pm0644 -D dvblast.1 %buildroot%_man1dir/dvblast.1
+
+%files
+%doc COPYING README INSTALL TODO AUTHORS NEWS
+%_bindir/*
+%_man1dir/dvblast.1*
+
+%changelog
+* Fri Aug 18 2023 Alexei Takaseev <taf@altlinux.org> 3.4-alt3
+- update to git:4e18d80c2474093925248b01c70c4ead35051e30
+
+* Fri Feb 01 2019 Alexei Takaseev <taf@altlinux.org> 3.4-alt2
+- en50221: fix (small) memory leak
+
+* Mon Sep 24 2018 Alexei Takaseev <taf@altlinux.org> 3.4-alt1
+- 3.4
+
+* Mon Jul 02 2018 Alexei Takaseev <taf@altlinux.org> 3.3-alt1
+- 3.3
+
+* Wed Oct 18 2017 Alexei Takaseev <taf@altlinux.org> 3.1-alt1
+- 3.1
+- update to git:77cfaa8434cb3f0a9abd5df2bd763efd7cb35f85
+    * Fix HEVC support
+    * Fix memory leak on loading the configuration
+    * Also remap ONID in EIT
+    * Fix segmentation fault when using output charset different from native
+    * Use default charset ISO 6937 for ASCII strings
+    * Add /charset= output option
+    * Fix EIT schedule signaling in SDT
+
+* Wed Oct 18 2017 Alexei Takaseev <taf@altlinux.org> 3.0-alt2.git11102016
+- update to git:12a1eb975f2f781ac666e8ba06566c93f369bfba
+
+* Tue Sep 20 2016 Alexei Takaseev <taf@altlinux.org> 3.0-alt1.git19092016
+- update to git:f4b1a8e15f0514d80f729c876c6a960639ecf9b9
+
+* Tue Oct 06 2015 Alexei Takaseev <taf@altlinux.org> 3.0-alt1
+- 3.0
+
+* Sat Jan 31 2015 Alexei Takaseev <taf@altlinux.org> 2.2-alt9
+- Rebuild with new bitstream
+
+* Thu Oct 30 2014 Alexei Takaseev <taf@altlinux.org> 2.2-alt8
+- udp: fix /ifaddr= argument parsing
+
+* Tue Oct 07 2014 Alexei Takaseev <taf@altlinux.org> 2.2-alt7
+- update to git:71736aae24aad273874f86fdf13a802532e6475d
+
+* Sun Jun 29 2014 Alexei Takaseev <taf@altlinux.org> 2.2-alt6
+- update to git:9a2ea9ffb2141e1b4f29a181d97a4efbcb8fbc61
+
+* Tue Oct 02 2012 Alexei Takaseev <taf@altlinux.org> 2.2-alt5
+- Fix build
+- Merge with upstream (git: 45d0fa69350915a099796e7eb6b6b0bd1041ecce)
+- Add missing patch to spec
+
+* Sat Aug 11 2012 Alexei Takaseev <taf@altlinux.org> 2.2-alt4
+- Add support for uncommitted diseqc switch. (git: 05381442b9956fb280d5f4770e710df44b55cf26)
+
+* Tue Jun 26 2012 Alexei Takaseev <taf@altlinux.org> 2.2-alt3
+- Rebuild with bitstream-headers-1.0-alt2
+
+* Sat Jun 16 2012 Alexei Takaseev <taf@altlinux.org> 2.2-alt2
+- demux: Fix ECM pid selection. (Georgi Chorbadzhiyski gf_AT_unixsol.org)
+
+* Sat May 19 2012 Alexei Takaseev <taf@altlinux.org> 2.2-alt1
+- 2.2 release.
+- build with bitstream
+
+* Mon Oct 31 2011 Sergey Bolshakov <sbolshakov@altlinux.ru> 1.2-alt2
+- rebuilt with recent dvbpsi
+
+* Mon Mar 01 2010 Konstantin Pavlov <thresh@altlinux.org> 1.2-alt1
+- 1.2 release.
+
+* Sun Aug 02 2009 Konstantin Pavlov <thresh@altlinux.ru> 1.0-alt1
+- Initial build for ALT Linux Sisyphus.
diff --git a/dvblastctl.c b/dvblastctl.c
index ccdca6d..20382bc 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -148,7 +148,7 @@ char *psi_iconv(void *_unused, const char *psz_encoding,
     /* converted strings can be up to six times larger */
     i_out_length = i_length * 6;
     p = psz_string = malloc(i_out_length);
-    if (iconv(iconv_handle, &p_string, &i_length, &p, &i_out_length) == -1) {
+    if (iconv(iconv_handle, &p_string, &i_length, &p, &i_out_length) == (size_t)-1) {
         msg_Warn(NULL, "couldn't convert from %s to %s (%m)", psz_encoding,
                 psz_native_charset);
         free(psz_string);
@@ -217,32 +217,31 @@ void print_eit_events(uint8_t *p_eit, f_print pf_print, void *print_opaque, f_ic
     uint8_t j = 0;
     while ((p_event = eit_get_event(p_eit, j)) != NULL) {
         j++;
-        char start_str[24], duration_str[10];
+        char start_str[24];
         int duration, hour, min, sec;
         time_t start_ts;
 
         start_ts = dvb_time_format_UTC(eitn_get_start_time(p_event), NULL, start_str);
 
         dvb_time_decode_bcd(eitn_get_duration_bcd(p_event), &duration, &hour, &min, &sec);
-        sprintf(duration_str, "%02d:%02d:%02d", hour, min, sec);
 
         switch (i_print_type) {
         case PRINT_XML:
             pf_print(print_opaque, "<EVENT id=\"%u\" start_time=\"%ld\" start_time_dec=\"%s\""
-                                   " duration=\"%u\" duration_dec=\"%s\""
+                                   " duration=\"%u\" duration_dec=\"%u:%02u:%02u\""
                                    " running=\"%d\" free_CA=\"%d\">",
                      eitn_get_event_id(p_event),
                      start_ts, start_str,
-                     duration, duration_str,
+                     duration, hour, min, sec,
                      eitn_get_running(p_event),
                      eitn_get_ca(p_event)
                     );
             break;
         default:
-            pf_print(print_opaque, "  * EVENT id=%u start_time=%ld start_time_dec=\"%s\" duration=%u duration_dec=%s running=%d free_CA=%d",
+            pf_print(print_opaque, "  * EVENT id=%u start_time=%ld start_time_dec=\"%s\" duration=%u duration_dec=%u:%02u:%02u running=%d free_CA=%d",
                      eitn_get_event_id(p_event),
                      start_ts, start_str,
-                     duration, duration_str,
+                     duration, hour, min, sec,
                      eitn_get_running(p_event),
                      eitn_get_ca(p_event)
                     );
diff --git a/en50221.c b/en50221.c
index 792d48a..7c1be49 100644
--- a/en50221.c
+++ b/en50221.c
@@ -1391,9 +1391,14 @@ static void ConditionalAccessHandle( access_t * p_access, int i_session_id,
  *****************************************************************************/
 static void ConditionalAccessClose( access_t * p_access, int i_session_id )
 {
+    system_ids_t *p_ids =
+        (system_ids_t *)p_sessions[i_session_id - 1].p_sys;
 
     msg_Dbg( p_access, "closing ConditionalAccess session (%d)", i_session_id );
 
+    if ( p_ids->i_nb_system_ids )
+        free( p_ids->pi_system_ids );
+
     free( p_sessions[i_session_id - 1].p_sys );
 }
 
diff --git a/udp.c b/udp.c
index 7945fca..a603d1d 100644
--- a/udp.c
+++ b/udp.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * udp.c: UDP input for DVBlast
  *****************************************************************************
- * Copyright (C) 2009, 2015 VideoLAN
+ * Copyright (C) 2009, 2015, 2020 VideoLAN
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -48,7 +48,6 @@
 /*****************************************************************************
  * Local declarations
  *****************************************************************************/
-#define UDP_LOCK_TIMEOUT 5000000 /* 5 s */
 #define PRINT_REFRACTORY_PERIOD 1000000 /* 1 s */
 
 static int i_handle;
@@ -278,7 +277,7 @@ void udp_Open( void )
     ev_io_start(event_loop, &udp_watcher);
 
     ev_timer_init(&mute_watcher, udp_MuteCb,
-                  UDP_LOCK_TIMEOUT / 1000000., UDP_LOCK_TIMEOUT / 1000000.);
+                  i_udp_lock_timeout / 1000000., i_udp_lock_timeout / 1000000.);
     memset(&last_addr, 0, sizeof(last_addr));
 }
 
@@ -450,6 +449,8 @@ static void udp_MuteCb(struct ev_loop *loop, struct ev_timer *w, int revents)
     default:
         break;
     }
+
+    b_sync = false;
 }
 
 /* From now on these are just stubs */
diff --git a/util.c b/util.c
index aa31f92..f270f41 100644
--- a/util.c
+++ b/util.c
@@ -351,7 +351,7 @@ void hexDump( uint8_t *p_data, uint32_t i_len )
     char *p_outline;
     char *p_hrdata;
 
-    p_outline = malloc(69);
+    p_outline = malloc(70);
     p_hrdata  = malloc(17);
 
     for( i = 0; i < i_len; i += 16 )
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin