Register intrrupt_cb() early enough so we dont get stuck with tcp input
[ffmpeg.git] / ffmpeg.c
index 371421d..4c13bb5 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3785,6 +3785,9 @@ int main(int argc, char **argv)
     avdevice_register_all();
     av_register_all();
 
+    if(isatty(STDIN_FILENO))
+        url_set_interrupt_cb(decode_interrupt_cb);
+
     for(i=0; i<CODEC_TYPE_NB; i++){
         avctx_opts[i]= avcodec_alloc_context2(i);
     }