mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-11 03:31:59 +08:00
avformat/(aiff|flac|mov|mp3|tta)enc: Don't create unnecessary references
The packet given to muxers is not used afterwards; it is always unreferenced by libavformat. Ergo muxers are allowed to keep the references in the packets and e.g. move the ownership to a packet list. This is what this commit does. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -6187,9 +6187,11 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
/* The following will reset pkt and is only allowed to be used
|
||||
* because we return immediately. afterwards. */
|
||||
if ((ret = avpriv_packet_list_put(&trk->squashed_packet_queue,
|
||||
&trk->squashed_packet_queue_end,
|
||||
pkt, av_packet_ref, 0)) < 0) {
|
||||
pkt, NULL, 0)) < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user