summaryrefslogtreecommitdiff
path: root/src/xine-engine/video_decoder.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-03-25 12:52:32 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-03-25 12:52:32 +0000
commit02f1a32e5fb7f13b2f706f7d3efa125f2b100ead (patch)
treea3a4775ec1e4b452b8ded76bb27891672aa60de2 /src/xine-engine/video_decoder.c
parent171e977d8334a4be15d77b5898e24217074bdc09 (diff)
downloadxine-lib-02f1a32e5fb7f13b2f706f7d3efa125f2b100ead.tar.gz
xine-lib-02f1a32e5fb7f13b2f706f7d3efa125f2b100ead.tar.bz2
- allow on-the-fly rewiring of streams output
- add missing destruction of some pthread structs - do not init streams_lock twice CVS patchset: 4479 CVS date: 2003/03/25 12:52:32
Diffstat (limited to 'src/xine-engine/video_decoder.c')
-rw-r--r--src/xine-engine/video_decoder.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 511e9e819..9ba1a706f 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.131 2003/03/07 15:29:32 miguelfreitas Exp $
+ * $Id: video_decoder.c,v 1.132 2003/03/25 12:52:35 mroi Exp $
*
*/
@@ -82,6 +82,24 @@ void *video_decoder_loop (void *stream_gen) {
#ifdef LOG
printf ("video_decoder: got buffer 0x%08x\n", buf->type);
#endif
+
+ /* check for a new port to use */
+ if (stream->next_video_port) {
+ int64_t img_duration;
+ int width, height;
+
+ /* noone is allowed to modify the next port from now on */
+ pthread_mutex_lock(&stream->next_video_port_lock);
+ if (stream->video_out->status(stream->video_out, stream, &width, &height, &img_duration)) {
+ /* register our stream at the new output port */
+ stream->next_video_port->open(stream->next_video_port, stream);
+ stream->video_out->close(stream->video_out, stream);
+ }
+ stream->video_out = stream->next_video_port;
+ stream->next_video_port = NULL;
+ pthread_mutex_unlock(&stream->next_video_port_lock);
+ pthread_cond_broadcast(&stream->next_video_port_wired);
+ }
switch (buf->type & 0xffff0000) {
case BUF_CONTROL_HEADERS_DONE:
@@ -436,5 +454,8 @@ void video_decoder_shutdown (xine_stream_t *stream) {
#ifdef LOG
printf ("video_decoder: shutdown...4\n");
#endif
+
+ /* wakeup any rewire operations */
+ pthread_cond_broadcast(&stream->next_video_port_wired);
}