summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/buffer.h7
-rw-r--r--src/xine-engine/metronom.c33
2 files changed, 14 insertions, 26 deletions
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
index 7669c38e6..6928ebd96 100644
--- a/src/xine-engine/buffer.h
+++ b/src/xine-engine/buffer.h
@@ -377,6 +377,13 @@ struct buf_element_s {
/* represent the state of gapless_switch at the time buf was enqueued */
#define BUF_FLAG_GAPLESS_SW 0x1000
+/* Amount of audio padding added by encoder (mp3, aac). These empty
+ * audio frames are causing a gap when switching between mp3 files.
+ * decoder_info[1] carries amount of audio frames padded at the
+ * beginning of the buffer
+ * decoder_info[2] carries amount of audio frames padded at the end of
+ * the buffer */
+#define BUF_FLAG_AUDIO_PADDING 0x2000
/* Special buffer types:
* Sometimes there is a need to relay special information from a demuxer
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 84b936941..eb9abb84a 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -304,6 +304,8 @@ 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:
@@ -320,33 +322,12 @@ static void metronom_handle_discontinuity (metronom_t *this, int type,
case DISC_ABSOLUTE:
case DISC_RELATIVE:
- 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);
- }
+ 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);
} else {
- /* 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 */
- }
+ this->audio_vpts = this->video_vpts;
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio vpts adjusted to video vpts %" PRId64 "\n", this->video_vpts);
}
break;
}