[NUT-devel] [nut]: r242 - trunk/libnut/demuxer.c

ods15 subversion at mplayerhq.hu
Sat Nov 18 16:27:55 CET 2006


Author: ods15
Date: Sat Nov 18 16:27:54 2006
New Revision: 242

Modified:
   trunk/libnut/demuxer.c

Log:
placeholder for smart_find_syncpoint(), index based find_syncpoint


Modified: trunk/libnut/demuxer.c
==============================================================================
--- trunk/libnut/demuxer.c	(original)
+++ trunk/libnut/demuxer.c	Sat Nov 18 16:27:54 2006
@@ -837,11 +837,21 @@
 	return err;
 }
 
+static int smart_find_syncpoint(nut_context_t * nut, syncpoint_t * res) {
+	int err = 0;
+	if (!nut->dopts.cache_syncpoints & 1) return find_syncpoint(nut, 0, res, 0);
+
+	return find_syncpoint(nut, 0, res, 0);
+
+err_out:
+	return err;
+}
+
 int nut_read_next_packet(nut_context_t * nut, nut_packet_t * pd) {
 	int err = 0;
 	if (nut->seek_status) { // in error mode!
 		syncpoint_t s;
-		CHECK(find_syncpoint(nut, 0, &s, 0));
+		CHECK(smart_find_syncpoint(nut, &s));
 		nut->i->buf_ptr = get_buf(nut->i, s.pos); // go back to begginning of syncpoint
 		flush_buf(nut->i);
 		clear_dts_cache(nut);
@@ -956,7 +966,7 @@
 		seek_buf(nut->i, 0, SEEK_SET);
 		nut->seek_status = 1;
 	}
-	CHECK(find_syncpoint(nut, 0, &sp, 0));
+	CHECK(smart_find_syncpoint(nut, &sp));
 	CHECK(add_syncpoint(nut, sp, NULL, NULL, NULL));
 	nut->i->buf_ptr = get_buf(nut->i, sp.pos); // rewind to the syncpoint, this is where playback starts...
 	nut->seek_status = 0;
@@ -1098,7 +1108,7 @@
 		nut->seek_status = 1;
 		// find closest syncpoint by linear search, SHOULD be one pointed by back_ptr...
 		buf_before = bctello(nut->i);
-		CHECK(find_syncpoint(nut, 0, &s, 0));
+		CHECK(smart_find_syncpoint(nut, &s));
 		clear_dts_cache(nut);
 		nut->last_syncpoint = 0; // last_key is invalid
 		seek_buf(nut->i, s.pos, SEEK_SET); // go back to syncpoint. This will not need a seek.



More information about the NUT-devel mailing list