Commit Graph

2204 Commits

Author SHA1 Message Date
Ganesh Ajjanagadde 3ae98497c2 ffmpeg: modify tty state when stderr is redirected
Removes unnecessary isatty(), fixes Ticket2964

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2015-10-11 17:41:15 -04:00
Ganesh Ajjanagadde 2f4374fae1 ffmpeg: avoid possible undefined behavior
On lines 1633,1634 FFABS(pts) is performed. However, if av_stream_get_end_pts
returns AV_NOPTS_VALUE always, pts remains stuck at INT64_MIN, leading
to undefined behavior on FFABS.

One could conceive of a solution using FFNABS. However, such a solution
has to deal with the implementation defined rounding of integer division
with at least one negative operand in ANSI C89. C99 forces truncation to
zero, but I am not sure that all of our platforms compile with full C99
support, and in particular whether we can safely assume a fixed
rounding behavior across all platforms.

This solution is simple, and I doubt changing INT64_MIN to INT64_MIN + 1
has any practical loss - if it is stuck at its initial value, the stream
is messed up anyway.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-09 21:19:39 +02:00
Hendrik Leppkes 580c4fc98a Merge commit '6064f697a321174232a3fad351afb21150c3e9e5'
* commit '6064f697a321174232a3fad351afb21150c3e9e5':
  lavc: Enable side data only packets by default

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-12 15:12:05 +02:00
Hendrik Leppkes 83a5df54ea Remove left-over FF_API_DESTRUCT_PACKET cruft 2015-09-05 16:51:53 +02:00
Hendrik Leppkes 144fb06806 Remove left-over FF_API_AVFILTERBUFFER cruft 2015-09-05 16:27:19 +02:00
Michael Niedermayer cf410f8fb9 ffmpeg: Drop redundant ist check
stream copy always has a input stream, it cannot use complex video/audio filters with unambigous input
Fixes CID1322348

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-04 11:42:23 +02:00
Michael Niedermayer 628a73f8f3 ffmpeg: force 128k default audio bitrate if nothing is specified and there is no specific default
This prevents breaking existing command lines in case the "ab" default is removed from libavcodec

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-28 23:07:12 +02:00
Andreas Cadhalpun c363843a53 add missing FF_API_DESTRUCT_PACKET guards
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:13 +02:00
Michael Niedermayer b3d2035ec3 ffmpeg: use av_err2str()
Found-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 12:11:09 +02:00
Michael Niedermayer 45f3d4e63e ffmpeg: Use correct codec_id for av_parser_change() check
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:37:32 +02:00
Michael Niedermayer ac0ba6f233 ffmpeg: Check av_parser_change() for failure
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:37:32 +02:00
Michael Niedermayer c8890941d6 ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
The null muxer has AVFMT_RAWPICTURE set but can be fed with non-raw material

related to Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:37:09 +02:00
Michael Niedermayer 15ff3f3fdf ffmpeg: check avpicture_fill() return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-21 03:18:57 +02:00
Ronald S. Bultje 229843aa35 Replace av_dlog with ff_dlog.
ff_dlog checks compilability, and is non-public. av_dlog is deprecated
and no longer exists if FF_API_DLOG=0.
2015-08-18 10:24:01 -04:00
Andreas Cadhalpun fbc8eb6857 ffmpeg: use av_buffersrc_add_frame instead of av_buffersrc_add_ref
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-16 18:17:00 +02:00
Michael Niedermayer 4ada49f9db ffmpeg: Use the decoders dimensions in sub2video_get_blank_frame()
Fixes Ticket4744 part3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-15 17:41:48 +02:00
Michael Niedermayer bd5d11d9f5 ffmpeg: Use actual frame dimensions in checks in sub2video_update()
Fixes Ticket4744 part2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-15 17:41:48 +02:00
Michael Niedermayer 0ac83047f6 ffmpeg: Print sub2video: rectangle coordinates in case of overflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-15 17:41:48 +02:00
Andreas Cadhalpun 9c29aa7143 ffmpeg: replace deprecated av_log_ask_for_sample with av_log
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-12 00:14:13 +02:00
Michael Niedermayer 6dbaeed6b7 ffmpeg: switch swscale option handling to AVDictionary similar to what the other subsystems use
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-08 14:44:15 +02:00
Hendrik Leppkes 99f8fc725d ffmpeg: remove access to private FILE struct members on Windows
The FILE struct is opaque in MSVC 2015, and the members of this struct
were never meant to be accessed in any case.

