Commit Graph

31 Commits

Author SHA1 Message Date
Andreas Rheinhardt
c1e439d7e9 avformat: Forward errors where possible
It is not uncommon to find code where the caller thinks to know better
what the return value should be than the callee. E.g. something like
"if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit
changes several instances of this to instead forward the actual error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-12 19:25:33 +01:00
Carl Eugen Hoyos
4d8875ec23 lavf: Constify the probe function argument.
Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
2019-03-21 11:42:17 +01:00
Carl Eugen Hoyos
e9f9175db6 lavf/bit: Fix the G.729 bit auto-detection. 2017-09-30 20:41:52 +02:00
Carl Eugen Hoyos
6f7bd8cd90 lavf/bit: Use pkt->size instead of a constant for G.729 frame size.
Makes the code more readable, the muxer may support variable bit-rate in the future.
2017-09-29 18:46:44 +02:00
Carl Eugen Hoyos
44bdb88811 lavf/bit: Only build the G.729 bit demuxer if requested.
Fix the condition for the G.729 bit muxer.
2017-09-29 18:31:18 +02:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Andreas Cadhalpun
d0b8640f75 avformat/bit: only accept the g729 codec and 1 channel
Other codecs/channel numbers are not supported by this muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-26 23:19:39 +01:00
Andreas Cadhalpun
eeda2c3de8 avformat/bit: check that pkt->size is 10 in write_packet
Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-26 23:19:31 +01:00
James Almer
d34ec64a22 replace calls to url_feof() with avio_feof()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 00:48:38 +02:00
Michael Niedermayer
097f668047 avformat: replace "AVPROBE_SCORE_MAX / X" by AVPROBE_SCORE_EXTENSION / Y
Demuxers where the changed code looked less readable where skiped

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 13:34:56 +02:00
Clément Bœsch
8de9bb6e5e lavf: remove some flushing in write_packet muxers callbacks.
Since 4f112a8e3, this is not necessary anymore. Also, it allows to
actually disable the flushing.
2013-04-14 21:16:53 +02:00
Paul B Mahol
adc61d68b0 bit: check av_new_packet() return value
Fixes CID703626.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-26 15:34:25 +00:00
Michael Niedermayer
7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Michael Niedermayer
e37f161e66 Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
  movenc: Allow writing to a non-seekable output if using empty moov
  movenc: Support adding isml (smooth streaming live) metadata
  libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
  sunrast: Document the different Sun Raster file format types.
  sunrast: Add a check for experimental type.
  libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
  lavf: remove disabled FF_API_SET_PTS_INFO cruft
  lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
  lavf: remove disabled FF_API_REORDER_PRIVATE cruft
  lavf: remove disabled FF_API_SEEK_PUBLIC cruft
  lavf: remove disabled FF_API_STREAM_COPY cruft
  lavf: remove disabled FF_API_PRELOAD cruft
  lavf: remove disabled FF_API_NEW_STREAM cruft
  lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
  lavf: remove disabled FF_API_MUXRATE cruft
  lavf: remove disabled FF_API_FILESIZE cruft
  lavf: remove disabled FF_API_TIMESTAMP cruft
  lavf: remove disabled FF_API_LOOP_OUTPUT cruft
  lavf: remove disabled FF_API_LOOP_INPUT cruft
  lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
  ...

Conflicts:
	doc/APIchanges
	libavcodec/8bps.c
	libavcodec/avcodec.h
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/options.c
	libavcodec/sunrast.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/h264_deblock.asm
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavformat/avformat.h
	libavformat/avio.c
	libavformat/avio.h
	libavformat/aviobuf.c
	libavformat/dv.c
	libavformat/mov.c
	libavformat/utils.c
	libavformat/version.h
	libavformat/wtv.c
	libavutil/Makefile
	libavutil/file.c
	libswscale/x86/input.asm
	libswscale/x86/swscale_mmx.c
	libswscale/x86/swscale_template.c
	tests/ref/lavf/ffm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 07:53:34 +01:00
Michael Niedermayer
b39e01a6e8 clenaup: #ifdec CONFIG*
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-13 21:08:43 +01:00
Clément Bœsch
215b7724e7 lavf: rename remaining av_set_pts_info() to avpriv_set_pts_info(). 2011-12-03 03:24:32 +01:00
Clément Bœsch
eef3ea8c71 Rename remaining ByteIOContext to AVIOContext. 2011-11-14 07:22:30 +01:00
Vladimir Voroshilov
02fa529539 Fix deprecated warnings in .bit (de)muxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-30 15:39:26 +01:00
Carl Eugen Hoyos
7e05542aea Add Vladimir Voroshilov's copyright header to bit.c. 2011-10-29 13:16:47 +02:00
Michael Niedermayer
647ec6fc03 bit: require at least 1 frame for probing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-16 02:43:36 +02:00
Michael Niedermayer
ba9d174851 bit: remove more unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 12:29:20 +02:00
Michael Niedermayer
136a663ceb bit: use AVERROR_INVALIDDATA
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 12:29:20 +02:00
Clément Bœsch
6f8c8fa8af bit: use explicit struct initializers. 2011-09-25 10:44:31 +02:00
Michael Niedermayer
bf85b909f6 bit: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 05:37:27 +02:00
Michael Niedermayer
a5e8492796 bit: set AVPacket.pos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 05:37:22 +02:00
Michael Niedermayer
fa15b1e7b9 bit: loose seekback & wrong bitrate code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 05:33:12 +02:00
Michael Niedermayer
dfc571ff18 bit: rewrite probe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 05:33:09 +02:00
Michael Niedermayer
21922dc5ae bit: replace assert() by proper check.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 05:31:49 +02:00
Michael Niedermayer
fc9d6035c3 bit: return AVERROR_EOF on eof.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 05:05:03 +02:00
Laurent Aimar
3b26daedd8 Removed debug message in the probe function of bit demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 00:29:44 +02:00
Vladimir Voroshilov
0f2297a9b9 Add .bit (de)muxer 2011-09-24 22:10:46 +02:00