[FFmpeg-devel] [PATCH] RealMedia muxer: support audio codecs other than AC-3
Michael Niedermayer
michaelni
Sat May 8 19:14:53 CEST 2010
On Sat, May 08, 2010 at 09:15:30AM +0200, Francesco Lavra wrote:
> On Mon, 2010-05-03 at 18:39 +0200, Michael Niedermayer wrote:
> > On Mon, May 03, 2010 at 03:47:12PM +0100, M?ns Rullg?rd wrote:
> > > "Ronald S. Bultje" <rsbultje at gmail.com> writes:
> [...]
> > > > I'm OK with doing it if codec_id is unset (CODEC_ID_NONE). In any
> > > > other case, codec_tag should be ignored (imo) and if codec_id is not
> > > > in our table, we should error out. This way, we force ourselves to add
> > > > the *correct* tag for each codec_id, rather than taking the AVI fourcc
> > > > and probably ending up creating files only mplayer can playback.
> > >
> > > +1
> >
> > this breaks stream copy of old xvid and some mpeg4 variants like XVIX
> > and ump4
> > iam thus not in favor of it
> > what you 2 can do if you like to improve the situation is to implement the
> > FIXME below from libavformat/utils.c
> >
> > if(s->oformat->codec_tag){
> > if(st->codec->codec_tag){
> > //FIXME
> > //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 < ?
> > }else
> > st->codec->codec_tag= av_codec_get_tag(s->oformat->codec_tag, st->codec->codec_id);
> > }
> >
> > I understand you want to fail in a broader set of cases and iam not
> > even saying iam neccessarily against that but i think we first should
> > implement the cases we agree about. Once thats done we can discuss
> > the remaining cases
>
> I'm not Ronald nor Mans, but I think the attached does what you ask for.
> I chose strict < normal as the last condition, hope that's fine.
>
> utils.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
> 6e0962390aa3c5c4a1d7182b084b5602bf7112c9 utils.patch
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c (revision 23056)
> +++ libavformat/utils.c (working copy)
> @@ -2616,14 +2616,27 @@
> }
>
> if(s->oformat->codec_tag){
> + unsigned int tag = av_codec_get_tag(s->oformat->codec_tag,
> + st->codec->codec_id);
> +
> if(st->codec->codec_tag){
> - //FIXME
> //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 < ?
> + //if id is in the table with another tag -> FAIL unless strict < normal
> + enum CodecID id = av_codec_get_id(s->oformat->codec_tag,
> + st->codec->codec_tag);
the list is not 1:1 but n:n
one codec id can have multiple tags (ex: xvid/divx)
and one codec tag can have multiple ids (ex mpeg1/mpeg2)
you must check the values against the list
also dont forget to test your code against the regression tests & fate
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- 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/20100508/4937490b/attachment.pgp>
More information about the ffmpeg-devel
mailing list