aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-19 01:19:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-19 01:19:38 +0100
commitc130428ab5a17911d0bfa11f804ec05e6f7a53e6 (patch)
treef306849a3482395433a246d50ec3b3a57c908c5a /libavformat
parent6fd4b8a6ef13bd2d47521ed6894d25de45610291 (diff)
parent0184bbe2d1e9a77ebe04e61f84a967662b79d387 (diff)
downloadffmpeg-c130428ab5a17911d0bfa11f804ec05e6f7a53e6.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: avprobe, cmdutils: K&R formatting cosmetics tests: K&R formatting cosmetics for test programs lavf: free packets for muxers implementing interleave_packet(). lavf: fix and extend av_interleaved_write_frame() doxy. mov: Remove dead stores for spherical coordinates for channel position. error_resilience: K&R formatting cosmetics RELEASE_NOTES: mention hiding private symbols in shared builds. RELEASE_NOTES: mention some notable API changes in 0.8 Conflicts: cmdutils.h doc/RELEASE_NOTES ffprobe.c libavcodec/error_resilience.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h15
-rw-r--r--libavformat/mov.c7
-rw-r--r--libavformat/utils.c9
3 files changed, 21 insertions, 10 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 0dcaee5d64..0fbd33be5f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1819,9 +1819,18 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
* demuxer level.
*
* @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
- dts/pts, ...
- * @return < 0 on error, = 0 if OK, 1 if end of stream wanted
+ * @param pkt The packet containing the data to be written. Libavformat takes
+ * ownership of the data and will free it when it sees fit using the packet's
+ * @ref AVPacket.destruct "destruct" field. The caller must not access the data
+ * after this function returns, as it may already be freed.
+ * 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.
+ *
+ * @return 0 on success, a negative AVERROR on error.
*/
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index d242596107..3bb42fe3ed 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -602,12 +602,11 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
label_mask = 0;
for (i = 0; i < num_descr; i++) {
uint32_t label, cflags;
- float coords[3];
label = avio_rb32(pb); // mChannelLabel
cflags = avio_rb32(pb); // mChannelFlags
- AV_WN32(&coords[0], avio_rl32(pb)); // mCoordinates[0]
- AV_WN32(&coords[1], avio_rl32(pb)); // mCoordinates[1]
- AV_WN32(&coords[2], avio_rl32(pb)); // mCoordinates[2]
+ avio_rl32(pb); // mCoordinates[0]
+ avio_rl32(pb); // mCoordinates[1]
+ avio_rl32(pb); // mCoordinates[2]
if (layout_tag == 0) {
uint32_t mask_incr = ff_mov_get_channel_label(label);
if (mask_incr == 0) {
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7606a8eac8..9409ebe671 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3492,9 +3492,12 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pk
* < 0 if an error occurred
*/
static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush){
- if(s->oformat->interleave_packet)
- return s->oformat->interleave_packet(s, out, in, flush);
- else
+ if (s->oformat->interleave_packet) {
+ int ret = s->oformat->interleave_packet(s, out, in, flush);
+ if (in)
+ av_free_packet(in);
+ return ret;
+ } else
return av_interleave_packet_per_dts(s, out, in, flush);
}