summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-10-27 16:41:34 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-10-27 16:41:34 +0000
commit4ef3d0f44a82351f36527904e3319d730cd92958 (patch)
tree3639e0b1ce8145287bd13bac9541df2748583257
parente86e68821ae16a02e6ef5e2f8720db42296dbf7f (diff)
downloadxine-lib-4ef3d0f44a82351f36527904e3319d730cd92958.tar.gz
xine-lib-4ef3d0f44a82351f36527904e3319d730cd92958.tar.bz2
flush on end of stream
CVS patchset: 7080 CVS date: 2004/10/27 16:41:34
-rw-r--r--src/xine-engine/demux.c11
-rw-r--r--src/xine-engine/video_decoder.c10
2 files changed, 15 insertions, 6 deletions
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 4e56a5256..0e0a4ee8e 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -20,7 +20,7 @@
* Demuxer helper functions
* hide some xine engine details from demuxers and reduce code duplication
*
- * $Id: demux.c,v 1.51 2004/10/14 23:25:24 tmattern Exp $
+ * $Id: demux.c,v 1.52 2004/10/27 16:41:34 miguelfreitas Exp $
*/
@@ -287,13 +287,14 @@ static void *demux_loop (void *stream_gen) {
finished_count_video = stream->finished_count_video + 1;
pthread_mutex_unlock (&stream->counter_lock);
- _x_demux_control_end(stream, 0);
-
- lprintf ("loop finished, end buffer sent\n");
-
/* demux_thread_running is zero if demux loop has being stopped by user */
non_user = stream->demux_thread_running;
stream->demux_thread_running = 0;
+
+ _x_demux_control_end(stream, non_user);
+
+ lprintf ("loop finished, end buffer sent\n");
+
pthread_mutex_unlock( &stream->demux_lock );
pthread_mutex_lock (&stream->counter_lock);
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 5a7a16ede..e8110ca85 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.151 2004/10/14 23:25:24 tmattern Exp $
+ * $Id: video_decoder.c,v 1.152 2004/10/27 16:41:35 miguelfreitas Exp $
*
*/
@@ -181,6 +181,14 @@ static void *video_decoder_loop (void *stream_gen) {
break;
case BUF_CONTROL_END:
+
+ /* flush decoder frames if stream finished naturally (non-user stop) */
+ if( buf->decoder_flags ) {
+ running_ticket->acquire(running_ticket, 0);
+ if (stream->video_decoder_plugin)
+ stream->video_decoder_plugin->flush (stream->video_decoder_plugin);
+ running_ticket->release(running_ticket, 0);
+ }
/*
* wait the output fifos to run dry before sending the notification event