No conditions are known where this check was needed to get characters
from stdin.
2015-08-04 20:05:18 +02:00
Hendrik Leppkes 2ab5002e3c ffmpeg: avoid scanf in keyboard command parsing
Mixing stdio and low-level IO on stdin is not safe.
2015-08-04 20:04:53 +02:00
Michael Niedermayer d2077c860e Revert "ffmpeg: modify tty state when stderr is redirected"
faults in fate otherwise breaks the terminal.
To reproduce, add a abort() into wav_read_header()
run make fate-acodec-adpcm-ima_wav

This reverts commit 92e62f49cf.
2015-07-30 23:49:54 +02:00
Ganesh Ajjanagadde 92e62f49cf ffmpeg: modify tty state when stderr is redirected
This fixes Ticket2964

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 14:31:26 +02:00
Michael Niedermayer 8c2f00d590 ffmpeg.c: remove all remaining coded_frame uses
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 19:52:40 +02:00
Michael Niedermayer cdb0225fa9 ffmpeg: Use side data instead of coded_frame for error[] values
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:22:23 +02:00
Michael Niedermayer 29d147c94d Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
  lavc: Consistently prefix input buffer defines

Conflicts:
	doc/examples/decoding_encoding.c
	libavcodec/4xm.c
	libavcodec/aac_adtstoasc_bsf.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.h
	libavcodec/asvenc.c
	libavcodec/avcodec.h
	libavcodec/avpacket.c
	libavcodec/dvdec.c
	libavcodec/ffv1enc.c
	libavcodec/g2meet.c
	libavcodec/gif.c
	libavcodec/h264.c
	libavcodec/h264_mp4toannexb_bsf.c
	libavcodec/huffyuvdec.c
	libavcodec/huffyuvenc.c
	libavcodec/jpeglsenc.c
	libavcodec/libxvid.c
	libavcodec/mdec.c
	libavcodec/motionpixels.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/noise_bsf.c
	libavcodec/nuv.c
	libavcodec/nvenc.c
	libavcodec/options.c
	libavcodec/parser.c
	libavcodec/pngenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/qsvdec.c
	libavcodec/svq1enc.c
	libavcodec/tiffenc.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/utvideoenc.c
	libavcodec/vc1dec.c
	libavcodec/wmalosslessdec.c
	libavformat/adxdec.c
	libavformat/aiffdec.c
	libavformat/apc.c
	libavformat/apetag.c
	libavformat/avidec.c
	libavformat/bink.c
	libavformat/cafdec.c
	libavformat/flvdec.c
	libavformat/id3v2.c
	libavformat/isom.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mpc.c
	libavformat/mpc8.c
	libavformat/mpegts.c
	libavformat/mvi.c
	libavformat/mxfdec.c
	libavformat/mxg.c
	libavformat/nutdec.c
	libavformat/oggdec.c
	libavformat/oggparsecelt.c
	libavformat/oggparseflac.c
	libavformat/oggparseopus.c
	libavformat/oggparsespeex.c
	libavformat/omadec.c
	libavformat/rawdec.c
	libavformat/riffdec.c
	libavformat/rl2.c
	libavformat/rmdec.c
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_qdm2.c
	libavformat/rtpdec_svq3.c
	libavformat/sierravmd.c
	libavformat/smacker.c
	libavformat/smush.c
	libavformat/spdifenc.c
	libavformat/takdec.c
	libavformat/tta.c
	libavformat/utils.c
	libavformat/vqf.c
	libavformat/westwood_vqa.c
	libavformat/xmv.c
	libavformat/xwma.c
	libavformat/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 23:15:19 +02:00
Michael Niedermayer 444e9874a7 Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
* commit 'def97856de6021965db86c25a732d78689bd6bb0':
  lavc: AV-prefix all codec capabilities

