changeset 4683:d12f0e989bd5 libavformat

Set AVPacket pos also for audio packets in nuv demuxer.
author reimar
date Mon, 09 Mar 2009 11:35:59 +0000
parents c12f591bf750
children 755858ca9f6a
files nuv.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nuv.c	Mon Mar 09 04:17:12 2009 +0000
+++ b/nuv.c	Mon Mar 09 11:35:59 2009 +0000
@@ -197,6 +197,7 @@
     int ret, size;
     while (!url_feof(pb)) {
         int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0;
+        uint64_t pos = url_ftell(pb);
         ret = get_buffer(pb, hdr, HDRSIZE);
         if (ret <= 0)
             return ret ? ret : -1;
@@ -217,7 +218,7 @@
                 ret = av_new_packet(pkt, copyhdrsize + size);
                 if (ret < 0)
                     return ret;
-                pkt->pos = url_ftell(pb) - copyhdrsize;
+                pkt->pos = pos;
                 pkt->pts = AV_RL32(&hdr[4]);
                 pkt->stream_index = ctx->v_id;
                 memcpy(pkt->data, hdr, copyhdrsize);
@@ -230,6 +231,7 @@
                     break;
                 }
                 ret = av_get_packet(pb, pkt, size);
+                pkt->pos = pos;
                 pkt->pts = AV_RL32(&hdr[4]);
                 pkt->stream_index = ctx->a_id;
                 return ret;