Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
52b0943f
Commit
52b0943f
authored
Mar 03, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: factorize freeing a packet buffer.
parent
c9dbac36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
utils.c
libavformat/utils.c
+13
-17
No files found.
libavformat/utils.c
View file @
52b0943f
...
@@ -1000,6 +1000,17 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
...
@@ -1000,6 +1000,17 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
pkt
->
convergence_duration
=
pc
->
convergence_duration
;
pkt
->
convergence_duration
=
pc
->
convergence_duration
;
}
}
static
void
free_packet_buffer
(
AVPacketList
**
pkt_buf
,
AVPacketList
**
pkt_buf_end
)
{
while
(
*
pkt_buf
)
{
AVPacketList
*
pktl
=
*
pkt_buf
;
*
pkt_buf
=
pktl
->
next
;
av_free_packet
(
&
pktl
->
pkt
);
av_freep
(
&
pktl
);
}
*
pkt_buf_end
=
NULL
;
}
static
int
read_frame_internal
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
read_frame_internal
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
{
...
@@ -1223,24 +1234,9 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
...
@@ -1223,24 +1234,9 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
/* XXX: suppress the packet queue */
/* XXX: suppress the packet queue */
static
void
flush_packet_queue
(
AVFormatContext
*
s
)
static
void
flush_packet_queue
(
AVFormatContext
*
s
)
{
{
AVPacketList
*
pktl
;
free_packet_buffer
(
&
s
->
packet_buffer
,
&
s
->
packet_buffer_end
);
free_packet_buffer
(
&
s
->
raw_packet_buffer
,
&
s
->
raw_packet_buffer_end
);
for
(;;)
{
pktl
=
s
->
packet_buffer
;
if
(
!
pktl
)
break
;
s
->
packet_buffer
=
pktl
->
next
;
av_free_packet
(
&
pktl
->
pkt
);
av_free
(
pktl
);
}
while
(
s
->
raw_packet_buffer
){
pktl
=
s
->
raw_packet_buffer
;
s
->
raw_packet_buffer
=
pktl
->
next
;
av_free_packet
(
&
pktl
->
pkt
);
av_free
(
pktl
);
}
s
->
packet_buffer_end
=
s
->
raw_packet_buffer_end
=
NULL
;
s
->
raw_packet_buffer_remaining_size
=
RAW_PACKET_BUFFER_SIZE
;
s
->
raw_packet_buffer_remaining_size
=
RAW_PACKET_BUFFER_SIZE
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment