int start_off = avio_tell(pb);
mflags = avio_r8(pb);
- if (mflags & 0x80)
- flags |= RTP_FLAG_KEY;
len_off = avio_rb24(pb);
if (mflags & 0x20) /**< relative timestamp */
avio_skip(pb, 4);
* multiple RTP packets.
*/
if (asf->pktbuf && len_off != avio_tell(asf->pktbuf)) {
- uint8_t *p;
- avio_close_dyn_buf(asf->pktbuf, &p);
- asf->pktbuf = NULL;
- av_free(p);
+ ffio_free_dyn_buf(&asf->pktbuf);
}
if (!len_off && !asf->pktbuf &&
(res = avio_open_dyn_buf(&asf->pktbuf)) < 0)
return res == 1 ? -1 : res;
}
-static void asfrtp_free_context(PayloadContext *asf)
+static void asfrtp_close_context(PayloadContext *asf)
{
- if (asf->pktbuf) {
- uint8_t *p = NULL;
- avio_close_dyn_buf(asf->pktbuf, &p);
- asf->pktbuf = NULL;
- av_free(p);
- }
+ ffio_free_dyn_buf(&asf->pktbuf);
av_freep(&asf->buf);
- av_free(asf);
}
#define RTP_ASF_HANDLER(n, s, t) \
.codec_id = AV_CODEC_ID_NONE, \
.priv_data_size = sizeof(PayloadContext), \
.parse_sdp_a_line = asfrtp_parse_sdp_line, \
- .free = asfrtp_free_context, \
+ .close = asfrtp_close_context, \
.parse_packet = asfrtp_parse_packet, \
}