summaryrefslogtreecommitdiff
path: root/src/xine-engine/post.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine/post.c')
-rw-r--r--src/xine-engine/post.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c
index aa182d627..4c485035b 100644
--- a/src/xine-engine/post.c
+++ b/src/xine-engine/post.c
@@ -25,7 +25,7 @@
#define POST_INTERNAL
#define XINE_ENGINE_INTERNAL
-#include "post.h"
+#include <xine/post.h>
#include <stdarg.h>
@@ -144,6 +144,14 @@ static void post_video_flush(xine_video_port_t *port_gen) {
if (port->port_lock) pthread_mutex_unlock(port->port_lock);
}
+static void post_video_trigger_drawing(xine_video_port_t *port_gen) {
+ post_video_port_t *port = (post_video_port_t *)port_gen;
+
+ if (port->port_lock) pthread_mutex_lock(port->port_lock);
+ port->original_port->trigger_drawing(port->original_port);
+ if (port->port_lock) pthread_mutex_unlock(port->port_lock);
+}
+
static int post_video_status(xine_video_port_t *port_gen, xine_stream_t *stream,
int *width, int *height, int64_t *img_duration) {
post_video_port_t *port = (post_video_port_t *)port_gen;
@@ -187,6 +195,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) {
if (!new_port)
return 0;
+ this->running_ticket->lock_port_rewiring(this->running_ticket, -1);
this->running_ticket->revoke(this->running_ticket, 1);
if (input_port->original_port->status(input_port->original_port, input_port->stream,
@@ -197,6 +206,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) {
input_port->original_port = new_port;
this->running_ticket->issue(this->running_ticket, 1);
+ this->running_ticket->unlock_port_rewiring(this->running_ticket);
return 1;
}
@@ -218,6 +228,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
port->new_port.exit = post_video_exit;
port->new_port.get_overlay_manager = post_video_get_overlay_manager;
port->new_port.flush = post_video_flush;
+ port->new_port.trigger_drawing = post_video_trigger_drawing;
port->new_port.status = post_video_status;
port->new_port.get_property = post_video_get_property;
port->new_port.set_property = post_video_set_property;
@@ -377,10 +388,11 @@ vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *
port->new_frame->free ? port->new_frame->free : post_frame_free;
new_frame->dispose =
port->new_frame->dispose ? port->new_frame->dispose : post_frame_dispose;
-
- if (!port->new_frame->draw) {
+
+ if (!port->new_frame->draw || (port->route_preprocessing_procs && port->route_preprocessing_procs(port, frame))) {
/* draw will most likely modify the frame, so the decoder
- * should only request preprocessing when there is no new draw */
+ * should only request preprocessing when there is no new draw
+ * but route_preprocessing_procs() can override this decision */
if (frame->proc_frame && !new_frame->proc_frame)
new_frame->proc_frame = post_frame_proc_frame;
if (frame->proc_slice && !new_frame->proc_slice)
@@ -697,6 +709,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
if (!new_port)
return 0;
+ this->running_ticket->lock_port_rewiring(this->running_ticket, -1);
this->running_ticket->revoke(this->running_ticket, 1);
if (input_port->original_port->status(input_port->original_port, input_port->stream,
@@ -707,6 +720,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
input_port->original_port = new_port;
this->running_ticket->issue(this->running_ticket, 1);
+ this->running_ticket->unlock_port_rewiring(this->running_ticket);
return 1;
}
@@ -874,7 +888,7 @@ int _x_post_dispose(post_plugin_t *this) {
/* since the plugin loader does not know, when the plugin gets disposed,
* we have to handle the reference counter here */
pthread_mutex_lock(&this->xine->plugin_catalog->lock);
- ((plugin_node_t *)this->node)->ref--;
+ this->node->ref--;
pthread_mutex_unlock(&this->xine->plugin_catalog->lock);
return 1;