Commit 2a62105b authored by michael's avatar michael

export pts if available


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3081 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0984f0bd
......@@ -172,6 +172,7 @@ static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap)
int i;
avfcontext->ctx_flags |= AVFMTCTX_NOHEADER;
av_set_pts_info(avfcontext, 60, 1, AV_TIME_BASE);
ogg_sync_init(&context->oy) ;
buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;
......@@ -218,6 +219,9 @@ static int ogg_read_packet(AVFormatContext *avfcontext, AVPacket *pkt) {
return -EIO ;
pkt->stream_index = 0 ;
memcpy(pkt->data, op.packet, op.bytes);
if(avfcontext->streams[0]->codec.sample_rate && op.granulepos!=-1)
pkt->pts= av_rescale(op.granulepos, AV_TIME_BASE, avfcontext->streams[0]->codec.sample_rate);
// printf("%lld %d %d\n", pkt->pts, (int)op.granulepos, avfcontext->streams[0]->codec.sample_rate);
return op.bytes;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment