summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2010-01-14 22:17:53 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2010-01-14 22:17:53 +0000
commite113a8c5cf67e9692e28d31a6672697e32311123 (patch)
treef1bdbba0abe6116f68df3a4cb1a98fc25091a82b
parent9ba5fcd6a1b4330a443239c0ef4fb5ac21009e60 (diff)
downloadxine-lib-e113a8c5cf67e9692e28d31a6672697e32311123.tar.gz
xine-lib-e113a8c5cf67e9692e28d31a6672697e32311123.tar.bz2
Backed out changeset fd48f5a5841d (discontinuity handling for short streams + gapless).
-rw-r--r--src/xine-engine/metronom.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 5bf6495a2..5d3e0a12d 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -305,8 +305,6 @@ static void metronom_handle_discontinuity (metronom_t *this, int type,
/* video_vpts and audio_vpts adjustements */
cur_time = this->xine->clock->get_current_time(this->xine->clock);
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "current time : %" PRId64 "\n", cur_time);
switch (type) {
case DISC_STREAMSTART:
@@ -323,12 +321,33 @@ static void metronom_handle_discontinuity (metronom_t *this, int type,
case DISC_ABSOLUTE:
case DISC_RELATIVE:
- if (this->video_vpts < this->audio_vpts) {
- this->video_vpts = this->audio_vpts;
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video vpts adjusted to audio vpts %" PRId64 "\n", this->video_vpts);
+ if (this->video_vpts < cur_time) {
+ /* still frame */
+ if (this->audio_vpts > cur_time) {
+ /* still frame with audio */
+ this->video_vpts = this->audio_vpts;
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video vpts adjusted to audio vpts %" PRId64 "\n", this->video_vpts);
+ } else {
+ /* still frame, no audio */
+ this->video_vpts = this->prebuffer + cur_time;
+ this->audio_vpts = this->video_vpts;
+ this->audio_vpts_rmndr = 0;
+ this->force_video_jump = 1;
+ this->force_audio_jump = 1;
+ this->video_drift = 0;
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "vpts adjusted with prebuffer to %" PRId64 "\n",
+ this->video_vpts);
+ }
} else {
- this->audio_vpts = this->video_vpts;
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio vpts adjusted to video vpts %" PRId64 "\n", this->video_vpts);
+ /* video */
+ if (this->audio_vpts < cur_time) {
+ /* video, no sound */
+ this->audio_vpts = this->video_vpts;
+ this->audio_vpts_rmndr = 0;
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio vpts adjusted to video vpts %" PRId64 "\n", this->video_vpts);
+ } else {
+ /* video + audio */
+ }
}
break;
}
@@ -354,7 +373,7 @@ static void metronom_handle_discontinuity (metronom_t *this, int type,
this->vpts_offset = this->video_vpts - disc_off;
break;
}
-
+
this->last_video_pts = 0;
this->last_audio_pts = 0;
}