aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-20 00:14:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-20 00:15:06 +0100
commitc8a441efe24ceb0446a09e82d648a5f4e76d264d (patch)
tree06b992a2fffa62ddc57c75d7cd775351a8a6fe0c
parentb08a742526d05bcf300af820da5c79d2a05f9959 (diff)
parent708df4ac66d6b620c216d4d7d48b1da66b8a3b02 (diff)
downloadffmpeg-c8a441efe24ceb0446a09e82d648a5f4e76d264d.tar.gz
Merge remote-tracking branch 'cus/stable'
* cus/stable: ffplay: remove global video state Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffplay.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/ffplay.c b/ffplay.c
index d12b28341b..b5d9f0f0d0 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2421,13 +2421,10 @@ static void stream_component_close(VideoState *is, int stream_index)
}
}
-/* since we have only one decoding thread, we can use a global
- variable instead of a thread local variable */
-static VideoState *global_video_state;
-
static int decode_interrupt_cb(void *ctx)
{
- return (global_video_state && global_video_state->abort_request);
+ VideoState *is = ctx;
+ return is->abort_request;
}
/* this thread gets the stream from the disk or the network */
@@ -2449,10 +2446,9 @@ static int read_thread(void *arg)
is->audio_stream = -1;
is->subtitle_stream = -1;
- global_video_state = is;
-
ic = avformat_alloc_context();
ic->interrupt_callback.callback = decode_interrupt_cb;
+ ic->interrupt_callback.opaque = is;
err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
if (err < 0) {
print_error(is->filename, err);
@@ -2669,9 +2665,6 @@ static int read_thread(void *arg)
ret = 0;
fail:
- /* disable interrupting */
- global_video_state = NULL;
-
/* close each stream */
if (is->audio_stream >= 0)
stream_component_close(is, is->audio_stream);
@@ -2682,7 +2675,6 @@ static int read_thread(void *arg)
if (is->ic) {
avformat_close_input(&is->ic);
}
- avio_set_interrupt_cb(NULL);
if (ret != 0) {
SDL_Event event;