Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts scan: put tuned muxes to the end-of-queue, fixes #4088
  • Loading branch information
perexg committed Nov 24, 2016
1 parent 89d14dd commit f30b504
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/input/mpegts.h
Expand Up @@ -433,6 +433,7 @@ struct mpegts_mux
int mm_tsid_checks;
int mm_tsid_accept_zero_value;
tvhlog_limit_t mm_tsid_loglimit;
int64_t mm_start_monoclock;

int mm_update_pids_flag;
mtimer_t mm_update_pids_timer;
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts/mpegts_mux.c
Expand Up @@ -262,6 +262,7 @@ mpegts_mux_instance_start

/* Start */
tvhdebug(LS_MPEGTS, "%s - started", buf);
mm->mm_start_monoclock = mclk();
mi->mi_started_mux(mi, mmi);

/* Event handler */
Expand Down
7 changes: 5 additions & 2 deletions src/input/mpegts/mpegts_network_scan.c
Expand Up @@ -35,8 +35,11 @@ static int
mm_cmp ( mpegts_mux_t *a, mpegts_mux_t *b )
{
int r = b->mm_scan_weight - a->mm_scan_weight;
if (r == 0)
return mpegts_mux_compare(a, b);
if (r == 0) {
r = MINMAX(-1, 1, b->mm_start_monoclock - a->mm_start_monoclock);
if (r == 0)
return mpegts_mux_compare(a, b);
}
return r;
}

Expand Down

0 comments on commit f30b504

Please sign in to comment.