diff mov.c @ 775:c5077fdab490 libavformat

AVPacket.pos
author michael
date Thu, 26 May 2005 20:17:12 +0000
parents 581bec6f0eb0
children 040cf31abb4b
line wrap: on
line diff
--- a/mov.c	Thu May 26 07:47:51 2005 +0000
+++ b/mov.c	Thu May 26 20:17:12 2005 +0000
@@ -253,9 +253,6 @@
     int time_scale;
     long current_sample;
     long left_in_chunk; /* how many samples before next chunk */
-    /* specific MPEG4 header which is added at the beginning of the stream */
-    unsigned int header_len;
-    uint8_t *header_data;
     MOV_esds_t esds;
 } MOVStreamContext;
 
@@ -1672,7 +1669,6 @@
         av_freep(&sc->sample_to_chunk);
         av_freep(&sc->sample_sizes);
         av_freep(&sc->keyframes);
-        av_freep(&sc->header_data);
         av_freep(&sc->stts_data);        
         av_freep(&sc->ctts_data);        
         av_freep(&sc);
@@ -1974,18 +1970,7 @@
         return -1;
     url_fseek(&s->pb, offset, SEEK_SET);
 
-    //av_log(NULL, AV_LOG_DEBUG, "READCHUNK hlen: %d  %d off: %Ld   pos:%Ld\n", size, sc->header_len, offset, url_ftell(&s->pb));
-    if (sc->header_len > 0) {
-        av_new_packet(pkt, size + sc->header_len);
-        memcpy(pkt->data, sc->header_data, sc->header_len);
-        get_buffer(&s->pb, pkt->data + sc->header_len, size);
-        /* free header */
-        av_freep(&sc->header_data);
-        sc->header_len = 0;
-    } else {
-        av_new_packet(pkt, size);
-        get_buffer(&s->pb, pkt->data, pkt->size);
-    }
+    av_get_packet(&s->pb, pkt, size);
     pkt->stream_index = sc->ffindex;
     
     // If the keyframes table exists, mark any samples that are in the table as key frames.