summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-01-11 03:47:01 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-01-11 03:47:01 +0000
commit9d4ebc4801effe30c2af538d00864993299e06fe (patch)
tree63ab498c0e5b5e8d7664c3b6fdebff5691e4fdb8 /src/xine-engine
parent263770caece699a5677a9017fa668c2ff30f4f76 (diff)
downloadxine-lib-9d4ebc4801effe30c2af538d00864993299e06fe.tar.gz
xine-lib-9d4ebc4801effe30c2af538d00864993299e06fe.tar.bz2
brand-new external subtitles support. (yes, it works!)
tested with asf, avi and mpeg but any media should work. todo: - clean up the master/slave stuff and public api. - implement seeking on demux_sputext.c (it must seek to closest subtitle) - general cleaning up and bugfixing CVS patchset: 3860 CVS date: 2003/01/11 03:47:01
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_out.c7
-rw-r--r--src/xine-engine/metronom.c10
-rw-r--r--src/xine-engine/metronom.h3
-rw-r--r--src/xine-engine/video_out.c7
-rw-r--r--src/xine-engine/xine.c23
-rw-r--r--src/xine-engine/xine_internal.h9
6 files changed, 47 insertions, 12 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 7cb1e1d74..b98fe7940 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.97 2003/01/10 19:15:16 miguelfreitas Exp $
+ * $Id: audio_out.c,v 1.98 2003/01/11 03:47:01 miguelfreitas Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -913,7 +913,8 @@ static void ao_put_buffer (xine_audio_port_t *this_gen,
buf->vpts = stream->metronom->got_audio_samples (stream->metronom, pts,
buf->num_frames);
-
+ buf->extra_info->vpts = buf->vpts;
+
#ifdef LOG
printf ("audio_out: ao_put_buffer, pts=%lld, vpts=%lld\n",
pts, buf->vpts);
@@ -1137,7 +1138,7 @@ static int ao_status (xine_audio_port_t *this_gen, xine_stream_t *stream,
pthread_mutex_lock(&this->streams_lock);
for (cur = xine_list_first_content(this->streams); cur;
cur = xine_list_next_content(this->streams))
- if (cur == stream) {
+ if (cur == stream || !stream) {
*bits = this->input.bits;
*rate = this->input.rate;
*mode = this->input.mode;
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 92c209ede..b76c07ce9 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: metronom.c,v 1.108 2002/12/23 10:03:50 miguelfreitas Exp $
+ * $Id: metronom.c,v 1.109 2003/01/11 03:47:01 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -398,6 +398,8 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
this->img_cpt = 0;
this->last_video_pts = pts;
img->duration = this->img_duration;
+ } else {
+ this->img_duration = img->duration;
}
@@ -439,7 +441,9 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
} else {
if (!img->duration) {
img->duration = this->img_duration;
- }
+ } else {
+ this->img_duration = img->duration;
+ }
}
@@ -618,6 +622,8 @@ static int64_t metronom_get_option (metronom_t *this, int option) {
switch (option) {
case METRONOM_AV_OFFSET:
return this->av_offset;
+ case METRONOM_FRAME_DURATION:
+ return this->img_duration;
}
printf ("metronom: unknown option in get_option: %d\n",
option);
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 949729010..3cc17aab6 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: metronom.h,v 1.41 2002/11/20 11:57:49 mroi Exp $
+ * $Id: metronom.h,v 1.42 2003/01/11 03:47:01 miguelfreitas Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -206,6 +206,7 @@ struct metronom_s {
#define METRONOM_AV_OFFSET 2
#define METRONOM_ADJ_VPTS_OFFSET 3
+#define METRONOM_FRAME_DURATION 4
metronom_t *metronom_init (int have_audio, xine_stream_t *stream);
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 7610a5a07..336242c3d 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out.c,v 1.132 2003/01/10 19:15:16 miguelfreitas Exp $
+ * $Id: video_out.c,v 1.133 2003/01/11 03:47:01 miguelfreitas Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -306,7 +306,8 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) {
stream->metronom->got_video_frame (stream->metronom, img);
pic_vpts = img->vpts;
-
+ img->extra_info->vpts = img->vpts;
+
cur_vpts = this->clock->get_current_time(this->clock);
this->last_delivery_pts = cur_vpts;
@@ -963,7 +964,7 @@ static int vo_status (xine_video_port_t *this_gen, xine_stream_t *stream,
pthread_mutex_lock(&this->streams_lock);
for (cur = xine_list_first_content(this->streams); cur;
cur = xine_list_next_content(this->streams))
- if (cur == stream) {
+ if (cur == stream || !stream) {
*width = this->current_width;
*height = this->current_height;
ret = 1;
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index be02eff0c..2df867c5d 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.212 2003/01/10 21:11:12 miguelfreitas Exp $
+ * $Id: xine.c,v 1.213 2003/01/11 03:47:01 miguelfreitas Exp $
*
* top-level xine functions
*
@@ -107,6 +107,9 @@ void extra_info_merge( extra_info_t *dst, extra_info_t *src ) {
if( src->seek_count )
dst->seek_count = src->seek_count;
+
+ if( src->vpts )
+ dst->vpts = src->vpts;
}
static void xine_set_speed_internal (xine_stream_t *stream, int speed) {
@@ -1029,13 +1032,22 @@ static int xine_get_current_position (xine_stream_t *stream) {
pthread_mutex_unlock( &stream->current_extra_info_lock );
if (len == 0) len = stream->input_plugin->get_length (stream->input_plugin);
- share /= (double) len * 65536;
+ share /= (double) len;
+ share *= 65536;
pthread_mutex_unlock (&stream->frontend_lock);
return (int) share;
}
+void xine_get_current_info (xine_stream_t *stream, extra_info_t *extra_info, int size) {
+
+ pthread_mutex_lock( &stream->current_extra_info_lock );
+ memcpy( extra_info, stream->current_extra_info, size );
+ pthread_mutex_unlock( &stream->current_extra_info_lock );
+}
+
+
int xine_get_status (xine_stream_t *stream) {
return stream->status;
}
@@ -1289,3 +1301,10 @@ int xine_trick_mode (xine_stream_t *stream, int mode, int value) {
abort ();
}
+int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,
+ int affection) {
+ master->slave_stream = slave;
+ slave->master_stream = master;
+ return 1;
+}
+
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index c046b92d8..cc10e167d 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_internal.h,v 1.123 2003/01/10 19:15:17 miguelfreitas Exp $
+ * $Id: xine_internal.h,v 1.124 2003/01/11 03:47:01 miguelfreitas Exp $
*
*/
@@ -210,6 +210,11 @@ struct xine_stream_s {
int stream_info[XINE_STREAM_INFO_MAX];
char *meta_info [XINE_STREAM_INFO_MAX];
+
+ /* master/slave streams */
+ xine_stream_t *master_stream;
+ xine_stream_t *slave_stream;
+
/* seeking slowdown */
int first_frame_flag;
pthread_mutex_t first_frame_lock;
@@ -269,6 +274,8 @@ void audio_decoder_shutdown (xine_stream_t *stream);
void extra_info_reset( extra_info_t *extra_info );
void extra_info_merge( extra_info_t *dst, extra_info_t *src );
+
+void xine_get_current_info (xine_stream_t *stream, extra_info_t *extra_info, int size);
/* demuxer helper functions from demux.c */