"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavformat/nsvdec.c" between
libav-12.tar.gz and libav-12.1.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

nsvdec.c  (libav-12):nsvdec.c  (libav-12.1)
skipping to change at line 539 skipping to change at line 539
NSVContext *nsv = s->priv_data; NSVContext *nsv = s->priv_data;
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
AVStream *st[2] = {NULL, NULL}; AVStream *st[2] = {NULL, NULL};
NSVStream *nst; NSVStream *nst;
AVPacket *pkt; AVPacket *pkt;
int i, err = 0; int i, err = 0;
uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */ uint8_t auxcount; /* number of aux metadata, also 4 bits of vsize */
uint32_t vsize; uint32_t vsize;
uint16_t asize; uint16_t asize;
uint16_t auxsize; uint16_t auxsize;
int ret;
av_log(s, AV_LOG_TRACE, "%s(%d)\n", __FUNCTION__, fill_header); av_log(s, AV_LOG_TRACE, "%s(%d)\n", __FUNCTION__, fill_header);
if (nsv->ahead[0].data || nsv->ahead[1].data) if (nsv->ahead[0].data || nsv->ahead[1].data)
return 0; //-1; /* hey! eat what you've in your plate first! */ return 0; //-1; /* hey! eat what you've in your plate first! */
null_chunk_retry: null_chunk_retry:
if (pb->eof_reached) if (pb->eof_reached)
return -1; return -1;
skipping to change at line 597 skipping to change at line 598
/* map back streams to v,a */ /* map back streams to v,a */
if (s->nb_streams > 0) if (s->nb_streams > 0)
st[s->streams[0]->id] = s->streams[0]; st[s->streams[0]->id] = s->streams[0];
if (s->nb_streams > 1) if (s->nb_streams > 1)
st[s->streams[1]->id] = s->streams[1]; st[s->streams[1]->id] = s->streams[1];
if (vsize && st[NSV_ST_VIDEO]) { if (vsize && st[NSV_ST_VIDEO]) {
nst = st[NSV_ST_VIDEO]->priv_data; nst = st[NSV_ST_VIDEO]->priv_data;
pkt = &nsv->ahead[NSV_ST_VIDEO]; pkt = &nsv->ahead[NSV_ST_VIDEO];
av_get_packet(pb, pkt, vsize); if ((ret = av_get_packet(pb, pkt, vsize)) < 0)
return ret;
pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO; pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO;
pkt->dts = nst->frame_offset; pkt->dts = nst->frame_offset;
pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
for (i = 0; i < FFMIN(8, vsize); i++) for (i = 0; i < FFMIN(8, vsize); i++)
av_log(s, AV_LOG_TRACE, "NSV video: [%d] = %02x\n", i, pkt->data[i]) ; av_log(s, AV_LOG_TRACE, "NSV video: [%d] = %02x\n", i, pkt->data[i]) ;
} }
if(st[NSV_ST_VIDEO]) if(st[NSV_ST_VIDEO])
((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset++; ((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset++;
if (asize && st[NSV_ST_AUDIO]) { if (asize && st[NSV_ST_AUDIO]) {
skipping to change at line 638 skipping to change at line 640
bps /= channels; // ??? bps /= channels; // ???
if (bps == 8) if (bps == 8)
st[NSV_ST_AUDIO]->codecpar->codec_id = AV_CODEC_ID_PCM_U8; st[NSV_ST_AUDIO]->codecpar->codec_id = AV_CODEC_ID_PCM_U8;
samplerate /= 4;/* UGH ??? XXX */ samplerate /= 4;/* UGH ??? XXX */
channels = 1; channels = 1;
st[NSV_ST_AUDIO]->codecpar->channels = channels; st[NSV_ST_AUDIO]->codecpar->channels = channels;
st[NSV_ST_AUDIO]->codecpar->sample_rate = samplerate; st[NSV_ST_AUDIO]->codecpar->sample_rate = samplerate;
av_log(s, AV_LOG_TRACE, "NSV RAWAUDIO: bps %d, nchan %d, srate % d\n", bps, channels, samplerate); av_log(s, AV_LOG_TRACE, "NSV RAWAUDIO: bps %d, nchan %d, srate % d\n", bps, channels, samplerate);
} }
} }
av_get_packet(pb, pkt, asize); if ((ret = av_get_packet(pb, pkt, asize)) < 0)
return ret;
pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO; pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO;
pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) { if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) {
/* on a nsvs frame we have new information on a/v sync */ /* on a nsvs frame we have new information on a/v sync */
pkt->dts = (((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset- 1); pkt->dts = (((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset- 1);
pkt->dts *= (int64_t)1000 * nsv->framerate.den; pkt->dts *= (int64_t)1000 * nsv->framerate.den;
pkt->dts += (int64_t)nsv->avsync * nsv->framerate.num; pkt->dts += (int64_t)nsv->avsync * nsv->framerate.num;
av_log(s, AV_LOG_TRACE, "NSV AUDIO: sync:%d, dts:%"PRId64, nsv->avsy nc, pkt->dts); av_log(s, AV_LOG_TRACE, "NSV AUDIO: sync:%d, dts:%"PRId64, nsv->avsy nc, pkt->dts);
} }
nst->frame_offset++; nst->frame_offset++;
 End of changes. 3 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS