diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-07 21:45:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-07 21:45:52 +0200 |
commit | 67732b9d62576c67589773e5332e94aac429cc4c (patch) | |
tree | bb7e865164fd3ed8365be014d3b1bf420d347ff0 | |
parent | b4d44367bc45b7bafd61c4bf59434bc517a6a440 (diff) | |
parent | a8656cd425babe6a2fe12aff826de57f28b8efcd (diff) | |
download | ffmpeg-67732b9d62576c67589773e5332e94aac429cc4c.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
mpegts: Remove disabled extension matching probe.
fate: avoid freopen(NULL) in videogen/rotozoom
Conflicts:
tests/rotozoom.c
tests/videogen.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mpegts.c | 8 | ||||
-rw-r--r-- | tests/Makefile | 4 | ||||
-rw-r--r-- | tests/rotozoom.c | 11 | ||||
-rw-r--r-- | tests/videogen.c | 11 |
4 files changed, 14 insertions, 20 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index e77b9a79dd..3acca0230c 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1868,7 +1868,6 @@ static int handle_packets(MpegTSContext *ts, int nb_packets) static int mpegts_probe(AVProbeData *p) { -#if 1 const int size= p->buf_size; int score, fec_score, dvhs_score; int check_count= size / TS_FEC_PACKET_SIZE; @@ -1887,13 +1886,6 @@ static int mpegts_probe(AVProbeData *p) else if(dvhs_score > score && dvhs_score > fec_score && dvhs_score > 6) return AVPROBE_SCORE_MAX + dvhs_score - CHECK_COUNT; else if( fec_score > 6) return AVPROBE_SCORE_MAX + fec_score - CHECK_COUNT; else return -1; -#else - /* only use the extension for safer guess */ - if (av_match_ext(p->filename, "ts")) - return AVPROBE_SCORE_MAX; - else - return 0; -#endif } /* return the 90kHz PCR and the extension for the 27MHz PCR. return diff --git a/tests/Makefile b/tests/Makefile index e9d9fc578d..53c181131c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -28,10 +28,10 @@ tests/data/asynth-%.wav: tests/audiogen$(HOSTEXESUF) | tests/data $(M)./$< $@ $(subst -, ,$*) tests/data/vsynth1.yuv: tests/videogen$(HOSTEXESUF) | tests/data - $(M)$< >$@ + $(M)$< $@ tests/data/vsynth2.yuv: tests/rotozoom$(HOSTEXESUF) | tests/data - $(M)$< $(SRC_PATH)/tests/lena.pnm >$@ + $(M)$< $(SRC_PATH)/tests/lena.pnm $@ tests/data/%.sw tests/data/asynth% tests/data/vsynth%.yuv tests/vsynth%/00.pgm: TAG = GEN diff --git a/tests/rotozoom.c b/tests/rotozoom.c index 6604d92077..cfa7f81369 100644 --- a/tests/rotozoom.c +++ b/tests/rotozoom.c @@ -158,15 +158,16 @@ int main(int argc, char **argv) { int w, h, i; char buf[1024]; + int isdir = 0; - if (argc > 3) { - printf("usage: %s image.pnm [directory/]\n" + if (argc != 3) { + printf("usage: %s image.pnm file|dir\n" "generate a test video stream\n", argv[0]); return 1; } -// if (argc < 3) -// err_if(!freopen(NULL, "wb", stdout)); + if (!freopen(argv[2], "wb", stdout)) + isdir = 1; w = DEFAULT_WIDTH; h = DEFAULT_HEIGHT; @@ -181,7 +182,7 @@ int main(int argc, char **argv) for (i = 0; i < DEFAULT_NB_PICT; i++) { gen_image(i, w, h); - if (argc > 2) { + if (isdir) { snprintf(buf, sizeof(buf), "%s%02d.pgm", argv[2], i); pgmyuv_save(buf, w, h, rgb_tab); } else { diff --git a/tests/videogen.c b/tests/videogen.c index 396c1e8fe6..94e6e77598 100644 --- a/tests/videogen.c +++ b/tests/videogen.c @@ -145,15 +145,16 @@ int main(int argc, char **argv) { int w, h, i; char buf[1024]; + int isdir = 0; - if (argc > 2) { - printf("usage: %s [file]\n" + if (argc != 2) { + printf("usage: %s file|dir\n" "generate a test video stream\n", argv[0]); exit(1); } -// if (argc < 2) -// err_if(!freopen(NULL, "wb", stdout)); + if (!freopen(argv[1], "wb", stdout)) + isdir = 1; w = DEFAULT_WIDTH; h = DEFAULT_HEIGHT; @@ -165,7 +166,7 @@ int main(int argc, char **argv) for (i = 0; i < DEFAULT_NB_PICT; i++) { gen_image(i, w, h); - if (argc > 1) { + if (isdir) { snprintf(buf, sizeof(buf), "%s%02d.pgm", argv[1], i); pgmyuv_save(buf, w, h, rgb_tab); } else { |