diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-03-23 02:58:52 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-03-26 21:52:48 +0100 |
commit | 6e5648ad42b7fd5f13d90648a8fc49fbbcdb9187 (patch) | |
tree | 2093b92f1d9c060376c8d10dc48a116fa53521ef /libavformat/mpegtsenc.c | |
parent | e15a48d35afae9308dab9f9c06f801e8310e8928 (diff) | |
download | ffmpeg-6e5648ad42b7fd5f13d90648a8fc49fbbcdb9187.tar.gz |
avformat/mpegtsenc: Fix used service
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26811fd9468dc484402faca3ca33cacb2e58c53e)
Conflicts:
libavformat/version.h
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r-- | libavformat/mpegtsenc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 360c1372d1..6bf5461b64 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -806,6 +806,7 @@ static int mpegts_init(AVFormatContext *s) /* assign pids to each stream */ for (i = 0; i < s->nb_streams; i++) { + AVProgram *program; st = s->streams[i]; ts_st = av_mallocz(sizeof(MpegTSWriteStream)); @@ -823,6 +824,17 @@ static int mpegts_init(AVFormatContext *s) ret = AVERROR(ENOMEM); goto fail; } + + program = av_find_program_from_stream(s, NULL, i); + if (program) { + for (j = 0; j < ts->nb_services; j++) { + if (ts->services[j]->program == program) { + service = ts->services[j]; + break; + } + } + } + ts_st->service = service; /* MPEG pid values < 16 are reserved. Applications which set st->id in * this range are assigned a calculated pid. */ |