mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-15 05:11:37 +08:00
avcodec/packet_internal: Add proper PacketList struct
Up until now, we had a PacketList structure which is actually a PacketListEntry; a proper PacketList did not exist and all the related functions just passed pointers to pointers to the head and tail elements around. All these pointers were actually consecutive elements of their containing structs, i.e. the users already treated them as if they were a struct. So add a proper PacketList struct and rename the current PacketList to PacketListEntry; also make the functions use this structure instead of the pair of pointers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -5339,7 +5339,7 @@ static int mov_write_squashed_packet(AVFormatContext *s, MOVTrack *track)
|
||||
|
||||
switch (track->st->codecpar->codec_id) {
|
||||
case AV_CODEC_ID_TTML: {
|
||||
int had_packets = !!track->squashed_packet_queue;
|
||||
int had_packets = !!track->squashed_packet_queue.head;
|
||||
|
||||
if ((ret = ff_mov_generate_squashed_ttml_packet(s, track, squashed_packet)) < 0) {
|
||||
goto finish_squash;
|
||||
@@ -6190,7 +6190,6 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
/* 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, NULL, 0)) < 0) {
|
||||
return ret;
|
||||
}
|
||||
@@ -6478,8 +6477,7 @@ static void mov_free(AVFormatContext *s)
|
||||
ff_mov_cenc_free(&track->cenc);
|
||||
ffio_free_dyn_buf(&track->mdat_buf);
|
||||
|
||||
avpriv_packet_list_free(&track->squashed_packet_queue,
|
||||
&track->squashed_packet_queue_end);
|
||||
avpriv_packet_list_free(&track->squashed_packet_queue);
|
||||
}
|
||||
|
||||
av_freep(&mov->tracks);
|
||||
|
Reference in New Issue
Block a user