MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / new_pes_packet

Function new_pes_packet

libavformat/mpegts.c:614–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614static void new_pes_packet(PESContext *pes, AVPacket *pkt)
615{
616 av_init_packet(pkt);
617
618 pkt->destruct = av_destruct_packet;
619 pkt->data = pes->buffer;
620 pkt->size = pes->data_index;
621 memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
622
623 // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID
624 if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)
625 pkt->stream_index = pes->sub_st->index;
626 else
627 pkt->stream_index = pes->st->index;
628 pkt->pts = pes->pts;
629 pkt->dts = pes->dts;
630 /* store position of first TS packet of this PES packet */
631 pkt->pos = pes->ts_packet_pos;
632
633 /* reset pts values */
634 pes->pts = AV_NOPTS_VALUE;
635 pes->dts = AV_NOPTS_VALUE;
636 pes->buffer = NULL;
637 pes->data_index = 0;
638}
639
640/* return non zero if a packet could be constructed */
641static int mpegts_push_data(MpegTSFilter *filter,

Callers 2

mpegts_push_dataFunction · 0.85
mpegts_read_packetFunction · 0.85

Calls 1

av_init_packetFunction · 0.85

Tested by

no test coverage detected