[FFmpeg-devel] [PATCH] Read ogg stream language

Michael Niedermayer michaelni
Sun Mar 2 00:03:31 CET 2008


On Sat, Mar 01, 2008 at 09:44:06PM +0000, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:
> 
> > On Thu, Feb 14, 2008 at 03:31:58PM +0100, Reimar D?ffinger wrote:
> >> On Thu, Feb 14, 2008 at 02:06:37PM -0000, M?ns Rullg?rd wrote:
> >> > Reimar D?ffinger wrote:
> >> > > On Thu, Jan 31, 2008 at 11:57:35PM +0100, Reimar D?ffinger wrote:
> >> > >> attached patch makes vorbis_comment (which lacks a ff_ prefix btw) parse
> >> > >> the language tag into AVStream.language (if a mapping is known).
> >> > >> It also adds vorbis comment parsing to oggparseogm.c (I would apply as a
> >> > >> second step).
> >> > >> The code is probably improvable, the mapping list even more so.
> >> > >
> >> > > So is this rejected, should it be done differently or just applied?
> >> > 
> >> > I'd prefer if a mapping of common language names to codes were kept
> >> > outside the ogg demuxer.  It could be useful to someone else.
> >> 
> >> Sure, where? libavformat/utils.c? A new file (seems like overkill)?
> >> ff_ or av_ (i.e. just internal or public)?
> >
> > Updated.
[...]
> >  #endif /* FFMPEG_OGGDEC_H */
> > Index: libavformat/avformat.h
> > ===================================================================
> > --- libavformat/avformat.h	(revision 12287)
> > +++ libavformat/avformat.h	(working copy)
> > @@ -871,6 +871,8 @@
> >                   const char *url,
> >                   int is_output);
> >
> > +void av_lang_str2id(char langid[4], const char *name);
> > +
> >  /**
> >   * parses width and height out of string str.
> >   * @deprecated Use av_parse_video_frame_size instead.

Iam not ok with making this part of the public API, even less so without
any documentation saying what it does.


> > Index: libavformat/utils.c
> > ===================================================================
> > --- libavformat/utils.c	(revision 12287)
> > +++ libavformat/utils.c	(working copy)
> > @@ -2666,6 +2666,22 @@
> >          dump_stream_format(ic, i, index, is_output);
> >  }
> >
> > +static const struct {
> > +    const char langid[4];
> > +    const char * const name;
> 
> Two of those consts are unnecessary since the entire thing is const.
> 
> > +} langmap [] = {
> > +    {"eng", "English"},
> > +    {"und", NULL}
> > +};
> > +
> > +void av_lang_str2id(char langid[4], const char *name) {
> > +    int i;
> > +    for (i = 0; langmap[i].name; i++)
> > +        if (!strcasecmp(name, langmap[i].name))
> 
> Although strcasecmp() is standard, I'm certain some systems will be
> missing it.  Not that I care...
> 
> Someone else will have to OK the inclusion of this in utils.c.

I think it would be better if it were in iso639.c. It would also allow
conditional compilation when ogg isnt enabled.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- 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/20080302/a3e2f221/attachment.pgp>



More information about the ffmpeg-devel mailing list