diff ogg.c @ 468:60f897e8dd2d libavformat

pass AVPacket into av_write_frame() fixes the random dts/pts during encoding asf preroll fix no more initial zero frames for b frame encoding mpeg-es dts during demuxing fixed .ffm timestamp scale fixed, ffm is still broken though
author michael
date Sat, 29 May 2004 02:06:32 +0000
parents b69898ffc92a
children 0fdc96c2f2fe
line wrap: on
line diff
--- a/ogg.c	Tue May 25 23:06:00 2004 +0000
+++ b/ogg.c	Sat May 29 02:06:32 2004 +0000
@@ -62,16 +62,15 @@
     return 0 ;
 }
 
-static int ogg_write_packet(AVFormatContext *avfcontext,
-			    int stream_index,
-			    const uint8_t *buf, int size, int64_t pts)
+static int ogg_write_packet(AVFormatContext *avfcontext, AVPacket *pkt)
 {
     OggContext *context = avfcontext->priv_data ;
-    AVCodecContext *avctx= &avfcontext->streams[stream_index]->codec;
+    AVCodecContext *avctx= &avfcontext->streams[pkt->stream_index]->codec;
     ogg_packet *op= &context->op;
     ogg_page og ;
+    int64_t pts;
 
-    pts= av_rescale(pts, avctx->sample_rate, AV_TIME_BASE);
+    pts= av_rescale(pkt->pts, avctx->sample_rate, AV_TIME_BASE);
 
 //    av_log(avfcontext, AV_LOG_DEBUG, "M%d\n", size);
 
@@ -86,8 +85,8 @@
 	context->header_handled = 1 ;
     }
 
-    op->packet = (uint8_t*) buf;
-    op->bytes  = size;
+    op->packet = (uint8_t*) pkt->data;
+    op->bytes  = pkt->size;
     op->b_o_s  = op->packetno == 0;
     op->granulepos= pts;