Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts: fix linked inputs (abort), fixes #2791
  • Loading branch information
perexg committed Apr 23, 2015
1 parent 706beee commit 3e56c17
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/input/mpegts/mpegts_input.c
Expand Up @@ -582,6 +582,8 @@ mpegts_input_open_service ( mpegts_input_t *mi, mpegts_service_t *s, int flags,
}
} else if (flags & SUBSCRIPTION_TABLES) {
mi->mi_open_pid(mi, s->s_dvb_mux, MPEGTS_TABLES_PID, MPS_RAW | MPS_TABLES, s);
} else if (flags & SUBSCRIPTION_MINIMAL) {
mi->mi_open_pid(mi, s->s_dvb_mux, DVB_PAT_PID, MPS_RAW, s);
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/input/mpegts/mpegts_mux.c
Expand Up @@ -134,7 +134,8 @@ mpegts_mux_subscribe_keep

s = mi->mi_linked;
mi->mi_linked = NULL;
r = mpegts_mux_subscribe(mm, mi, "keep", SUBSCRIPTION_PRIO_KEEP, SUBSCRIPTION_NONE);
r = mpegts_mux_subscribe(mm, mi, "keep", SUBSCRIPTION_PRIO_KEEP,
SUBSCRIPTION_RESTART | SUBSCRIPTION_MINIMAL);
mi->mi_linked = s;
return r;
}
Expand Down Expand Up @@ -203,6 +204,7 @@ mpegts_mux_unsubscribe_linked
mpegts_mux_instance_t *mmi;

if (mi) {
tvhtrace("mpegts", "unsubscribing linked from '%s'", mi->mi_name);
LIST_FOREACH(mmi, &mi->mi_mux_active, mmi_active_link)
mpegts_mux_unsubscribe_by_name(mmi->mmi_mux, "keep");
}
Expand Down Expand Up @@ -721,6 +723,9 @@ mpegts_mux_stop ( mpegts_mux_t *mm, int force, int reason )
}
}

if (mm->mm_active != mmi)
return;

mi->mi_stopping_mux(mi, mmi);
mi->mi_stop_mux(mi, mmi);
mi->mi_stopped_mux(mi, mmi);
Expand Down
2 changes: 1 addition & 1 deletion src/input/mpegts/mpegts_mux_sched.c
Expand Up @@ -213,7 +213,7 @@ mpegts_mux_sched_timer ( void *p )
mms->mms_sub
= subscription_create_from_mux(mms->mms_prch, NULL, mms->mms_weight,
mms->mms_creator ?: "",
SUBSCRIPTION_NONE,
SUBSCRIPTION_MINIMAL,
NULL, NULL, NULL, NULL);

/* Failed (try-again soon) */
Expand Down
1 change: 1 addition & 0 deletions src/subscriptions.h
Expand Up @@ -37,6 +37,7 @@ extern struct th_subscription_list subscriptions;
#define SUBSCRIPTION_IDLESCAN 0x200 ///< for mux subscriptions
#define SUBSCRIPTION_USERSCAN 0x400 ///< for mux subscriptions
#define SUBSCRIPTION_EPG 0x800 ///< for mux subscriptions
#define SUBSCRIPTION_MINIMAL 0x1000

/* Some internal priorities */
#define SUBSCRIPTION_PRIO_KEEP 1 ///< Keep input rolling
Expand Down

0 comments on commit 3e56c17

Please sign in to comment.