[FFmpeg-devel] [PATCH] issue251, xvid within .ogm will not remux to .avi try2
Måns Rullgård
mans
Wed Jun 25 13:44:59 CEST 2008
Michael Niedermayer wrote:
> Hi
>
> This patch fixes "according to spec" timestamp association for theora
> it also as a sideeffect fixes the file from issue 251
>
> quote of the theora spec: (A.2.2)
> Frame data pages MUST be marked with a granule index corresponding to
> the display time of the last frame/packet that finishes in that page.
>
> Note ive not tested this extensively, i thought our users can do this better
>
> Ill apply this in a few days if i hear no objections
>
>
> Index: libavformat/oggdec.c
> ===================================================================
> --- libavformat/oggdec.c (revision 13799)
> +++ libavformat/oggdec.c (working copy)
> @@ -523,11 +523,25 @@
> return AVERROR(EIO);
> pkt->stream_index = idx;
> memcpy (pkt->data, os->buf + pstart, psize);
> + if (s->streams[idx]->codec->codec_id == CODEC_ID_VORBIS){
> if (os->lastgp != -1LL){
> pkt->pts = ogg_gptopts (s, idx, os->lastgp);
> os->lastgp = -1;
> }
> + }else{
> + int segp= os->segp;
> + int nsegs=os->nsegs;
> + while (segp < nsegs){
> + if (os->segments[segp] < 255)
> + break;
> + segp++;
> + }
>
> + if (segp == nsegs && os->granule != -1LL){
> + pkt->pts = ogg_gptopts (s, idx, os->granule);
> + }
> + }
> +
> pkt->flags = os->pflags;
Can you please explain a little more why this change is needed, and
why it doesn't apply to Vorbis?
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list