Mercurial > libavformat.hg
diff ogg.c @ 462:b69898ffc92a libavformat
move time_base (pts_num/pts_den) from AVFormatContext -> AVStream
author | michael |
---|---|
date | Fri, 21 May 2004 20:43:21 +0000 |
parents | 7fa377b2f533 |
children | 60f897e8dd2d |
line wrap: on
line diff
--- a/ogg.c Thu May 20 16:00:22 2004 +0000 +++ b/ogg.c Fri May 21 20:43:21 2004 +0000 @@ -36,14 +36,14 @@ ogg_packet *op= &context->op; int n, i; - av_set_pts_info(avfcontext, 60, 1, AV_TIME_BASE); - ogg_stream_init(&context->os, 31415); for(n = 0 ; n < avfcontext->nb_streams ; n++) { AVCodecContext *codec = &avfcontext->streams[n]->codec; uint8_t *p= codec->extradata; + av_set_pts_info(avfcontext->streams[n], 60, 1, AV_TIME_BASE); + for(i=0; i < codec->extradata_size; i+= op->bytes){ op->bytes = p[i++]<<8; op->bytes+= p[i++]; @@ -172,7 +172,6 @@ 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) ; @@ -190,6 +189,7 @@ ast = av_new_stream(avfcontext, 0) ; if(!ast) return AVERROR_NOMEM ; + av_set_pts_info(ast, 60, 1, AV_TIME_BASE); codec= &ast->codec; codec->codec_type = CODEC_TYPE_AUDIO;