[MPlayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.137,1.138

D Richard Felker III dalias at aerifal.cx
Tue Dec 7 02:38:05 CET 2004


On Mon, Dec 06, 2004 at 08:15:33PM +0100, Michael Niedermayer wrote:
> Hi
> 
> On Monday 06 December 2004 17:38, D Richard Felker III wrote:
> > On Mon, Dec 06, 2004 at 05:11:19AM +0100, Michael Niedermayer CVS wrote:
> > > CVS change done by Michael Niedermayer CVS
> > >
> > > Update of /cvsroot/mplayer/main/libmpcodecs
> > > In directory mail:/var2/tmp/cvs-serv17497/libmpcodecs
> > >
> > > Modified Files:
> > >  vd_ffmpeg.c
> > > Log Message:
> > > fix byteorder
> > >
> > >
> > > Index: vd_ffmpeg.c
> > > ===================================================================
> > > RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_ffmpeg.c,v
> > > retrieving revision 1.137
> > > retrieving revision 1.138
> > > diff -u -r1.137 -r1.138
> > > --- vd_ffmpeg.c 28 Nov 2004 18:37:49 -0000 1.137
> > > +++ vd_ffmpeg.c 6 Dec 2004 04:11:17 -0000 1.138
> > > @@ -303,9 +303,9 @@
> > >          } else {
> > >       /* has extra slice header (demux_rm or rm->avi streamcopy) */
> > >       unsigned int* extrahdr=(unsigned int*)(sh->bih+1);
> > > -     ((uint32_t*)avctx->extradata)[0] = extrahdr[0];
> > > -     avctx->sub_id=
> > > -     ((uint32_t*)avctx->extradata)[1] = extrahdr[1];
> > > +     ((uint32_t*)avctx->extradata)[0] = be2me_32(extrahdr[0]);
> > > +     avctx->sub_id= extrahdr[1];
> > > +     ((uint32_t*)avctx->extradata)[1] = be2me_32(extrahdr[1]);
> >
> > are you sure this is the best way? 
> 
> no its certainly not
> 
> 
> > imo extradata should be treated as 
> > a block of raw binary data from the file, and libavcodec, not the
> > calling program, should be responsible for knowing and interpreting
> > the byte order... 
> 
> yes, exactly, but mplayers obfuscated rm demuxer byteswaps the data so this 
> only swaps it back to how its stored in the file

rotfl!! sounds like someone is yearning for some cola.. :)
but..could we remove the hack from the demuxer and vd_ffmpeg, and
instead put the opposite hack in the vd file for real binaryloader, if
it's even needed there?

rich




More information about the MPlayer-cvslog mailing list