Conflicts:
	cmdutils.c
	ffmpeg.c
	ffplay.c
	libavcodec/8svx.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.c
	libavcodec/adpcm.c
	libavcodec/alac.c
	libavcodec/atrac3plusdec.c
	libavcodec/bink.c
	libavcodec/dnxhddec.c
	libavcodec/dvdec.c
	libavcodec/dvenc.c
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c
	libavcodec/fic.c
	libavcodec/flacdec.c
	libavcodec/flacenc.c
	libavcodec/flvdec.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/gifdec.c
	libavcodec/h261dec.c
	libavcodec/hevc.c
	libavcodec/iff.c
	libavcodec/imc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libvo-aacenc.c
	libavcodec/libvorbisenc.c
	libavcodec/libvpxdec.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpegaudiodec_float.c
	libavcodec/msmpeg4dec.c
	libavcodec/mxpegdec.c
	libavcodec/nvenc_h264.c
	libavcodec/nvenc_hevc.c
	libavcodec/pngdec.c
	libavcodec/qpeg.c
	libavcodec/ra288.c
	libavcodec/rv10.c
	libavcodec/s302m.c
	libavcodec/sp5xdec.c
	libavcodec/takdec.c
	libavcodec/tiff.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/vp6.c
	libavcodec/vp9.c
	libavcodec/wavpack.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:50:18 +02:00
Michael Niedermayer 94d68a41fa Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'
* commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615':
  lavc: AV-prefix all codec flags

Conflicts:
	doc/examples/muxing.c
	ffmpeg.c
	ffmpeg_opt.c
	ffplay.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.c
	libavcodec/ac3enc_float.c
	libavcodec/atrac1.c
	libavcodec/atrac3.c
	libavcodec/atrac3plusdec.c
	libavcodec/dcadec.c
	libavcodec/ffv1enc.c
	libavcodec/h264.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_mb.c
	libavcodec/imc.c
	libavcodec/libmp3lame.c
	libavcodec/libtheoraenc.c
	libavcodec/libtwolame.c
	libavcodec/libvpxenc.c
	libavcodec/libxavs.c
	libavcodec/libxvid.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg12enc.c
	libavcodec/mpegaudiodec_template.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_motion.c
	libavcodec/nellymoserdec.c
	libavcodec/nellymoserenc.c
	libavcodec/nvenc.c
	libavcodec/on2avc.c
	libavcodec/options_table.h
	libavcodec/opus_celt.c
	libavcodec/pngenc.c
	libavcodec/ra288.c
	libavcodec/ratecontrol.c
	libavcodec/twinvq.c
	libavcodec/vc1_block.c
	libavcodec/vc1_loopfilter.c
	libavcodec/vc1_mc.c
	libavcodec/vc1dec.c
	libavcodec/vorbisdec.c
	libavcodec/vp3.c
	libavcodec/wma.c
	libavcodec/wmaprodec.c
	libavcodec/x86/hpeldsp_init.c
	libavcodec/x86/me_cmp_init.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:10:35 +02:00
Michael Niedermayer c40ecffd31 Replace AV_PKT_DATA_QUALITY_FACTOR by AV_PKT_DATA_QUALITY_STATS
The stats are a superset of the quality factor, also allowing the picture type and encoder "PSNR" stats to be exported
This also replaces the native by fixed little endian order for the affected side data

AV_PKT_DATA_QUALITY_FACTOR is left as a synonym of AV_PKT_DATA_QUALITY_STATS

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-22 19:31:52 +02:00
Michael Niedermayer 495eee0123 Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'
* commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370':
  Deprecate avctx.coded_frame

Conflicts:
	ffmpeg.c
	libavcodec/a64multienc.c
	libavcodec/asvenc.c
	libavcodec/cljrenc.c
	libavcodec/dpxenc.c
	libavcodec/gif.c
	libavcodec/mpegvideo_enc.c
	libavcodec/nvenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/pthread_frame.c
	libavcodec/rawenc.c
	libavcodec/sunrastenc.c
	libavcodec/tiffenc.c
	libavcodec/version.h
	libavcodec/xbmenc.c
	libavcodec/xwdenc.c
	libavdevice/v4l2.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 01:17:15 +02:00
Michael Niedermayer e5bae39f46 Merge commit '5d3addb937946eca5391e40b5e6308e74ac6f77b'
* commit '5d3addb937946eca5391e40b5e6308e74ac6f77b':
  Add a quality factor packet side data

Conflicts:
	doc/APIchanges
	ffmpeg.c
	libavcodec/avcodec.h
	libavcodec/mpegvideo_enc.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 00:54:42 +02:00
Michael Niedermayer bc3f19641c Merge commit '6d592fbd0d8e89ecade3fc93b36ea200213dc01c'
* commit '6d592fbd0d8e89ecade3fc93b36ea200213dc01c':
  avconv: split creating and (re-)configuring complex filtergraphs

