diff segafilm.c @ 775:c5077fdab490 libavformat

AVPacket.pos
author michael
date Thu, 26 May 2005 20:17:12 +0000
parents 253b5292946a
children feca73904e67
line wrap: on
line diff
--- a/segafilm.c	Thu May 26 07:47:51 2005 +0000
+++ b/segafilm.c	Thu May 26 20:17:12 2005 +0000
@@ -233,6 +233,7 @@
             return AVERROR_NOMEM;
         if(pkt->size < 10)
             return -1;
+        pkt->pos= url_ftell(pb);
         ret = get_buffer(pb, pkt->data, 10);
         /* skip the non-spec CVID bytes */
         url_fseek(pb, film->cvid_extra_bytes, SEEK_CUR);
@@ -254,6 +255,7 @@
             film->stereo_buffer = av_malloc(film->stereo_buffer_size);
         }
 
+        pkt->pos= url_ftell(pb);
         ret = get_buffer(pb, film->stereo_buffer, sample->sample_size);
         if (ret != sample->sample_size)
             ret = AVERROR_IO;
@@ -272,9 +274,7 @@
             }
         }
     } else {
-        if (av_new_packet(pkt, sample->sample_size))
-            return AVERROR_NOMEM;
-        ret = get_buffer(pb, pkt->data, sample->sample_size);
+        ret= av_get_packet(pb, pkt, sample->sample_size);
         if (ret != sample->sample_size)
             ret = AVERROR_IO;
     }