Merge commit '42805eda554a7fc44341282771531e7837ac72b7'
* commit '42805eda554a7fc44341282771531e7837ac72b7': rtpdec: Store the dynamic payload handler in the rtpdec context Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
8c3ae9ee66
@ -425,7 +425,7 @@ void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
|
|||||||
RTPDynamicProtocolHandler *handler)
|
RTPDynamicProtocolHandler *handler)
|
||||||
{
|
{
|
||||||
s->dynamic_protocol_context = ctx;
|
s->dynamic_protocol_context = ctx;
|
||||||
s->parse_packet = handler->parse_packet;
|
s->handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -540,9 +540,10 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else if (s->parse_packet) {
|
} else if (s->handler && s->handler->parse_packet) {
|
||||||
rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
|
rv = s->handler->parse_packet(s->ic, s->dynamic_protocol_context,
|
||||||
s->st, pkt, ×tamp, buf, len, seq, flags);
|
s->st, pkt, ×tamp, buf, len, seq,
|
||||||
|
flags);
|
||||||
} else {
|
} else {
|
||||||
/* At this point, the RTP header has been stripped;
|
/* At this point, the RTP header has been stripped;
|
||||||
* This is ASSUMING that there is only 1 CSRC, which isn't wise. */
|
* This is ASSUMING that there is only 1 CSRC, which isn't wise. */
|
||||||
@ -683,11 +684,11 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
|
|||||||
if (s->prev_ret <= 0)
|
if (s->prev_ret <= 0)
|
||||||
return rtp_parse_queued_packet(s, pkt);
|
return rtp_parse_queued_packet(s, pkt);
|
||||||
/* return the next packets, if any */
|
/* return the next packets, if any */
|
||||||
if (s->st && s->parse_packet) {
|
if (s->st && s->handler && s->handler->parse_packet) {
|
||||||
/* timestamp should be overwritten by parse_packet, if not,
|
/* timestamp should be overwritten by parse_packet, if not,
|
||||||
* the packet is left with pts == AV_NOPTS_VALUE */
|
* the packet is left with pts == AV_NOPTS_VALUE */
|
||||||
timestamp = RTP_NOTS_VALUE;
|
timestamp = RTP_NOTS_VALUE;
|
||||||
rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
|
rv = s->handler->parse_packet(s->ic, s->dynamic_protocol_context,
|
||||||
s->st, pkt, ×tamp, NULL, 0, 0,
|
s->st, pkt, ×tamp, NULL, 0, 0,
|
||||||
flags);
|
flags);
|
||||||
finalize_packet(s, pkt, timestamp);
|
finalize_packet(s, pkt, timestamp);
|
||||||
|
@ -184,7 +184,7 @@ struct RTPDemuxContext {
|
|||||||
uint8_t buf[RTP_MAX_PACKET_LENGTH];
|
uint8_t buf[RTP_MAX_PACKET_LENGTH];
|
||||||
|
|
||||||
/* dynamic payload stuff */
|
/* dynamic payload stuff */
|
||||||
DynamicPayloadPacketHandlerProc parse_packet;
|
const RTPDynamicProtocolHandler *handler;
|
||||||
PayloadContext *dynamic_protocol_context;
|
PayloadContext *dynamic_protocol_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user