Conflicts:
	ffmpeg_filter.c
	ffmpeg_opt.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-19 15:36:54 +02:00
Michael Niedermayer 3b0534efdc Merge commit '1959351aecf09fc3e90208ff775f4849801dc13f'
* commit '1959351aecf09fc3e90208ff775f4849801dc13f':
  avconv: move the no streams failure to open_output_file()

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-19 14:01:45 +02:00
Michael Niedermayer 15fbf3e72a Merge commit 'ab7b038906f3e40ed474676d8e3029902a2078f5'
* commit 'ab7b038906f3e40ed474676d8e3029902a2078f5':
  avconv: factor out the output stream initialization

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-19 13:50:33 +02:00
Michael Niedermayer 247f4d1f18 Merge commit '6d5d9246042acb804a652e6fedfb7afe0ca85614'
* commit '6d5d9246042acb804a652e6fedfb7afe0ca85614':
  avconv: move handling the 2pass logfile into avconv_opt

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-19 12:59:05 +02:00
Michael Niedermayer db3e12a828 Merge commit '59245e0c5e10a849e67c632cccf4f677b2442e82'
* commit '59245e0c5e10a849e67c632cccf4f677b2442e82':
  avconv: set the encoding/decoding_needed flags earlier

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-19 12:44:07 +02:00
Michael Niedermayer 6e80fe1ecd ffmpeg: Fix cleanup after failed allocation of output_files
Fixes: 39a25908b84604acdaa490138282d091_signal_sigsegv_7ffff713351a_331_WAWV.avi with memlimit of 262144

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 15:59:11 +02:00
Michael Niedermayer fd4c87fa3b ffmpeg: Fix crash with ost->last_frame allocation failure
Fixes: 1013dbde2c360d939cc2dfc33e4f275c_signal_sigsegv_a0500f_45_320vp3.nsv with memlimit of 536870912

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 13:03:35 +02:00
Michael Niedermayer bd27dc9102 ffmpeg: Fix deallocating input threads with partly failed file allocation
Fixes: 18615ff56beedc63a884a8db0678b47c_signal_sigsegv_7ffff713351a_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 524288

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 12:42:41 +02:00
Michael Niedermayer 503ec7139f ffmpeg: Fix cleanup with ost = NULL
Fixes: 09e670595acbdafb226974b08dab66e3_signal_sigabrt_7ffff70eccc9_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 1048576

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-13 23:34:29 +02:00
Carl Eugen Hoyos 2c7f7a690f ffmpeg: Use av_log to print benchmark output. 2015-07-09 19:58:22 +02:00
rogerdpack 4ebb43f19c ffmpeg: windows: respond to logoff and ctrl+break messages as well
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-01 01:00:38 +02:00
Andreas Cadhalpun bd0f14123f ffmpeg: only count got_output/errors in decode_error_stat
If threading is used, the first (thread_count - 1) packets are read
before any frame/error is returned. Counting this as successful decoding
is wrong, because it also happens when no single frame could be decoded.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-01 00:33:01 +02:00
Andreas Cadhalpun cd64ead8d9 ffmpeg: exit_on_error if decoding a packet failed
This is the second part of the fix for ticket #4370.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-01 00:32:50 +02:00
Michael Niedermayer a5f409bcc0 Merge commit '9a5e4fbec870c7d466b7a0aec92c70778efc96b5'
* commit '9a5e4fbec870c7d466b7a0aec92c70778efc96b5':
  avconv: do not stop processing the input packet on decoding error

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-27 20:34:42 +02:00
Michael Niedermayer a50b008227 Merge commit 'b114f6d48a06a4dad6882bc83e07463905f004c4'
* commit 'b114f6d48a06a4dad6882bc83e07463905f004c4':
  avconv: factor out flushing the filters

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-27 20:22:45 +02:00
Michael Niedermayer 8c22143e7e ffmpeg: Use 2 instead of STDERR_FILENO
STDERR_FILENO is not available on windows

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-25 23:44:06 +02:00
rogerdpack 87961eff23 modify exit message when signaled
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-25 14:18:31 +02:00
rogerdpack 1bcdac2da3 ffmpeg: log error message when shutting down from too many signals
write() suggested by wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-25 12:23:29 +02:00