aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-01-11 01:00:04 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-01-11 01:00:04 +0000
commitde04ad45ec92dd14b9e60085c130c1707cdb726c (patch)
tree628ebb7561c2f3cfa54aae47aa432742e34c5800 /libavformat
parented7fa39c2dd63607fd5c5ed3c607a11a8a33bbe3 (diff)
downloadffmpeg-de04ad45ec92dd14b9e60085c130c1707cdb726c.tar.gz
Add one more parameter to avc_parse_nal_units so that it allows not to
free the input buffer. This is required by upcoming extraction of isom_write_avcc to a function. Originally committed as revision 11496 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d67e9b5b96..d8a6fd87f9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -452,10 +452,10 @@ static uint8_t *avc_find_startcode( uint8_t *p, uint8_t *end )
return end + 3;
}
-static int avc_parse_nal_units(uint8_t **buf, int *size)
+static int avc_parse_nal_units(uint8_t *buf_in, uint8_t **buf, int *size)
{
ByteIOContext *pb;
- uint8_t *p = *buf;
+ uint8_t *p = buf_in;
uint8_t *end = p + *size;
uint8_t *nal_start, *nal_end;
int ret = url_open_dyn_buf(&pb);
@@ -488,7 +488,7 @@ static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track)
uint32_t sps_size=0, pps_size=0;
uint8_t *sps=0, *pps=0;
- int ret = avc_parse_nal_units(&track->vosData, &track->vosLen);
+ int ret = avc_parse_nal_units(track->vosData, &track->vosData, &track->vosLen);
if (ret < 0)
return ret;
buf = track->vosData;
@@ -1637,7 +1637,7 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
if (enc->codec_id == CODEC_ID_H264 && trk->vosLen > 0 && *(uint8_t *)trk->vosData != 1) {
/* from x264 or from bytestream h264 */
/* nal reformating needed */
- int ret = avc_parse_nal_units(&pkt->data, &pkt->size);
+ int ret = avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size);
if (ret < 0)
return ret;
assert(pkt->size);