Commit 8b02af1e authored by Vittorio Gambaletta (VittGam)'s avatar Vittorio Gambaletta (VittGam) Committed by Michael Niedermayer

avformat/mpegtsenc: Fix multi program so that it supports adding the same...

avformat/mpegtsenc: Fix multi program so that it supports adding the same stream to multiple programs.
Signed-off-by: 's avatarVittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 191ec55c
......@@ -275,8 +275,19 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
if (s->nb_programs) {
AVProgram *program = av_find_program_from_stream(s, NULL, i);
if (program->id != service->sid)
int j, k, found = 0;
for (j = 0; j < s->nb_programs; j++)
if (s->programs[j]->id == service->sid) {
for (k = 0; k < s->programs[j]->nb_stream_indexes; k++)
if (s->programs[j]->stream_index[k] == i) {
found = 1;
break;
}
break;
}
if (!found)
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment