[NUT-devel] [nut]: r201 - in trunk/libnut: demuxer.c muxer.c priv.h reorder.c
ods15
subversion at mplayerhq.hu
Mon Nov 13 19:29:03 CET 2006
Author: ods15
Date: Mon Nov 13 19:29:02 2006
New Revision: 201
Modified:
trunk/libnut/demuxer.c
trunk/libnut/muxer.c
trunk/libnut/priv.h
trunk/libnut/reorder.c
Log:
removed unused param
Modified: trunk/libnut/demuxer.c
==============================================================================
--- trunk/libnut/demuxer.c (original)
+++ trunk/libnut/demuxer.c Mon Nov 13 19:29:02 2006
@@ -454,7 +454,7 @@
TO_PTS(timestamp, pts)
for (i = 0; i < nut->stream_count; i++) {
- nut->sc[i].last_pts = convert_ts(nut, timestamp_p, nut->tb[timestamp_t], TO_TB(i));
+ nut->sc[i].last_pts = convert_ts(timestamp_p, nut->tb[timestamp_t], TO_TB(i));
}
}
@@ -518,7 +518,7 @@
GET_V(tmp, x);
for (i = 0; i < nut->stream_count; i++) {
TO_PTS(max, x)
- nut->sc[i].sh.max_pts = convert_ts(nut, max_p, nut->tb[max_t], TO_TB(i));
+ nut->sc[i].sh.max_pts = convert_ts(max_p, nut->tb[max_t], TO_TB(i));
}
GET_V(tmp, x);
@@ -669,11 +669,11 @@
// error checking - out of order dts
for (i = 0; i < nut->stream_count; i++) {
if (nut->sc[i].last_dts == -1) continue;
- if (compare_ts(nut, pd->pts, TO_TB(pd->stream), nut->sc[i].last_dts, TO_TB(i)) < 0)
+ if (compare_ts(pd->pts, TO_TB(pd->stream), nut->sc[i].last_dts, TO_TB(i)) < 0)
fprintf(stderr, "%lld %d (%f) %lld %d (%f) \n",
pd->pts, pd->stream, TO_DOUBLE(pd->stream, pd->pts),
nut->sc[i].last_dts, i, TO_DOUBLE(i, nut->sc[i].last_dts));
- ERROR(compare_ts(nut, pd->pts, TO_TB(pd->stream), nut->sc[i].last_dts, TO_TB(i)) < 0, -ERR_OUT_OF_ORDER);
+ ERROR(compare_ts(pd->pts, TO_TB(pd->stream), nut->sc[i].last_dts, TO_TB(i)) < 0, -ERR_OUT_OF_ORDER);
}
if (saw_syncpoint) *saw_syncpoint = !!after_sync;
@@ -1164,7 +1164,7 @@
off_t back_ptr = stopper->pos - stopper->back_ptr;
TO_PTS(stopper, stopper->pts)
// only relavent if pts is smaller than stopper, and we passed stopper's back_ptr
- if (compare_ts(nut, pd.pts, TO_TB(pd.stream), stopper_p, nut->tb[stopper_t]) < 0 && buf_before >= back_ptr) {
+ if (compare_ts(pd.pts, TO_TB(pd.stream), stopper_p, nut->tb[stopper_t]) < 0 && buf_before >= back_ptr) {
if (!stopper_syncpoint) state[pd.stream].good_key = 1;
else if (state[pd.stream].good_key) {
int n = 1;
@@ -1262,7 +1262,7 @@
for (i = 0; i < nut->stream_count; i++) {
uint64_t dts = nut->sc[i].last_dts != -1 ? nut->sc[i].last_dts : nut->sc[i].last_pts;
if (!state[i].active) continue;
- if (compare_ts(nut, orig_pts, nut->tb[orig_timebase], dts, TO_TB(i)) < 0) {
+ if (compare_ts(orig_pts, nut->tb[orig_timebase], dts, TO_TB(i)) < 0) {
orig_pts = dts;
orig_timebase = nut->sc[i].timebase_id;
}
Modified: trunk/libnut/muxer.c
==============================================================================
--- trunk/libnut/muxer.c (original)
+++ trunk/libnut/muxer.c Mon Nov 13 19:29:02 2006
@@ -223,7 +223,7 @@
put_v(tmp, info->stream_id_plus1);
put_s(tmp, info->chapter_id);
- for (i = 0; i < nut->timebase_count; i++) if (compare_ts(nut, 1, info->chapter_tb, 1, nut->tb[i]) == 0) break;
+ for (i = 0; i < nut->timebase_count; i++) if (compare_ts(1, info->chapter_tb, 1, nut->tb[i]) == 0) break;
put_v(tmp, info->chapter_start * nut->timebase_count + i);
put_v(tmp, info->chapter_len);
put_v(tmp, info->count);
@@ -238,7 +238,7 @@
put_s(tmp, field->val);
} else if (!strcmp(field->type, "t")) {
int j;
- for (j = 0; j < nut->timebase_count; j++) if (compare_ts(nut, 1, field->tb, 1, nut->tb[j]) == 0) break;
+ for (j = 0; j < nut->timebase_count; j++) if (compare_ts(1, field->tb, 1, nut->tb[j]) == 0) break;
put_s(tmp, -4);
put_v(tmp, field->val * nut->timebase_count + j);
} else if (!strcmp(field->type, "r")) {
@@ -280,7 +280,7 @@
nut->last_syncpoint = bctello(nut->o);
for (i = 0; i < nut->stream_count; i++) {
- if (nut->sc[i].last_dts > 0 && compare_ts(nut, nut->sc[i].last_dts, TO_TB(i), pts, nut->tb[timebase]) > 0) {
+ if (nut->sc[i].last_dts > 0 && compare_ts(nut->sc[i].last_dts, TO_TB(i), pts, nut->tb[timebase]) > 0) {
pts = nut->sc[i].last_dts;
timebase = nut->sc[i].timebase_id;
}
@@ -307,7 +307,7 @@
for (j = 0; j < nut->stream_count; j++) {
if (keys[j]) continue;
if (!s->pts[i * nut->stream_count + j]) continue;
- if (compare_ts(nut, s->pts[i * nut->stream_count + j] - 1, TO_TB(j), pts, nut->tb[timebase]) <= 0) keys[j] = 1;
+ if (compare_ts(s->pts[i * nut->stream_count + j] - 1, TO_TB(j), pts, nut->tb[timebase]) <= 0) keys[j] = 1;
}
for (j = 0; j < nut->stream_count; j++) n &= keys[j];
if (n) { i--; break; }
@@ -321,7 +321,7 @@
}
for (i = 0; i < nut->stream_count; i++) {
- nut->sc[i].last_pts = convert_ts(nut, pts, nut->tb[timebase], TO_TB(i));
+ nut->sc[i].last_pts = convert_ts(pts, nut->tb[timebase], TO_TB(i));
nut->sc[i].last_key = 0;
if (nut->sc[i].eor) nut->sc[i].eor = -1; // so we know to ignore this stream in future syncpoints
}
@@ -342,7 +342,7 @@
int timebase = 0;
for (i = 0; i < nut->stream_count; i++) {
- if (compare_ts(nut, nut->sc[i].sh.max_pts, TO_TB(i), max_pts, nut->tb[timebase]) > 0) {
+ if (compare_ts(nut->sc[i].sh.max_pts, TO_TB(i), max_pts, nut->tb[timebase]) > 0) {
max_pts = nut->sc[i].sh.max_pts;
timebase = nut->sc[i].timebase_id;
}
@@ -455,7 +455,7 @@
static int add_timebase(nut_context_t * nut, nut_timebase_t tb) {
int i;
- for (i = 0; i < nut->timebase_count; i++) if (compare_ts(nut, 1, nut->tb[i], 1, tb) == 0) break;
+ for (i = 0; i < nut->timebase_count; i++) if (compare_ts(1, nut->tb[i], 1, tb) == 0) break;
if (i == nut->timebase_count) {
nut->tb = nut->alloc->realloc(nut->tb, sizeof(nut_timebase_t) * ++nut->timebase_count);
nut->tb[i] = tb;
@@ -495,11 +495,11 @@
for (i = 0; i < nut->stream_count; i++) {
if (nut->sc[i].last_dts == -1) continue;
- if (compare_ts(nut, fd->pts, TO_TB(fd->stream), nut->sc[i].last_dts, TO_TB(i)) < 0)
+ if (compare_ts(fd->pts, TO_TB(fd->stream), nut->sc[i].last_dts, TO_TB(i)) < 0)
fprintf(stderr, "%lld %d (%f) %lld %d (%f) \n",
fd->pts, fd->stream, TO_DOUBLE(fd->stream, fd->pts),
nut->sc[i].last_dts, i, TO_DOUBLE(i, nut->sc[i].last_dts));
- assert(compare_ts(nut, fd->pts, TO_TB(fd->stream), nut->sc[i].last_dts, TO_TB(i)) >= 0);
+ assert(compare_ts(fd->pts, TO_TB(fd->stream), nut->sc[i].last_dts, TO_TB(i)) >= 0);
}
sc->last_pts = fd->pts;
Modified: trunk/libnut/priv.h
==============================================================================
--- trunk/libnut/priv.h (original)
+++ trunk/libnut/priv.h Mon Nov 13 19:29:02 2006
@@ -188,7 +188,7 @@
return crc;
}
-static inline uint64_t convert_ts(nut_context_t * nut, uint64_t sn, nut_timebase_t from, nut_timebase_t to) {
+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;
d1 = from.den;
@@ -196,9 +196,9 @@
return (ln / d1 * sn + (ln%d1) * sn / d1) / d2;
}
-static inline int compare_ts(nut_context_t * nut, uint64_t a, nut_timebase_t at, uint64_t b, nut_timebase_t bt) {
- if (convert_ts(nut, a, at, bt) < b) return -1;
- if (convert_ts(nut, b, bt, at) < a) return 1;
+static inline int compare_ts(uint64_t a, nut_timebase_t at, uint64_t b, nut_timebase_t bt) {
+ if (convert_ts(a, at, bt) < b) return -1;
+ if (convert_ts(b, bt, at) < a) return 1;
return 0;
}
Modified: trunk/libnut/reorder.c
==============================================================================
--- trunk/libnut/reorder.c (original)
+++ trunk/libnut/reorder.c Mon Nov 13 19:29:02 2006
@@ -41,7 +41,7 @@
else pts = nut->sc[j].next_pts;
if (pts >= 0) {
- pts = convert_ts(nut, pts, TO_TB(j), TO_TB(i));
+ pts = convert_ts(pts, TO_TB(j), TO_TB(i));
if (min > pts || min == -1) min = pts;
}
}
More information about the NUT-devel
mailing list