aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-03-23 02:42:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-03-23 02:42:56 +0100
commit4fa0e24736bff7d7fbdfb36ed578a1db166817d4 (patch)
tree3e74e32f82b02ff498320e07424d330473f44fd3 /ffmpeg.c
parent4952afff75bc60df9c842bc248f1da8fe57e04a6 (diff)
parentee26abf2a4884bb56959bac8215758195776c553 (diff)
downloadffmpeg-4fa0e24736bff7d7fbdfb36ed578a1db166817d4.tar.gz
Merge remote-tracking branch 'newdev/master'
* newdev/master: (33 commits) Fix an infinite loop when RoQ encoded generated a frame with a size greater than the maximum valid size. Add kbdwin.o to AC3 decoder Detect byte-swapped AC-3 and support decoding it directly. cosmetics: indentation Always copy input data for AC3 decoder. ac3enc: make sym_quant() branch-free cosmetics: indentation Add a CPU flag for the Atom processor. id3v2: skip broken tags with invalid size id3v2: don't explicitly skip padding Make sure kbhit() is in conio.h fate: update wmv8-drm reference vc1: make P-frame deblock filter bit-exact. configure: Add the -D parameter to the dlltool command amr: Set the AVFMT_GENERIC_INDEX flag amr: Set the pkt->pos field properly to the start of the packet amr: Set the codec->bit_rate field based on the last packet rtsp: Specify unicast for TCP interleaved streams, too Set the correct target for mingw64 dlltool applehttp: Change the variable for stream position in seconds into int64_t ... Conflicts: ffmpeg.c ffplay.c libavcodec/ac3dec.c libavformat/avio.h libavformat/id3v2.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c60
1 files changed, 6 insertions, 54 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f9e97a2ce4..f3680dfc67 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -69,12 +69,7 @@
#include <sys/select.h>
#endif
-#if HAVE_TERMIOS_H
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <termios.h>
-#elif HAVE_CONIO_H
+#if HAVE_KBHIT
#include <conio.h>
#endif
#include <time.h>
@@ -343,12 +338,6 @@ typedef struct AVInputFile {
int nb_streams; /* nb streams we are aware of */
} AVInputFile;
-#if HAVE_TERMIOS_H
-
-/* init terminal so that we can grab keys */
-static struct termios oldtty;
-#endif
-
#if CONFIG_AVFILTER
static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
@@ -436,9 +425,6 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
static void term_exit(void)
{
av_log(NULL, AV_LOG_QUIET, "");
-#if HAVE_TERMIOS_H
- tcsetattr (0, TCSANOW, &oldtty);
-#endif
}
static volatile int received_sigterm = 0;
@@ -452,26 +438,6 @@ sigterm_handler(int sig)
static void term_init(void)
{
-#if HAVE_TERMIOS_H
- struct termios tty;
-
- tcgetattr (0, &tty);
- oldtty = tty;
- atexit(term_exit);
-
- tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
- |INLCR|IGNCR|ICRNL|IXON);
- tty.c_oflag |= OPOST;
- tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
- tty.c_cflag &= ~(CSIZE|PARENB);
- tty.c_cflag |= CS8;
- tty.c_cc[VMIN] = 1;
- tty.c_cc[VTIME] = 0;
-
- tcsetattr (0, TCSANOW, &tty);
- signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
-#endif
-
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
#ifdef SIGXCPU
@@ -482,25 +448,7 @@ static void term_init(void)
/* read a key without blocking */
static int read_key(void)
{
-#if HAVE_TERMIOS_H
- int n = 1;
- unsigned char ch;
- struct timeval tv;
- fd_set rfds;
-
- FD_ZERO(&rfds);
- FD_SET(0, &rfds);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- n = select(1, &rfds, NULL, NULL, &tv);
- if (n > 0) {
- n = read(0, &ch, 1);
- if (n == 1)
- return ch;
-
- return n;
- }
-#elif HAVE_CONIO_H
+#if HAVE_KBHIT
if(kbhit())
return(getch());
#endif
@@ -2511,7 +2459,11 @@ static int transcode(AVFormatContext **output_files,
if (!using_stdin) {
if(verbose >= 0)
+#if HAVE_KBHIT
fprintf(stderr, "Press [q] to stop encoding\n");
+#else
+ fprintf(stderr, "Press ctrl-c to stop encoding\n");
+#endif
url_set_interrupt_cb(decode_interrupt_cb);
}
term_init();