Commit ad7f2b69 authored by Anton Khirnov's avatar Anton Khirnov

lavf: rewrite the av_interleaved_write_frame() doxy

Remove some vague / incorrect statements and make the text more specific
and less confusing.
parent b36bc81c
...@@ -1457,28 +1457,36 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt); ...@@ -1457,28 +1457,36 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
/** /**
* Write a packet to an output media file ensuring correct interleaving. * Write a packet to an output media file ensuring correct interleaving.
* *
* The packet must contain one audio or video frame. * This function will buffer the packets internally as needed to make sure the
* If the packets are already correctly interleaved, the application should * packets in the output file are properly interleaved in the order of
* call av_write_frame() instead as it is slightly faster. It is also important * increasing dts. Callers doing their own interleaving should call
* to keep in mind that completely non-interleaved input will need huge amounts * av_write_frame() instead of this function.
* of memory to interleave with this, so it is preferable to interleave at the
* demuxer level.
* *
* @param s media file handle * @param s media file handle
* @param pkt The packet containing the data to be written. pkt->buf must be set * @param pkt @parblock
* to a valid AVBufferRef describing the packet data. Libavformat takes * The packet containing the data to be written.
* ownership of this reference and will unref it when it sees fit. The caller *
* must not access the data through this reference after this function returns. * If the packet is reference-counted, this function will take
* This can be NULL (at any time, not just at the end), to flush the * ownership of this reference and unreference it later when it sees
* interleaving queues. * fit.
* Packet's @ref AVPacket.stream_index "stream_index" field must be set to the * The caller must not access the data through this reference after
* index of the corresponding stream in @ref AVFormatContext.streams * this function returns. If the packet is not reference-counted,
* "s.streams". * libavformat will make a copy.
* It is very strongly recommended that timing information (@ref AVPacket.pts *
* "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to * This parameter can be NULL (at any time, not just at the end), to
* correct values. * flush the interleaving queues.
*
* Packet's @ref AVPacket.stream_index "stream_index" field must be
* set to the index of the corresponding stream in @ref
* AVFormatContext.streams "s->streams". It is very strongly
* recommended that timing information (@ref AVPacket.pts "pts", @ref
* AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
* correct values.
* @endparblock
* *
* @return 0 on success, a negative AVERROR on error. * @return 0 on success, a negative AVERROR on error.
*
* @see av_write_frame(), AVFormatContext.max_interleave_delta
*/ */
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt); int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment