[Ffmpeg-cvslog] CVS: ffmpeg/libavformat ogg2.c, 1.14, 1.15 oggparseflac.c, 1.4, 1.5 oggparseogm.c, 1.1, 1.2 oggparsetheora.c, 1.6, 1.7 oggparsevorbis.c, 1.5, 1.6

Måns Rullgård CVS mru
Fri May 12 02:50:45 CEST 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv8771

Modified Files:
	ogg2.c oggparseflac.c oggparseogm.c oggparsetheora.c 
	oggparsevorbis.c 
Log Message:
set stream time_base properly


Index: ogg2.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/ogg2.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ogg2.c	11 May 2006 23:07:22 -0000	1.14
+++ ogg2.c	12 May 2006 00:50:43 -0000	1.15
@@ -432,15 +432,11 @@
 {
     ogg_t *ogg = s->priv_data;
     ogg_stream_t *os = ogg->streams + i;
-    AVStream *st = s->streams[i];
-    AVCodecContext *codec = st->codec;
     uint64_t pts = AV_NOPTS_VALUE;
 
     if(os->codec->gptopts){
         pts = os->codec->gptopts(s, i, gp);
-    } else if (codec->codec_type == CODEC_TYPE_AUDIO){
-        pts = gp * 1000000LL / codec->sample_rate;
-    }else if (codec->codec_type == CODEC_TYPE_VIDEO){
+    } else {
         pts = gp;
     }
 

Index: oggparseflac.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/oggparseflac.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- oggparseflac.c	12 Jan 2006 22:43:25 -0000	1.4
+++ oggparseflac.c	12 May 2006 00:50:43 -0000	1.5
@@ -63,6 +63,9 @@
         memcpy (st->codec->extradata, os->buf + os->pstart + 5 + 4 + 4 + 4,
                 FLAC_STREAMINFO_SIZE);
         st->codec->extradata_size = FLAC_STREAMINFO_SIZE;
+
+        st->time_base.num = 1;
+        st->time_base.den = st->codec->sample_rate;
     } else if (mdt == 4) {
         vorbis_comment (s, os->buf + os->pstart + 4, os->psize - 4);
     }

Index: oggparseogm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/oggparseogm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- oggparseogm.c	11 May 2006 23:07:22 -0000	1.1
+++ oggparseogm.c	12 May 2006 00:50:43 -0000	1.2
@@ -48,9 +48,12 @@
     p++;
 
     if(*p == 'v'){
+        int tag;
         st->codec->codec_type = CODEC_TYPE_VIDEO;
         p += 8;
-        st->codec->codec_id = codec_get_bmp_id(le2me_32(unaligned32(p)));
+        tag = le2me_32(unaligned32(p));
+        st->codec->codec_id = codec_get_bmp_id(tag);
+        st->codec->codec_tag = tag;
     } else {
         int cid;
         st->codec->codec_type = CODEC_TYPE_AUDIO;
@@ -85,6 +88,8 @@
         p += 2;                 /* block_align */
         st->codec->bit_rate = le2me_32(unaligned32(p)) * 8;
         st->codec->sample_rate = spu * 10000000 / time_unit;
+        st->time_base.num = 1;
+        st->time_base.den = st->codec->sample_rate;
     }
 
     return 1;

Index: oggparsetheora.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/oggparsetheora.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- oggparsetheora.c	22 Feb 2006 00:18:12 -0000	1.6
+++ oggparsetheora.c	12 May 2006 00:50:43 -0000	1.7
@@ -79,6 +79,7 @@
             skip_bits(&gb, 64);
         st->codec->time_base.den = get_bits(&gb, 32);
         st->codec->time_base.num = get_bits(&gb, 32);
+        st->time_base = st->codec->time_base;
 
         st->codec->sample_aspect_ratio.num = get_bits(&gb, 24);
         st->codec->sample_aspect_ratio.den = get_bits(&gb, 24);
@@ -111,15 +112,13 @@
 static uint64_t
 theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp)
 {
-    AVStream *st = ctx->streams[idx];
     ogg_t *ogg = ctx->priv_data;
     ogg_stream_t *os = ogg->streams + idx;
     theora_params_t *thp = os->private;
     uint64_t iframe = gp >> thp->gpshift;
     uint64_t pframe = gp & thp->gpmask;
 
-    return (iframe + pframe) * AV_TIME_BASE * st->codec->time_base.num /
-        st->codec->time_base.den;
+    return iframe + pframe;
 }
 
 ogg_codec_t theora_codec = {

Index: oggparsevorbis.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/oggparsevorbis.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- oggparsevorbis.c	17 Dec 2005 18:14:37 -0000	1.5
+++ oggparsevorbis.c	12 May 2006 00:50:43 -0000	1.6
@@ -186,6 +186,8 @@
         st->codec->codec_type = CODEC_TYPE_AUDIO;
         st->codec->codec_id = CODEC_ID_VORBIS;
 
+        st->time_base.num = 1;
+        st->time_base.den = st->codec->sample_rate;
     } else if (os->buf[os->pstart] == 3) {
         vorbis_comment (s, os->buf + os->pstart + 7, os->psize - 8);
     } else {





More information about the ffmpeg-cvslog mailing list