[FFmpeg-devel] [PATCH] RealMedia muxer: support audio codecs other than AC-3
Michael Niedermayer
michaelni
Tue May 18 21:07:09 CEST 2010
On Tue, May 18, 2010 at 08:47:56PM +0200, Francesco Lavra wrote:
> On Sun, 2010-05-16 at 20:35 +0200, Michael Niedermayer wrote:
> > [...]
> > > utils.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
> > > 1 file changed, 47 insertions(+), 5 deletions(-)
> > > 8014f5fbe7be074ec4046ac3a5bca8628b1bef3c B_utils.patch
> > > Index: libavformat/utils.c
> > > ===================================================================
> > > --- libavformat/utils.c (revision 23141)
> > > +++ libavformat/utils.c (working copy)
> > > @@ -2575,6 +2575,47 @@
> > > return 0;
> > > }
> > >
> > > +static int validate_codec_tag(AVFormatContext *s, AVStream *st)
> > > +{
> > > + const AVCodecTag *avctag;
> > > + int n;
> > > + enum CodecID id = CODEC_ID_NONE;
> > > + unsigned int tag = 0;
> > > +
> > > + /**
> > > + * Check that tag + id is in the table
> > > + * If neither is in the table -> OK
> > > + * If tag is in the table with another id -> FAIL
> > > + * If id is in the table with another tag -> FAIL unless strict < normal
> > > + */
> > > + for (n = 0; s->oformat->codec_tag[n]; n++) {
> > > + avctag = s->oformat->codec_tag[n];
> > > + while (avctag->id != CODEC_ID_NONE) {
> >
> > > + if ((avctag->tag == st->codec->codec_tag) ||
> >
> > redundant
>
> Removed.
>
> > > + ((toupper((avctag->tag >> 0) & 0xFF) ==
> > > + toupper((st->codec->codec_tag >> 0) & 0xFF)) &&
> > > + (toupper((avctag->tag >> 8) & 0xFF) ==
> > > + toupper((st->codec->codec_tag >> 8) & 0xFF)) &&
> > > + (toupper((avctag->tag >> 16) & 0xFF) ==
> > > + toupper((st->codec->codec_tag >> 16) & 0xFF)) &&
> > > + (toupper((avctag->tag >> 24) & 0xFF) ==
> > > + toupper((st->codec->codec_tag >> 24) & 0xFF)))) {
> >
> > ff_toupper4(unsigned int x)
> > {
> > return toupper( x &0xFF)
> > + (toupper((x>>8 )&0xFF)<<8 )
> > + (toupper((x>>16)&0xFF)<<16)
> > + (toupper((x>>24)&0xFF)<<24);
> > }
> >
> > this could also be used in MPV_common_init()
>
> ff_toupper4.patch adds ff_toupper4() to libavcodec/utils.c and changes
> MPV_common_init() and ff_codec_get_id() to use the new function;
> B_utils.patch adds validate_codec_tag(), which also uses ff_toupper4().
> The patches have been tested against regression tests and FATE.
>
> libavcodec/internal.h | 2 ++
> libavcodec/mpegvideo.c | 11 +++--------
> libavcodec/utils.c | 8 ++++++++
> libavformat/utils.c | 6 ++----
> 4 files changed, 15 insertions(+), 12 deletions(-)
> f34df3b6f153833009f0c77688415ea1e0c4c5e4 ff_toupper4.patch
ok
[...]
> utils.c | 44 +++++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 39 insertions(+), 5 deletions(-)
> 82991bd9a84fc69ec4c94d75f200dc9d2c55b680 B_utils.patch
ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100518/0a9894c1/attachment.pgp>
More information about the ffmpeg-devel
mailing list