mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-19 05:49:09 +02:00
avformat/mpegtsenc: Keep track of the program for each service
Simplifies code Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 50d017a28171177b89c367194ec8d02f963e7e9e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0fae52d7e3
commit
e15a48d35a
@ -56,6 +56,7 @@ typedef struct MpegTSService {
|
|||||||
int pcr_pid;
|
int pcr_pid;
|
||||||
int pcr_packet_count;
|
int pcr_packet_count;
|
||||||
int pcr_packet_period;
|
int pcr_packet_period;
|
||||||
|
AVProgram *program;
|
||||||
} MpegTSService;
|
} MpegTSService;
|
||||||
|
|
||||||
// service_type values as defined in ETSI 300 468
|
// service_type values as defined in ETSI 300 468
|
||||||
@ -275,15 +276,12 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
|
|||||||
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
||||||
|
|
||||||
if (s->nb_programs) {
|
if (s->nb_programs) {
|
||||||
int j, k, found = 0;
|
int k, found = 0;
|
||||||
|
AVProgram *program = service->program;
|
||||||
|
|
||||||
for (j = 0; j < s->nb_programs; j++)
|
for (k = 0; k < program->nb_stream_indexes; k++)
|
||||||
if (s->programs[j]->id == service->sid) {
|
if (program->stream_index[k] == i) {
|
||||||
for (k = 0; k < s->programs[j]->nb_stream_indexes; k++)
|
found = 1;
|
||||||
if (s->programs[j]->stream_index[k] == i) {
|
|
||||||
found = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,6 +782,7 @@ static int mpegts_init(AVFormatContext *s)
|
|||||||
service->pmt.write_packet = section_write_packet;
|
service->pmt.write_packet = section_write_packet;
|
||||||
service->pmt.opaque = s;
|
service->pmt.opaque = s;
|
||||||
service->pmt.cc = 15;
|
service->pmt.cc = 15;
|
||||||
|
service->program = program;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user