[xiph-commits] r3841 - in liboggplay/trunk/src: liboggplay tools
shans at svn.annodex.net
shans at svn.annodex.net
Thu Jan 15 19:47:03 PST 2009
Author: shans
Date: 2009-01-15 19:47:03 -0800 (Thu, 15 Jan 2009)
New Revision: 3841
Modified:
liboggplay/trunk/src/liboggplay/oggplay.c
liboggplay/trunk/src/liboggplay/oggplay_callback_info.c
liboggplay/trunk/src/tools/oggplay-info.c
Log:
fix offset bug and (hopefully) shuddering playback too
Modified: liboggplay/trunk/src/liboggplay/oggplay.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay.c 2009-01-16 00:36:19 UTC (rev 3840)
+++ liboggplay/trunk/src/liboggplay/oggplay.c 2009-01-16 03:47:03 UTC (rev 3841)
@@ -210,7 +210,7 @@
return E_OGGPLAY_BAD_TRACK;
}
- me->decode_data[track]->offset = (offset << 32);
+ me->decode_data[track]->offset = (offset << 32) / 1000;
return E_OGGPLAY_OK;
Modified: liboggplay/trunk/src/liboggplay/oggplay_callback_info.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback_info.c 2009-01-16 00:36:19 UTC (rev 3840)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback_info.c 2009-01-16 03:47:03 UTC (rev 3841)
@@ -48,7 +48,7 @@
int i;
int tcount = 0;
- int added_required_record = 1;
+ int added_required_record = me->num_tracks;
ogg_int64_t diff;
ogg_int64_t latest_first_record = 0x0LL;
//ogg_int64_t lpt = 0;
@@ -79,6 +79,7 @@
track_info->available_records = track_info->required_records = 0;
track_info->records = NULL;
track_info->stream_info = OGGPLAY_STREAM_UNINITIALISED;
+ added_required_record --;
continue;
}
@@ -144,7 +145,6 @@
//lpt = p->presentation_time;
}
}
-
if (track_info->required_records > 0) {
/*
@@ -199,24 +199,30 @@
* needs to be explicitly required (e.g. by seeking or start of movie), and
* create a new member in the player struct called pt_update_valid
*/
+ // TODO: I don't think that pt_update_valid is necessary any more, as this will only
+ // trigger now if there's no data in *ANY* of the tracks. Hence the audio timeslice case
+ // doesn't apply.
if
(
- track->decoded_type != OGGPLAY_CMML
- &&
- track->decoded_type != OGGPLAY_KATE // TODO: check this is the right thing to do
- &&
- track_info->required_records == 0
- &&
- track->active == 1
- &&
- me->pt_update_valid
+ track->decoded_type == OGGPLAY_CMML
+ ||
+ track->decoded_type == OGGPLAY_KATE // TODO: check this is the right thing to do
+ ||
+ (
+ track_info->required_records == 0
+ &&
+ track->active == 1
+ &&
+ me->pt_update_valid
+ )
) {
- added_required_record = 0;
- me->pt_update_valid = 0;
+ added_required_record --;
}
}
+ me->pt_update_valid = 0;
+
//printf("\n");
/*
@@ -397,7 +403,7 @@
}
/* SGS: is this correct? */
- return (header->presentation_time >> 32) & 0xFFFFFFFF;
+ return (((header->presentation_time >> 16) * 1000) >> 16) & 0xFFFFFFFF;
}
OggPlayVideoData *
Modified: liboggplay/trunk/src/tools/oggplay-info.c
===================================================================
--- liboggplay/trunk/src/tools/oggplay-info.c 2009-01-16 00:36:19 UTC (rev 3840)
+++ liboggplay/trunk/src/tools/oggplay-info.c 2009-01-16 03:47:03 UTC (rev 3841)
@@ -70,7 +70,18 @@
overruns[i].histogram[overrun] += 1;
overruns[i].last_overrun = overrun;
+
+ printf("track %d required %d times [", i, required);
+ for (j = 0; j < required; j++) {
+ if (j > 0) {
+ printf(", ");
+ }
+ printf("%ld", oggplay_callback_info_get_presentation_time(headers[j]));
+ }
+ printf("] ");
+
}
+ printf("\n");
n_frames += 1;
More information about the commits
mailing list