Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
profile: added unique id (service or channel) to profile chains
  • Loading branch information
perexg committed Oct 22, 2014
1 parent aa53af5 commit 97e7f1a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/dvr/dvr_rec.c
Expand Up @@ -78,7 +78,7 @@ dvr_rec_subscribe(dvr_entry_t *de)

pro = de->de_config->dvr_profile;
prch = malloc(sizeof(*prch));
if (profile_chain_open(pro, prch, &de->de_config->dvr_muxcnf, 0, 0)) {
if (profile_chain_open(pro, prch, de->de_channel, &de->de_config->dvr_muxcnf, 0, 0)) {
tvherror("dvr", "unable to create new channel streaming chain for '%s'",
channel_get_name(de->de_channel));
return;
Expand Down
2 changes: 1 addition & 1 deletion src/htsp_server.c
Expand Up @@ -1762,7 +1762,7 @@ htsp_method_subscribe(htsp_connection_t *htsp, htsmsg_t *in)
#endif

pro = profile_find_by_list(htsp->htsp_granted_access->aa_profiles, profile_id, "htsp");
if (!profile_work(pro, &hs->hs_prch, &hs->hs_input, timeshiftPeriod, pflags)) {
if (!profile_work(pro, &hs->hs_prch, ch, &hs->hs_input, timeshiftPeriod, pflags)) {
tvhlog(LOG_ERR, "htsp", "unable to create profile chain '%s'", pro->pro_name);
free(hs);
return htsp_error("Stream setup error");
Expand Down
12 changes: 6 additions & 6 deletions src/profile.c
Expand Up @@ -485,7 +485,7 @@ const idclass_t profile_htsp_class =

static int
profile_htsp_work(profile_t *_pro, profile_chain_t *prch,
streaming_target_t *dst,
void *id, streaming_target_t *dst,
uint32_t timeshift_period, int flags)
{
if (!(flags & PRCH_FLAG_SKIPZEROING))
Expand Down Expand Up @@ -548,7 +548,7 @@ const idclass_t profile_mpegts_pass_class =
};

static int
profile_mpegts_pass_open(profile_t *_pro, profile_chain_t *prch,
profile_mpegts_pass_open(profile_t *_pro, profile_chain_t *prch, void *id,
muxer_config_t *m_cfg, int flags, size_t qsize)
{
profile_mpegts_t *pro = (profile_mpegts_t *)_pro;
Expand Down Expand Up @@ -612,7 +612,7 @@ const idclass_t profile_matroska_class =
};

static int
profile_matroska_open(profile_t *_pro, profile_chain_t *prch,
profile_matroska_open(profile_t *_pro, profile_chain_t *prch, void *id,
muxer_config_t *m_cfg, int flags, size_t qsize)
{
profile_matroska_t *pro = (profile_matroska_t *)_pro;
Expand Down Expand Up @@ -884,7 +884,7 @@ const idclass_t profile_transcode_class =

static int
profile_transcode_work(profile_t *_pro, profile_chain_t *prch,
streaming_target_t *dst,
void *id, streaming_target_t *dst,
uint32_t timeshift_period, int flags)
{
profile_transcode_t *pro = (profile_transcode_t *)_pro;
Expand Down Expand Up @@ -935,7 +935,7 @@ profile_transcode_mc_valid(int mc)
}

static int
profile_transcode_open(profile_t *_pro, profile_chain_t *prch,
profile_transcode_open(profile_t *_pro, profile_chain_t *prch, void *id,
muxer_config_t *m_cfg, int flags, size_t qsize)
{
profile_transcode_t *pro = (profile_transcode_t *)_pro;
Expand All @@ -957,7 +957,7 @@ profile_transcode_open(profile_t *_pro, profile_chain_t *prch,
streaming_queue_init(&prch->prch_sq, 0, qsize);
prch->prch_gh = globalheaders_create(&prch->prch_sq.sq_st);

r = profile_transcode_work(_pro, prch, prch->prch_gh, 0,
r = profile_transcode_work(_pro, prch, prch->prch_gh, id, 0,
PRCH_FLAG_SKIPZEROING | PRCH_FLAG_TSFIX);
if (r)
return r;
Expand Down
12 changes: 6 additions & 6 deletions src/profile.h
Expand Up @@ -84,9 +84,9 @@ typedef struct profile {
muxer_container_type_t (*pro_get_mc)(struct profile *pro);

int (*pro_work)(struct profile *pro, profile_chain_t *prch,
struct streaming_target *dst,
void *id, struct streaming_target *dst,
uint32_t timeshift_period, int flags);
int (*pro_open)(struct profile *pro, profile_chain_t *prch,
int (*pro_open)(struct profile *pro, profile_chain_t *prch, void *id,
muxer_config_t *m_cfg, int flags, size_t qsize);
} profile_t;

Expand All @@ -97,14 +97,14 @@ profile_t *profile_create

static inline int
profile_work(profile_t *pro, profile_chain_t *prch,
struct streaming_target *dst,
void *id, struct streaming_target *dst,
uint32_t timeshift_period, int flags)
{ return pro && pro->pro_work ? pro->pro_work(pro, prch, dst, timeshift_period, flags) : -1; }
{ return pro && pro->pro_work ? pro->pro_work(pro, prch, id, dst, timeshift_period, flags) : -1; }

static inline int
profile_chain_open(profile_t *pro, profile_chain_t *prch,
profile_chain_open(profile_t *pro, profile_chain_t *prch, void *id,
muxer_config_t *m_cfg, int flags, size_t qsize)
{ return pro && pro->pro_open ? pro->pro_open(pro, prch, m_cfg, flags, qsize) : -1; }
{ return pro && pro->pro_open ? pro->pro_open(pro, prch, id, m_cfg, flags, qsize) : -1; }
int profile_chain_raw_open(profile_chain_t *prch, size_t qsize);
void profile_chain_close(profile_chain_t *prch);

Expand Down
4 changes: 2 additions & 2 deletions src/webui/webui.c
Expand Up @@ -732,7 +732,7 @@ http_stream_service(http_connection_t *hc, service_t *service, int weight)
else
qsize = 1500000;

if (!profile_chain_open(pro, &prch, NULL, 0, qsize)) {
if (!profile_chain_open(pro, &prch, service, NULL, 0, qsize)) {

tcp_get_ip_str((struct sockaddr*)hc->hc_peer, addrbuf, 50);

Expand Down Expand Up @@ -846,7 +846,7 @@ http_stream_channel(http_connection_t *hc, channel_t *ch, int weight)
else
qsize = 1500000;

if (!profile_chain_open(pro, &prch, NULL, 0, qsize)) {
if (!profile_chain_open(pro, &prch, ch, NULL, 0, qsize)) {

tcp_get_ip_str((struct sockaddr*)hc->hc_peer, addrbuf, 50);

Expand Down

0 comments on commit 97e7f1a

Please sign in to comment.