RTPDynamicProtocolHandler *handler)
{
s->dynamic_protocol_context = ctx;
- s->parse_packet = handler->parse_packet;
+ s->handler = handler;
}
/**
return 1;
}
return 0;
- } else if (s->parse_packet) {
- rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
- s->st, pkt, ×tamp, buf, len, seq, flags);
+ } else if (s->handler && s->handler->parse_packet) {
+ rv = s->handler->parse_packet(s->ic, s->dynamic_protocol_context,
+ s->st, pkt, ×tamp, buf, len, seq,
+ flags);
} else {
/* At this point, the RTP header has been stripped;
* This is ASSUMING that there is only 1 CSRC, which isn't wise. */
if (s->prev_ret <= 0)
return rtp_parse_queued_packet(s, pkt);
/* 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,
* the packet is left with pts == AV_NOPTS_VALUE */
timestamp = RTP_NOTS_VALUE;
- rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
- s->st, pkt, ×tamp, NULL, 0, 0,
- flags);
+ rv = s->handler->parse_packet(s->ic, s->dynamic_protocol_context,
+ s->st, pkt, ×tamp, NULL, 0, 0,
+ flags);
finalize_packet(s, pkt, timestamp);
return rv;
} else {