mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-28 22:28:14 +00:00
avformat/utils: Don't create unnecessary references
When AVFMT_FLAG_GENPTS is set, av_read_frame would put a reference to a packet in the packet list (via av_packet_ref) and then immediately thereafter unreference the original packet. This has been changed to move the reference instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
bf79e4426a
commit
ada02cf85f
@ -1858,10 +1858,11 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
ret = ff_packet_list_put(&s->internal->packet_buffer,
|
ret = ff_packet_list_put(&s->internal->packet_buffer,
|
||||||
&s->internal->packet_buffer_end,
|
&s->internal->packet_buffer_end,
|
||||||
pkt, FF_PACKETLIST_FLAG_REF_PACKET);
|
pkt, 0);
|
||||||
av_packet_unref(pkt);
|
if (ret < 0) {
|
||||||
if (ret < 0)
|
av_packet_unref(pkt);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return_packet:
|
return_packet:
|
||||||
|
Loading…
Reference in New Issue
Block a user