[NUT-devel] [nut]: r272 - in trunk: libnut/demuxer.c libnut/libnut.h libnut/muxer.c libnut/priv.h nututils/demux_avi.c nututils/framer_vorbis.c

ods15 subversion at mplayerhq.hu
Sat Dec 23 13:33:02 CET 2006


Author: ods15
Date: Sat Dec 23 13:33:00 2006
New Revision: 272

Modified:
   trunk/libnut/demuxer.c
   trunk/libnut/libnut.h
   trunk/libnut/muxer.c
   trunk/libnut/priv.h
   trunk/nututils/demux_avi.c
   trunk/nututils/framer_vorbis.c

Log:
sync to spec :), nom->num


Modified: trunk/libnut/demuxer.c
==============================================================================
--- trunk/libnut/demuxer.c	(original)
+++ trunk/libnut/demuxer.c	Sat Dec 23 13:33:00 2006
@@ -265,7 +265,7 @@
 	nut->tb = nut->alloc->malloc(nut->timebase_count * sizeof(nut_timebase_t));
 	ERROR(!nut->tb, NUT_ERR_OUT_OF_MEM);
 	for (i = 0; i < nut->timebase_count; i++) {
-		GET_V(tmp, nut->tb[i].nom);
+		GET_V(tmp, nut->tb[i].num);
 		GET_V(tmp, nut->tb[i].den);
 	}
 
@@ -335,7 +335,7 @@
 			GET_V(tmp, sc->sh.colorspace_type);
 			break;
 		case NUT_AUDIO_CLASS:
-			GET_V(tmp, sc->sh.samplerate_nom);
+			GET_V(tmp, sc->sh.samplerate_num);
 			GET_V(tmp, sc->sh.samplerate_denom);
 			GET_V(tmp, sc->sh.channel_count);
 			break;
@@ -1163,7 +1163,7 @@
 	uint64_t timebases[nut->timebase_count];
 	syncpoint_list_t * sl = &nut->syncpoints;
 	int a = 0;
-	for (i = 0; i < nut->timebase_count; i++) timebases[i] = (uint64_t)(time_pos / nut->tb[i].nom * nut->tb[i].den);
+	for (i = 0; i < nut->timebase_count; i++) timebases[i] = (uint64_t)(time_pos / nut->tb[i].num * nut->tb[i].den);
 	assert(sl->len); // it is impossible for the first syncpoint to not have been read
 
 	// find last syncpoint if it's not already found
@@ -1419,7 +1419,7 @@
 		}
 		if (time_pos < 0.) time_pos = 0.;
 
-		for (i = 0; i < nut->stream_count; i++) nut->sc[i].state.pts = (uint64_t)(time_pos / TO_TB(i).nom * TO_TB(i).den);
+		for (i = 0; i < nut->stream_count; i++) nut->sc[i].state.pts = (uint64_t)(time_pos / TO_TB(i).num * TO_TB(i).den);
 		nut->seek_time_pos = time_pos;
 		nut->dopts.cache_syncpoints |= 2;
 		flush_syncpoint_queue(nut);

Modified: trunk/libnut/libnut.h
==============================================================================
--- trunk/libnut/libnut.h	(original)
+++ trunk/libnut/libnut.h	Sat Dec 23 13:33:00 2006
@@ -37,7 +37,7 @@
 
 /// Timebase struct \ingroup demuxer muxer
 typedef struct {
-	int nom; ///< Example: 1001
+	int num; ///< Example: 1001
 	int den; ///< Example: 24000
 } nut_timebase_t;
 
@@ -63,7 +63,7 @@
 
 	/// \name audio
 	/// Only used if type is #NUT_AUDIO_CLASS @{
-	int samplerate_nom;       ///< Sample rate of audio. Example: 44100
+	int samplerate_num;       ///< Sample rate of audio. Example: 44100
 	int samplerate_denom;     ///< Sample rate denominator of audio. Example: 1
 	int channel_count;        ///< Amount of audio channels
 } nut_stream_header_t;

