[gst-devel] Re: [gst-cvs] thomasvs gst-plugins: gst-plugins/ gst-plugins/ext/mad/

Thomas Vander Stichele thomas at apestaart.org
Thu Apr 8 02:25:11 CEST 2004

> On Wed, 7 Apr 2004, Thomas Vander Stichele wrote:
> > Log message:
> > do not change caps in middle of stream except on new streams
> > fixes #139382
> That is legal, the patch is wrong.

Are you *very* sure ? I don't want to argue with someone that knows more
about MPEG than me :) But afaict from the ISO MPEG-audio spec there are
only a few things that can change from header to header.  Among these
are the padding bit and the bitrate.  But neither the sample rate index
nor the channel index are allowed to change *within one consecutive
stream* (ie. think one file).

Note that the patch intends to only allow changes after new stream

Anyways, I'll reread the spec again this week, and check back with you. 
But unless the rules are more lax for when MPEG-audio is encoded in a
system stream, I'm pretty sure this is not ok.

>  Like I said before on bugzilla or IRC
> (forgot...), we need to resync only after having met at least several
> valid mpeg audio frame headers in a row, just like in the typefind
> function.

Two in a row with valid headers should be enough.  Don't forget that
this adds latency.  There is probably some improvement that could be
done in avidemux too instead of just jumping anywhere in the mpeg audio
stream - the point of synchronization in mpeg audio is decreasing the
chance of feeding the wrong data, or reducing the cases where you
deliberately lose sync.

> Please keep the bug open. This patch might actually be a nice quickfix
> (since most mpeg audio streams don't change properties halfway the
> stream), but it is still wrong and should eventually be replaced with the
> right fix.

Ok, reopen the bug.  I'll doublecheck if I was wrong, but even if I am I
prefer the fix in as it significantly reduces the playback error on
legal files :)


Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
We'll walk right up to the sun
hand in hand
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/

More information about the gstreamer-devel mailing list