rtpdec: factorize identical code used in several handlers
This commit is contained in:
@@ -202,20 +202,13 @@ static int xiph_handle_packet(AVFormatContext * ctx,
|
||||
|
||||
if (fragmented == 3) {
|
||||
// end of xiph data packet
|
||||
av_init_packet(pkt);
|
||||
pkt->size = avio_close_dyn_buf(data->fragment, &pkt->data);
|
||||
|
||||
if (pkt->size < 0) {
|
||||
int ret = ff_rtp_finalize_packet(pkt, &data->fragment, st->index);
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"Error occurred when getting fragment buffer.");
|
||||
return pkt->size;
|
||||
return ret;
|
||||
}
|
||||
|
||||
pkt->stream_index = st->index;
|
||||
pkt->destruct = av_destruct_packet;
|
||||
|
||||
data->fragment = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user