[MPlayer-dev-eng] Add demux_nut to libmpdemux

Oded Shimon ods15 at ods15.dyndns.org
Fri Sep 15 15:21:55 CEST 2006


On Fri, Sep 15, 2006 at 03:16:02PM +0200, Diego Biurrun wrote:
> On Fri, Sep 15, 2006 at 01:49:17PM +0300, Oded Shimon wrote:
> > Since libnut doesn't really have any installation method, I have nothing 
> > to add to MPlayer's configure.
> 
> So how do you wish to enable this?

Basically I just wanted to move 'mplayer.diff' and 'demux_nut.c' out of 
nut repo, they do not belong there...

> > --- Makefile	(revision 19814)
> > +++ Makefile	(working copy)
> > @@ -110,6 +110,7 @@
> >               $(X264_LIB) \
> >               $(MUSEPACK_LIB) \
> >               $(SPEEX_LIB) \
> > +             $(NUT_LIB) \
> 
> useless clutter

uhh... -lnut is necessary. If I had written a configure part, it would 
have done 'NUT_LIB=-lnut'.. Obviously now this is redundant, but it's a 
placeholder...

> Below is a collection of long lines from demux_nut.c, I'd appreciate if
> you could make them look non-ugly on 80 char terminals.  This makes me
> think that 8 character indentation is excessive...

Good thing you're not in charge of NUT repo :) many lines there are ~150 
chars long...

> > 	if (stream->end_pos < stream_tell(stream)) stream->end_pos = stream_tell(stream);
> > 	if (stream_read(demuxer->stream, buf, ID_LENGTH) != ID_LENGTH) return 0;
> > 		if (ret < 0) mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(-ret));
> > 			WAVEFORMATEX *wf= calloc(sizeof(WAVEFORMATEX) + s[i].codec_specific_len, 1);
> > 			for (j = 0; j < s[i].fourcc_len && j < 4; j++) sh_audio->format |= s[i].fourcc[j]<<(j*8);
> > 			sh_audio->samplerate = s[i].samplerate_nom / s[i].samplerate_denom;
> > 			wf->nSamplesPerSec = s[i].samplerate_nom / s[i].samplerate_denom;
> > 				memcpy(wf + 1, s[i].codec_specific, s[i].codec_specific_len);
> > 			BITMAPINFOHEADER * bih = calloc(sizeof(BITMAPINFOHEADER) + s[i].codec_specific_len, 1);
> > 			sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
> > 			sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
> > 			for (j = 0; j < s[i].fourcc_len && j < 4; j++) sh_video->format |= s[i].fourcc[j]<<(j*8);
> > 			else sh_video->aspect = (float)s[i].sample_width / s[i].sample_height;
> > 			bih->biSize = sizeof(BITMAPINFOHEADER) + s[i].codec_specific_len;
> > 				memcpy(bih + 1, s[i].codec_specific, s[i].codec_specific_len);
> > 		if (ret < 0) { mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(-ret)); continue; }
> > 				mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(-ret));
> > 	pts = (double)pd.pts * priv->s[pd.stream].time_base.nom / priv->s[pd.stream].time_base.den;
> > 				mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(-ret));
> > 			mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(-ret));
> > static void demux_seek_nut(demuxer_t * demuxer, float time_pos, float audio_delay, int flags) {
> > 				(double)priv->s[0].time_base.nom / priv->s[0].time_base.den;
> > 	if (ret < 0) mp_msg(MSGT_HEADER, MSGL_ERR, "NUT error: %s\n", nut_error(-ret));
> > 				(double)priv->s[0].time_base.nom / priv->s[0].time_base.den;
> > 			if (priv->s[0].max_pts == 0) return DEMUXER_CTRL_DONTKNOW;
> > 			*((int *)arg) = priv->last_pts * 100 / (double)priv->s[0].max_pts;

.. I'll see what I can do.

Like I said, I just wanted to move out demux_nut.c from NUT repo, it's not 
exactly production ready.. Though it does work :)

I'll fix the long line stuff and add a configure check...

- ods15



More information about the MPlayer-dev-eng mailing list