- av_packet_unref(avci->last_pkt_props);
- if (pkt) {
- ret = av_packet_copy_props(avci->last_pkt_props, pkt);
- if (!ret)
- avci->last_pkt_props->size = pkt->size; // HACK: Needed for ff_decode_frame_props().
+ ret = avpriv_packet_list_put(&avci->pkt_props, &avci->pkt_props_tail, pkt,
+ av_packet_copy_props, 0);
+ if (ret < 0)
+ return ret;
+ avci->pkt_props_tail->pkt.size = pkt->size; // HACK: Needed for ff_decode_frame_props().
+ avci->pkt_props_tail->pkt.data = (void*)1; // HACK: Needed for IS_EMPTY().
+
+ if (IS_EMPTY(avci->last_pkt_props)) {
+ ret = avpriv_packet_list_get(&avci->pkt_props,
+ &avci->pkt_props_tail,
+ avci->last_pkt_props);
+ av_assert0(ret != AVERROR(EAGAIN));