comparison nsvdec.c @ 775:c5077fdab490 libavformat

AVPacket.pos
author michael
date Thu, 26 May 2005 20:17:12 +0000
parents af4e24d6310c
children feca73904e67
comparison
equal deleted inserted replaced
774:820863425158 775:c5077fdab490
590 st[s->streams[1]->id] = s->streams[1]; 590 st[s->streams[1]->id] = s->streams[1];
591 591
592 if (vsize/* && st[NSV_ST_VIDEO]*/) { 592 if (vsize/* && st[NSV_ST_VIDEO]*/) {
593 nst = st[NSV_ST_VIDEO]->priv_data; 593 nst = st[NSV_ST_VIDEO]->priv_data;
594 pkt = &nsv->ahead[NSV_ST_VIDEO]; 594 pkt = &nsv->ahead[NSV_ST_VIDEO];
595 av_new_packet(pkt, vsize); 595 av_get_packet(pb, pkt, vsize);
596 get_buffer(pb, pkt->data, vsize);
597 pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO; 596 pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO;
598 pkt->dts = nst->frame_offset++; 597 pkt->dts = nst->frame_offset++;
599 pkt->flags |= PKT_FLAG_KEY; /* stupid format has no way to tell XXX: try the index */ 598 pkt->flags |= PKT_FLAG_KEY; /* stupid format has no way to tell XXX: try the index */
600 /* 599 /*
601 for (i = 0; i < MIN(8, vsize); i++) 600 for (i = 0; i < MIN(8, vsize); i++)
631 av_set_pts_info(st[NSV_ST_AUDIO], 64, 1, 630 av_set_pts_info(st[NSV_ST_AUDIO], 64, 1,
632 st[NSV_ST_AUDIO]->codec.sample_rate); 631 st[NSV_ST_AUDIO]->codec.sample_rate);
633 PRINT(("NSV RAWAUDIO: bps %d, nchan %d, srate %ld\n", bps, channels, samplerate)); 632 PRINT(("NSV RAWAUDIO: bps %d, nchan %d, srate %ld\n", bps, channels, samplerate));
634 } 633 }
635 } 634 }
636 av_new_packet(pkt, asize); 635 av_get_packet(pb, pkt, asize);
637 if (asize)
638 get_buffer(pb, pkt->data, asize);
639 pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO; 636 pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO;
640 //pkt->dts = nst->frame_offset; 637 //pkt->dts = nst->frame_offset;
641 //if (nst->sample_size) 638 //if (nst->sample_size)
642 // pkt->dts /= nst->sample_size; 639 // pkt->dts /= nst->sample_size;
643 nst->frame_offset += asize; // XXX: that's valid only for PCM !? 640 nst->frame_offset += asize; // XXX: that's valid only for PCM !?