[FFmpeg-devel] [PATCH] attachments support in matroska demuxer
Michael Niedermayer
michaelni
Sun Jan 20 21:39:38 CET 2008
On Sun, Jan 20, 2008 at 06:29:41PM +0000, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
>
> > On Sun, Jan 20, 2008 at 04:43:15PM +0100, Michael Niedermayer wrote:
> >> On Sun, Jan 20, 2008 at 04:26:36PM +0100, Michael Niedermayer wrote:
> >> > (not that mpeg-ps/ts and matroska would set codec_tag correctly ...)
> >>
> >> and if mpeg-ps where setting it, mplayer could use it do identify hddvd/h264
> >> even if our mpeg-ps maintainer chooses to follow the mpeg-1/2 standard of
> >> mapping it to CODEC_ID_MPEGVIDEO
> >
> > anyway, heres a patch to set codec_tag
> >
> > Index: mpeg.c
> > ===================================================================
> > --- mpeg.c (revision 11521)
> > +++ mpeg.c (working copy)
> > @@ -403,7 +403,7 @@
> > {
> > MpegDemuxContext *m = s->priv_data;
> > AVStream *st;
> > - int len, startcode, i, type, codec_id = 0, es_type;
> > + int len, startcode, i, type, codec_id = 0, es_type, codec_tag;
> > int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work
> >
> > redo:
> > @@ -419,7 +419,10 @@
> > }
> >
> > es_type = m->psm_es_type[startcode & 0xff];
> > + if(es_type <= 0)
> > + codec_tag= MPEG_CODEC_TAG_PREFIX + startcode;
> > if(es_type > 0){
> > + codec_tag= MPEG_CODEC_TAG_PREFIX + es_type + 0x200;
> > if(es_type == STREAM_TYPE_VIDEO_MPEG1){
> > codec_id = CODEC_ID_MPEG2VIDEO;
> > type = CODEC_TYPE_VIDEO;
> > @@ -494,6 +497,7 @@
> > goto skip;
> > st->codec->codec_type = type;
> > st->codec->codec_id = codec_id;
> > + st->codec->codec_tag = codec_tag;
> > if (codec_id != CODEC_ID_PCM_S16BE)
> > st->need_parsing = AVSTREAM_PARSE_FULL;
> > found:
> > Index: mpeg.h
> > ===================================================================
> > --- mpeg.h (revision 11520)
> > +++ mpeg.h (working copy)
> > @@ -55,6 +55,8 @@
> > #define STREAM_TYPE_AUDIO_AC3 0x81
> > #define STREAM_TYPE_AUDIO_DTS 0x8a
> >
> > +#define MPEG_CODEC_TAG_PREFIX (('M'<<24) + ('P'<<16))
> > +
> > static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 };
> >
> > /**
>
> Rejected. That makes no sense whatsoever.
>
> You knew I'd say that,
yes
> so why did you even bother with this?
some people have their own forks of lav* ...
btw, how do you plan to deal with hddvd h264?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- 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/20080120/a3651f76/attachment.pgp>
More information about the ffmpeg-devel
mailing list