[MPlayer-dev-eng] Add demux_nut to libmpdemux

Diego Biurrun diego at biurrun.de
Fri Sep 15 15:16:02 CEST 2006


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?

> No objections I'll commit tommorrow...

Not until the issues are solved.

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

useless clutter

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...

Diego

> 	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;




More information about the MPlayer-dev-eng mailing list