diff --git a/libavformat/dv.c b/libavformat/dv.c
index 70786b1071d67acf0f3a663037428b4d6c7cd4d4..17c545c3ca08d89d3b2edbeadd3fd830b9f55a7c 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -372,7 +372,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
     pkt->data         = buf;
     pkt->size         = size;
     pkt->flags       |= AV_PKT_FLAG_KEY;
-    pkt->stream_index = c->vst->id;
+    pkt->stream_index = c->vst->index;
     pkt->pts          = c->frames;
 
     c->frames++;