Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
717a4509
Commit
717a4509
authored
Oct 31, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: clarify the lifetime of demuxed packets.
parent
c8977f6d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
avformat.h
libavformat/avformat.h
+16
-10
No files found.
libavformat/avformat.h
View file @
717a4509
...
@@ -158,9 +158,15 @@
...
@@ -158,9 +158,15 @@
* information will be in AVStream.time_base units, i.e. it has to be
* information will be in AVStream.time_base units, i.e. it has to be
* multiplied by the timebase to convert them to seconds.
* multiplied by the timebase to convert them to seconds.
*
*
* The packet data belongs to the demuxer and is invalid after the next call to
* If AVPacket.destruct is set on the returned packet, then the packet is
* av_read_frame(). The user must free the packet with av_free_packet() before
* allocated dynamically and the user may keep it indefinitely.
* calling av_read_frame() again or closing the file.
* Otherwise, if AVPacket.destruct is NULL, the packet data is backed by a
* static storage somewhere inside the demuxer and the packet is only valid
* until the next av_read_frame() call or closing the file. If the caller
* requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
* of it.
* In both cases, the packet must be freed with av_free_packet() when it is no
* longer needed.
*
*
* @section lavf_decoding_seek Seeking
* @section lavf_decoding_seek Seeking
* @}
* @}
...
@@ -1307,13 +1313,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt);
...
@@ -1307,13 +1313,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt);
* omit invalid data between valid frames so as to give the decoder the maximum
* omit invalid data between valid frames so as to give the decoder the maximum
* information possible for decoding.
* information possible for decoding.
*
*
*
The returned packet is valid
*
If pkt->destruct is NULL, then the packet is valid until the next
*
until the next av_read_frame() or until av_close_input_file() an
d
*
av_read_frame() or until av_close_input_file(). Otherwise the packet is vali
d
*
must be freed with av_free_packet. For video, the packet contains
*
indefinitely. In both cases the packet must be freed with
*
exactly one frame. For audio, it contains an integer number of
*
av_free_packet when it is no longer needed. For video, the packet contains
*
frames if each frame has a known fixed size (e.g. PCM or ADPCM
*
exactly one frame. For audio, it contains an integer number of frames if each
*
data). If the audio frames have a variable size (e.g. MPEG audio),
*
frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames
* then it contains one frame.
*
have a variable size (e.g. MPEG audio),
then it contains one frame.
*
*
* pkt->pts, pkt->dts and pkt->duration are always set to correct
* pkt->pts, pkt->dts and pkt->duration are always set to correct
* values in AVStream.time_base units (and guessed if the format cannot
* values in AVStream.time_base units (and guessed if the format cannot
...
...
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