Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mkmux: always initialize component index in track and use only disabl…
…ed (remove enabled) variable
  • Loading branch information
perexg committed Nov 26, 2014
1 parent 3e4c0a3 commit 39a4db4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/muxer/tvh/mkmux.c
Expand Up @@ -47,7 +47,6 @@ TAILQ_HEAD(mk_chapter_queue, mk_chapter);
*/
typedef struct mk_track {
int index;
int enabled;
int avc;
int type;
int tracknum;
Expand Down Expand Up @@ -248,11 +247,11 @@ mk_build_tracks(mk_mux_t *mkm, const streaming_start_t *ss)
tr = &mkm->tracks[i];

tr->disabled = ssc->ssc_disabled;
tr->index = ssc->ssc_index;

if(ssc->ssc_disabled)
if(tr->disabled)
continue;

tr->index = ssc->ssc_index;
tr->type = ssc->ssc_type;
tr->channels = ssc->ssc_channels;
tr->aspect_num = ssc->ssc_aspect_num;
Expand Down Expand Up @@ -329,10 +328,10 @@ mk_build_tracks(mk_mux_t *mkm, const streaming_start_t *ss)
break;

default:
tr->disabled = 1;
continue;
}

tr->enabled = 1;
tr->tracknum = ++tracknum;
mkm->has_video |= (tracktype == 1);

Expand Down Expand Up @@ -1156,11 +1155,11 @@ mk_mux_write_pkt(mk_mux_t *mkm, th_pkt_t *pkt)

for (i = 0; i < mkm->ntracks; i++) {
t = &mkm->tracks[i];
if (t->index == pkt->pkt_componentindex && t->enabled)
if (t->index == pkt->pkt_componentindex && !t->disabled)
break;
}

if(t == NULL || t->disabled) {
if(t == NULL) {
pkt_ref_dec(pkt);
return mkm->error;
}
Expand Down

0 comments on commit 39a4db4

Please sign in to comment.