changeset 2920:5f15ed0f5fdc libavformat

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.
author aurel
date Fri, 11 Jan 2008 01:00:04 +0000
parents e70dc14a3f9f
children dab2aecebb97
files movenc.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/movenc.c	Fri Jan 11 00:47:02 2008 +0000
+++ b/movenc.c	Fri Jan 11 01:00:04 2008 +0000
@@ -452,10 +452,10 @@
     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 @@
             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 @@
     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);