Modified: trunk/libnut/muxer.c
==============================================================================
--- trunk/libnut/muxer.c	(original)
+++ trunk/libnut/muxer.c	Sat Dec 23 13:33:00 2006
@@ -147,7 +147,7 @@
 	put_v(tmp, nut->max_distance);
 	put_v(tmp, nut->timebase_count);
 	for (i = 0; i < nut->timebase_count; i++) {
-		put_v(tmp, nut->tb[i].nom);
+		put_v(tmp, nut->tb[i].num);
 		put_v(tmp, nut->tb[i].den);
 	}
 	for (i = 0; i < 256; ) {
@@ -208,7 +208,7 @@
 			put_v(tmp, sc->sh.colorspace_type);
 			break;
 		case NUT_AUDIO_CLASS:
-			put_v(tmp, sc->sh.samplerate_nom);
+			put_v(tmp, sc->sh.samplerate_num);
 			put_v(tmp, sc->sh.samplerate_denom);
 			put_v(tmp, sc->sh.channel_count);
 			break;
@@ -598,7 +598,7 @@
 		nut->sc[i].last_pts = 0;
 		nut->sc[i].last_dts = -1;
 		nut->sc[i].msb_pts_shift = 7; // TODO
-		nut->sc[i].max_pts_distance = (s[i].time_base.den + s[i].time_base.nom - 1) / s[i].time_base.nom; // TODO
+		nut->sc[i].max_pts_distance = (s[i].time_base.den + s[i].time_base.num - 1) / s[i].time_base.num; // TODO
 		nut->sc[i].eor = 0;
 		nut->sc[i].sh = s[i];
 		nut->sc[i].sh.max_pts = 0;
@@ -651,8 +651,8 @@
 	}
 
 	for (i = 0; i < nut->timebase_count; i++) {
-		int t = gcd(nut->tb[i].nom, nut->tb[i].den);
-		nut->tb[i].nom /= t;
+		int t = gcd(nut->tb[i].num, nut->tb[i].den);
+		nut->tb[i].num /= t;
 		nut->tb[i].den /= t;
 	}
 

Modified: trunk/libnut/priv.h
==============================================================================
--- trunk/libnut/priv.h	(original)
+++ trunk/libnut/priv.h	Sat Dec 23 13:33:00 2006
@@ -185,9 +185,9 @@
 
 static inline uint64_t convert_ts(uint64_t sn, nut_timebase_t from, nut_timebase_t to) {
 	uint64_t ln, d1, d2;
-	ln = (uint64_t)from.nom * to.den;
+	ln = (uint64_t)from.num * to.den;
 	d1 = from.den;
-	d2 = to.nom;
+	d2 = to.num;
 	return (ln / d1 * sn + (ln%d1) * sn / d1) / d2;
 }
 
@@ -228,9 +228,9 @@
 	int prefix##_t = (pts) % nut->timebase_count; \
 	uint64_t prefix##_p = (pts) / nut->timebase_count;
 
-#define TO_DOUBLE(t, pts) ((double)(pts) / nut->tb[t].den * nut->tb[t].nom)
+#define TO_DOUBLE(t, pts) ((double)(pts) / nut->tb[t].den * nut->tb[t].num)
 
-#define TO_DOUBLE_PTS(pts) ((double)((pts) / nut->timebase_count) / nut->tb[(pts) % nut->timebase_count].den * nut->tb[(pts) % nut->timebase_count].nom)
+#define TO_DOUBLE_PTS(pts) ((double)((pts) / nut->timebase_count) / nut->tb[(pts) % nut->timebase_count].den * nut->tb[(pts) % nut->timebase_count].num)
 
 #define TO_TB(i) nut->tb[nut->sc[i].timebase_id]
 

Modified: trunk/nututils/demux_avi.c
==============================================================================
--- trunk/nututils/demux_avi.c	(original)
+++ trunk/nututils/demux_avi.c	Sat Dec 23 13:33:00 2006
@@ -362,7 +362,7 @@
 
 		avi->s[i].sh.type = avi->stream[i].type;
 		avi->s[i].sh.time_base.den = avi->stream[i].strh->dwRate;
-		avi->s[i].sh.time_base.nom = avi->stream[i].strh->dwScale;
+		avi->s[i].sh.time_base.num = avi->stream[i].strh->dwScale;
 		avi->s[i].sh.fixed_fps = 1;
 		avi->s[i].sh.codec_specific_len = avi->stream[i].extra_len;
 		avi->s[i].sh.codec_specific = avi->stream[i].extra;
@@ -385,7 +385,7 @@
 
 			avi->s[i].sh.codec_specific_len = 0;
 
-			avi->s[i].sh.samplerate_nom = avi->stream[i].audio->nSamplesPerSec;
+			avi->s[i].sh.samplerate_num = avi->stream[i].audio->nSamplesPerSec;
 			avi->s[i].sh.samplerate_denom = 1;
 			avi->s[i].sh.channel_count = avi->stream[i].audio->nChannels;
 		}

Modified: trunk/nututils/framer_vorbis.c
==============================================================================
--- trunk/nututils/framer_vorbis.c	(original)
+++ trunk/nututils/framer_vorbis.c	Sat Dec 23 13:33:00 2006
@@ -103,12 +103,12 @@
 	s->fourcc_len = 4;
 	s->fourcc = (uint8_t*)"vrbs";
 	s->time_base.den = sample_rate / gcd(sample_rate, i);
-	s->time_base.nom = i / gcd(sample_rate, i);
+	s->time_base.num = i / gcd(sample_rate, i);
 	s->fixed_fps = 0;
 	s->decode_delay = 0;
 	s->codec_specific_len = codec_specific_len;
 	s->codec_specific = vc->codec_specific;
-	s->samplerate_nom = sample_rate;
+	s->samplerate_num = sample_rate;
 	s->samplerate_denom = 1;
 	s->channel_count = channels;
 



More information about the NUT-devel mailing list