Skip to content

Commit bd39590

Browse files
committed
for ossrs#250, the ts packet and adaptation field.
1 parent aff7a1c commit bd39590

File tree

2 files changed

+352
-4
lines changed

2 files changed

+352
-4
lines changed

trunk/src/kernel/srs_kernel_ts.cpp

+48
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,14 @@ SrsMpegtsFrame::SrsMpegtsFrame()
402402

403403
SrsTsPacket::SrsTsPacket()
404404
{
405+
sync_byte = 0;
406+
transport_error_indicator = 0;
407+
payload_unit_start_indicator = 0;
408+
transport_priority = 0;
409+
pid = SrsTsPidPAT;
410+
transport_scrambling_control = SrsTsScrambledDisabled;
411+
adaption_field_control = SrsTsAdaptationFieldTypeReserved;
412+
continuity_counter = 0;
405413
adaptation_field = NULL;
406414
}
407415

@@ -410,6 +418,46 @@ SrsTsPacket::~SrsTsPacket()
410418
srs_freep(adaptation_field);
411419
}
412420

421+
SrsTsAdaptationField::SrsTsAdaptationField()
422+
{
423+
adaption_field_length = 0;
424+
discontinuity_indicator = 0;
425+
random_access_indicator = 0;
426+
elementary_stream_priority_indicator = 0;
427+
PCR_flag = 0;
428+
OPCR_flag = 0;
429+
splicing_point_flag = 0;
430+
transport_private_data_flag = 0;
431+
adaptation_field_extension_flag = 0;
432+
program_clock_reference_base = 0;
433+
program_clock_reference_extension = 0;
434+
original_program_clock_reference_base = 0;
435+
original_program_clock_reference_extension = 0;
436+
splice_countdown = 0;
437+
transport_private_data_length = 0;
438+
transport_private_data = NULL;
439+
adaptation_field_extension_length = 0;
440+
ltw_flag = 0;
441+
piecewise_rate_flag = 0;
442+
seamless_splice_flag = 0;
443+
ltw_valid_flag = 0;
444+
ltw_offset = 0;
445+
piecewise_rate = 0;
446+
splice_type = 0;
447+
DTS_next_AU0 = 0;
448+
marker_bit0 = 0;
449+
DTS_next_AU1 = 0;
450+
marker_bit1 = 0;
451+
DTS_next_AU2 = 0;
452+
marker_bit2 = 0;
453+
nb_af_ext_reserved = 0;
454+
nb_af_reserved = 0;
455+
}
456+
457+
SrsTsAdaptationField::~SrsTsAdaptationField()
458+
{
459+
}
460+
413461
SrsTSMuxer::SrsTSMuxer(SrsFileWriter* w)
414462
{
415463
writer = w;

0 commit comments

Comments
 (0)