summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-12-06 18:38:35 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-12-06 18:38:35 +0000
commit0afc8973c3b7c2ddbda3b5d31c9b0896c527e9ae (patch)
tree98f15f7c70eb05f60fabe26fa82ab8ac05809255
parente0f6429c017086031b6c9e265b6bfc1d3d52db09 (diff)
downloadxine-lib-0afc8973c3b7c2ddbda3b5d31c9b0896c527e9ae.tar.gz
xine-lib-0afc8973c3b7c2ddbda3b5d31c9b0896c527e9ae.tar.bz2
- add still frame hint
- improves playback on slower systems since we avoid false triggering of still frames and duplicating images CVS patchset: 3447 CVS date: 2002/12/06 18:38:35
-rw-r--r--src/xine-engine/video_decoder.c15
-rw-r--r--src/xine-engine/video_out.c27
-rw-r--r--src/xine-engine/xine.c3
-rw-r--r--src/xine-engine/xine_internal.h3
4 files changed, 23 insertions, 25 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 9d3d088c3..45eb1edda 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.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_decoder.c,v 1.111 2002/11/29 17:25:26 mroi Exp $
+ * $Id: video_decoder.c,v 1.112 2002/12/06 18:38:35 miguelfreitas Exp $
*
*/
@@ -205,12 +205,8 @@ void *video_decoder_loop (void *stream_gen) {
stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin);
}
- stream->video_in_discontinuity = 1;
-
stream->metronom->handle_video_discontinuity (stream->metronom, DISC_RELATIVE, buf->disc_off);
-
- stream->video_in_discontinuity = 0;
-
+
break;
case BUF_CONTROL_NEWPTS:
@@ -221,15 +217,12 @@ void *video_decoder_loop (void *stream_gen) {
stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin);
}
- stream->video_in_discontinuity = 1;
-
if (buf->decoder_flags & BUF_FLAG_SEEK) {
stream->metronom->handle_video_discontinuity (stream->metronom, DISC_STREAMSEEK, buf->disc_off);
} else {
stream->metronom->handle_video_discontinuity (stream->metronom, DISC_ABSOLUTE, buf->disc_off);
}
- stream->video_in_discontinuity = 0;
-
+
break;
case BUF_CONTROL_AUDIO_CHANNEL:
@@ -345,8 +338,6 @@ void video_decoder_init (xine_stream_t *stream) {
strerror(err));
abort();
}
-
- stream->video_in_discontinuity = 0;
}
void video_decoder_shutdown (xine_stream_t *stream) {
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 31b004455..3e473ab66 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.116 2002/12/06 17:16:40 miguelfreitas Exp $
+ * $Id: video_out.c,v 1.117 2002/12/06 18:38:40 miguelfreitas Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -594,16 +594,25 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) {
* last frame? make backup for possible still image
*/
pthread_mutex_lock( &this->free_img_buf_queue->mutex );
- if (img && !img->next /* FIXME: is this test needed? &&
- (this->stream->video_fifo->size(this->stream->video_fifo) < 10
- || this->stream->video_in_discontinuity)*/ ) {
-
- /*printf ("video_out: possible still frame (fifosize = %d)\n",
- this->stream->video_fifo->size(this->stream->video_fifo));*/
+ if (img && !img->next) {
+ xine_stream_t *stream;
+ int backup_needed = 0;
+
+ pthread_mutex_lock(&this->streams_lock);
+ for (stream = xine_list_first_content(this->streams); stream;
+ stream = xine_list_next_content(this->streams)) {
+ if (stream->stream_info[XINE_STREAM_INFO_VIDEO_HAS_STILL] ||
+ stream->video_fifo->size(stream->video_fifo) < 10)
+ backup_needed = 1;
+ }
+ pthread_mutex_unlock(&this->streams_lock);
+
+ if( backup_needed ) {
/*#ifdef LOG*/
- printf ("video_out: possible still frame\n");
+ printf ("video_out: possible still frame\n");
/*#endif*/
- this->img_backup = duplicate_frame (this, img);
+ this->img_backup = duplicate_frame (this, img);
+ }
}
pthread_mutex_unlock( &this->free_img_buf_queue->mutex );
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 91c549aa2..6db978daa 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.197 2002/11/28 10:21:08 petli Exp $
+ * $Id: xine.c,v 1.198 2002/12/06 18:38:46 miguelfreitas Exp $
*
* top-level xine functions
*
@@ -295,7 +295,6 @@ xine_stream_t *xine_stream_new (xine_t *this,
stream->spu_channel = -1;
stream->video_out = vo;
stream->video_driver = vo->driver;
- stream->video_in_discontinuity = 0;
stream->video_channel = 0;
stream->video_decoder_plugin = NULL;
stream->video_decoder_streamtype = -1;
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 013bff436..6d8373bab 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.113 2002/11/20 11:57:50 mroi Exp $
+ * $Id: xine_internal.h,v 1.114 2002/12/06 18:38:49 miguelfreitas Exp $
*
*/
@@ -152,7 +152,6 @@ struct xine_stream_s {
pthread_t video_thread;
video_decoder_t *video_decoder_plugin;
int video_decoder_streamtype;
- int video_in_discontinuity;
int video_channel;
xine_audio_port_t *audio_out;