]> git.sesse.net Git - ffmpeg/blobdiff - ffplay.c
Clearer explanation of audio channel mapping restrictions
[ffmpeg] / ffplay.c
index f6168b52018da83ceb3f06546354fede0a5d74cd..8734b65373e43d0cf097fa2d895882164f401d10 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1583,7 +1583,6 @@ static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
         pic->linesize[i] = ref->linesize[i];
     }
     pic->opaque = ref;
-    pic->age    = INT_MAX;
     pic->type   = FF_BUFFER_TYPE_USER;
     pic->reordered_opaque = codec->reordered_opaque;
     if(codec->pkt) pic->pkt_pts = codec->pkt->pts;
@@ -2422,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 */
@@ -2450,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);
@@ -2670,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);
@@ -2683,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;
@@ -3174,7 +3165,7 @@ int main(int argc, char **argv)
 
     init_opts();
 
-    show_banner();
+    show_banner(argc, argv, options);
 
     parse_options(NULL, argc, argv, options, opt_input_file);