diff options
author | Måns Rullgård <mans@mansr.com> | 2005-05-11 16:38:34 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2005-05-11 16:38:34 +0000 |
commit | 1ed923eab332bf55fd18603ed7b66432142ded67 (patch) | |
tree | 6ca0084c7625928f7b095cee8e78a9ae4d2c6f19 /libavformat/ogg2.c | |
parent | ef56de328ffc990ee0b411f1ff3d86a25d7d1b98 (diff) | |
download | ffmpeg-1ed923eab332bf55fd18603ed7b66432142ded67.tar.gz |
support theora in ogg, plus required ogg core changes
Originally committed as revision 4217 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ogg2.c')
-rw-r--r-- | libavformat/ogg2.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavformat/ogg2.c b/libavformat/ogg2.c index 89e545eb27..f2f94aa7a3 100644 --- a/libavformat/ogg2.c +++ b/libavformat/ogg2.c @@ -39,6 +39,7 @@ static ogg_codec_t *ogg_codecs[] = { &vorbis_codec, + &theora_codec, NULL }; @@ -425,17 +426,18 @@ ogg_get_headers (AVFormatContext * s) static uint64_t ogg_gptopts (AVFormatContext * s, int i, uint64_t gp) { + 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 (codec->codec_type == CODEC_TYPE_AUDIO){ + 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){ -//FIXME - pts = gp * 1000000LL / codec->sample_rate; -// pts = gp * st->video.frame_rate.den * 27000000LL / -// st->video.frame_rate.num; + pts = gp; } return pts; @@ -534,6 +536,7 @@ ogg_read_close (AVFormatContext * s) for (i = 0; i < ogg->nstreams; i++){ av_free (ogg->streams[i].buf); + av_free (ogg->streams[i].private); av_freep (&s->streams[i]->codec.extradata); } av_free (ogg->streams); |