Commit Graph

70 Commits

Author SHA1 Message Date
Michael Niedermayer 64f4816915 avformat/mp3dec: 4x faster probing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-09 01:45:24 +01:00
Michael Niedermayer ba8716df7f avformat/mp3dec: perform seek resync in the correct direction
Fixes seeking to the last frame in CBR files
Fixes Ticket2773

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-25 19:37:03 +02:00
Michael Niedermayer 44fb7de8ee Merge commit 'c0779a67e85df856904ee6fab760c4233d4c2be5'
* commit 'c0779a67e85df856904ee6fab760c4233d4c2be5':
  mp3: add .mpa extension

Conflicts:
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-12 15:02:23 +02:00
Vittorio Giovara c0779a67e8 mp3: add .mpa extension
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-12 13:16:15 +02:00
Michael Niedermayer 8d679bc7e6 avformat/mp3dec: improve detection of mp3s with huge id3 tags
When a id3 tag is larger than the amount of space we will probe
give it a score similar to what a .mp3 extension would have given it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-26 00:57:35 +02:00
Michael Niedermayer 1787432b23 mp3dec: make const tables static const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-05 02:52:41 +02:00
Michael Niedermayer e096283ea5 mp3dec: detect CBR and use CBR axiom to seek
This should also work reasonable with truncated and growing mp3s.
Fixes Ticket2590

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-08 17:12:51 +02:00
Michael Niedermayer 19d4163331 avformat/mp3dec: read TOC even if not all needed information is available
This fixes hyothetical bugs with parsing of elements after the TOC

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-07 12:50:41 +02:00
Michael Niedermayer 4cc32e5cad avformat/mp3dec: read xing toc independant of usetoc, only skip filling index if requested
Fixes hypothetical parsing bug with -usetoc 0

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-07 12:49:37 +02:00
Michael Niedermayer 0844630e6b avformat/mp3dec: Add usetoc option to allow dlsabling the use of the xing TOC
The toc is inexact and not using it can thus make sense.
Using it is faster though, thus the opposite can similarly makes sense

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-06 05:43:48 +02:00
Michael Niedermayer f083b4c338 Merge commit 'e0f8be6413b6a8d334d6052e610af32935c310af'
* commit 'e0f8be6413b6a8d334d6052e610af32935c310af':
  avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate

Conflicts:
	libavformat/ac3dec.c
	libavformat/avformat.h
	libavformat/avs.c
	libavformat/m4vdec.c
	libavformat/mov.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegvideodec.c
	libavformat/psxstr.c
	libavformat/pva.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 12:31:03 +02:00
Diego Biurrun e0f8be6413 avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate 2013-05-04 21:43:06 +02:00
Michael Niedermayer 194d0399a2 Merge commit '505642f18276aed03278ac91b1f334ea888eac6a'
* commit '505642f18276aed03278ac91b1f334ea888eac6a':
  mp3dec: fallback to generic seeking when a TOC is not present

Conflicts:
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-19 21:36:23 +02:00
Michael Niedermayer 505642f182 mp3dec: fallback to generic seeking when a TOC is not present
Fixes seeking without a Xing/Info header.

CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-04-19 09:26:34 +02:00
Alexander Kojevnikov eae0879d96 mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-08 07:32:11 +01:00
Alexander Kojevnikov 29d8cd265a mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-05 13:06:01 +01:00
Michael Niedermayer 7a84664ffe mp3_read_probe: make buffer related pointers const
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-25 01:51:32 +01:00
Michael Niedermayer 91295f03d4 mp3dec: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-29 22:11:21 +01:00
Michael Niedermayer b6267901c4 mp3demux: Rewrite xing TOC based seeking
The libav code depends on mp3 startcodes only occuring at the start of
frames. But there is nothing in mp3 that prevents them occuring elsewhere
by chance. Thus the code would fail randomly, the new code searches for 3
consecutive valid frames. If this turns out to be still insufficient the
number can be raised further, or additional checks added.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 03:13:46 +02:00
Michael Niedermayer 6d87781758 mp3dec: fix seeking without xing TOC
fixes regression from the xing toc support

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 22:00:52 +02:00
Michael Niedermayer 5864ce13d1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mp3dec: read Xing frame TOC index
  mp3dec: use named constants for Xing header flags
  libx264: add support for nal-hrd, required for Blu-ray streams.
  mov: support random access point grouping
  matroskadec: properly support BlockDuration

Conflicts:
	libavcodec/libx264.c
	libavformat/isom.h
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 21:46:35 +02:00
Anton Khirnov 50d1f4437b mp3dec: read Xing frame TOC index 2012-09-19 20:59:45 +02:00
Anton Khirnov 2d1a1a7f62 mp3dec: use named constants for Xing header flags 2012-09-19 20:59:44 +02: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
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer d1dad7c824 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpc8: return more meaningful error codes.
  mpc: return more meaningful error codes.
  wv,mpc8: don't return apetag data in packets.
  rtmp: do not warn about receiving metadata packets
  x86: h264dsp: Adjust YASM #ifdefs
  x86: yadif: Mark mmxext optimizations as such
  h264: convert loop filter strength dsp function to yasm.
  Improve descriptiveness of a number of codec and container long names

Conflicts:
	libavcodec/flvdec.c
	libavcodec/libopenjpegdec.c
	libavformat/apetag.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-31 22:41:00 +02:00
Diego Biurrun 0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Michael Niedermayer 706bd8ea19 Merge remote-tracking branch 'qatar/master'
* qatar/master: (35 commits)
  h264_idct_10bit: port x86 assembly to cpuflags.
  x86inc: clip num_args to 7 on x86-32.
  x86inc: sync to latest version from x264.
  fft: rename "z" to "zc" to prevent name collision.
  wv: return meaningful error codes.
  wv: return AVERROR_EOF on EOF, not EIO.
  mp3dec: forward errors for av_get_packet().
  mp3dec: remove a pointless local variable.
  mp3dec: remove commented out cruft.
  lavfi: bump minor to mark stabilizing the ABI.
  FATE: add tests for yadif.
  FATE: add a test for delogo video filter.
  FATE: add a test for amix audio filter.
  audiogen: allow specifying random seed as a commandline parameter.
  vc1dec: Override invalid macroblock quantizer
  vc1: avoid reading beyond the last line in vc1_draw_sprites()
  vc1dec: check that coded slice positions and interlacing match.
  vc1dec: Do not ignore ff_vc1_parse_frame_header_adv return value
  configure: Move parts that should not be user-selectable to CONFIG_EXTRA
  lavf: remove commented out cruft in avformat_find_stream_info()
  ...

Conflicts:
	Makefile
	configure
	libavcodec/vc1dec.c
	libavcodec/x86/h264_deblock.asm
	libavcodec/x86/h264_deblock_10bit.asm
	libavcodec/x86/h264dsp_mmx.c
	libavfilter/version.h
	libavformat/mp3dec.c
	libavformat/utils.c
	libavformat/wv.c
	libavutil/x86/x86inc.asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-29 02:16:26 +02:00
Anton Khirnov f73e3938ac mp3dec: forward errors for av_get_packet().
Don't invent a bogus EIO error.

The code now doesn't check for ret == 0, but that check is redundant,
av_get_packet() never returns 0.
2012-07-28 14:37:00 +02:00
Anton Khirnov 67b1156fe8 mp3dec: remove a pointless local variable. 2012-07-28 14:36:55 +02:00
Anton Khirnov 61f8bb74f3 mp3dec: remove commented out cruft. 2012-07-28 14:36:51 +02:00
Michael Niedermayer ea8c12c90f mp3dec: mark as AVSTREAM_PARSE_FULL_RAW
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-26 02:03:56 +02:00
Michael Niedermayer 57d5a224ce mp3enc: add lame tag with start padding info
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-14 17:20:22 +02:00
Michael Niedermayer 19ff479f69 mp3dec: parse initial silence padding information from lame tag
And pass the information on to the lavf core.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-12 22:25:25 +02:00
Ronald S. Bultje 64bde80563 mp3/ac3 probe: search for PES headers to prevent probing MPEG-PS as MP3. 2012-05-30 09:08:29 -07:00
Michael Niedermayer 7da0a07283 mp3demux: fix id3 discard code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-08 03:47:58 +02:00
Michael Niedermayer f46185c289 mp3demux: fix off by 1 error
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-08 03:45:17 +02:00
Reimar Döffinger 7effbee66c Mark truncated packets as corrupt in av_get_packet.
Manually remove that flag again for formats that read an arbitrary
amount of data and thus truncation is not an error.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-05-01 23:20:52 +02:00
Michael Niedermayer 2e0c360abd Merge remote-tracking branch 'qatar/master'
* qatar/master:
  cosmetics: Align muxer/demuxer declarations
  mpeg12: Do not change frame_pred_frame_dct flag and demote error into a warning
  avcodec: remove avcodec_guess_channel_layout()
  avutil: Add av_get_default_channel_layout()

Conflicts:
	doc/APIchanges
	libavcodec/mpeg12.c
	libavformat/cdg.c
	libavformat/matroskaenc.c
	libavformat/mpegts.c
	libavformat/nuv.c
	libavformat/wav.c
	libavutil/audioconvert.c
	libavutil/audioconvert.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-06 22:52:01 +02:00
Martin Storsjö 20234a4bd7 cosmetics: Align muxer/demuxer declarations
Also add missing trailing commas, break long codec_tag lines and
add spaces in codec_tag declarations.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 19:19:59 +03:00
Michael Niedermayer 2b07f572af mp3_probe: consider id3 tags to be low scoring mp3.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-19 20:49:04 +01:00
Ingo Brückl c05e2be9a2 mp3dec: Fix reading file size and frames in VBRI headers
The fields "Number of Bytes" and "Number of Frames" are mixed up. "Bytes"
come first, "Frames" behind.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Alex Converse <alex.converse@gmail.com>
2012-03-01 15:32:28 -08:00
Clément Bœsch 6a3cc21242 mp3dec: fix truncating packet error message while decoding a complete MP3.
The MP3 demuxer split the data in packets of 1024B which are later split
in MP3 frames by the MPEG audio parser. The last read is "truncated",
but this should not raise any error.

Solution-by: Michael Niedermayer
2012-01-30 23:29:34 +01: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
Anton Khirnov 6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Michael Niedermayer 9d76cf0b18 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Templatize the code for different g726 bitrate variants
  rv40: move loop filter to rv34dsp context
  lavf: make av_set_pts_info private.
  rtpdec: Add support for G726 audio
  rtpdec: Add an init function that can do custom codec context initialization
  avconv: make copy_tb on by default.
  matroskadec: don't set codec timebase.
  rmdec: don't set codec timebase.
  avconv: compute next_pts from input packet duration when possible.
  lavf: estimate frame duration from r_frame_rate.
  avconv: update InputStream.pts in the streamcopy case.

Conflicts:
	avconv.c
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/fbdev.c
	libavdevice/libdc1394.c
	libavdevice/oss_audio.c
	libavdevice/v4l.c
	libavdevice/v4l2.c
	libavdevice/vfwcap.c
	libavdevice/x11grab.c
	libavformat/au.c
	libavformat/eacdata.c
	libavformat/flvdec.c
	libavformat/mpegts.c
	libavformat/mxfenc.c
	libavformat/rtpdec_g726.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-01 02:54:24 +01:00
Anton Khirnov c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Michael Niedermayer b51eaf3b8c mp3probe: Detect mp3 stronger with just 200 frames, this should speed up detection
on mp3 streams.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-30 18:07:20 +01:00
Michael Niedermayer dd8ffc1925 Merge remote-tracking branch 'qatar/master'
* qatar/master: (47 commits)
  lavc: hide private symbols.
  lavc: deprecate img_get_alpha_info().
  lavc: use avpriv_ prefix for ff_toupper4.
  lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits.
  lavc: use avpriv_ prefix for ff_ac3_parse_header.
  lavc: use avpriv_ prefix for ff_frame_rate_tab.
  lavc: rename ff_find_start_code to avpriv_mpv_find_start_code
  lavc: use avpriv_ prefix for ff_split_xiph_headers.
  lavc: use avpriv_ prefix for ff_dirac_parse_sequence_header.
  lavc: use avpriv_ prefix for some dv symbols used in lavf.
  lavc: use avpriv_ prefix for some flac symbols used in lavf.
  lavc: use avpriv_ prefix for some mpeg4audio symbols used in lavf.
  lavc: use avpriv_ prefix for some mpegaudio symbols used in lavf.
  lavc: use avpriv_ prefix for ff_aac_parse_header().
  lavf: hide private symbols.
  lavf: use avpriv_ prefix for some dv functions.
  lavf: use avpriv_ prefix for ff_new_chapter().
  avcodec: add CODEC_CAP_DELAY note to avcodec_decode_audio3() documentation
  avcodec: clarify the CODEC_CAP_DELAY note in avcodec_decode_video2()
  avcodec: clarify documentation of CODEC_CAP_DELAY
  ...

Conflicts:
	configure
	doc/general.texi
	libavcodec/Makefile
	libavcodec/aacdec.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/dv.c
	libavcodec/dvdata.c
	libavcodec/dvdata.h
	libavcodec/libspeexenc.c
	libavcodec/mpegvideo.c
	libavcodec/version.h
	libavformat/avidec.c
	libavformat/dv.c
	libavformat/dv.h
	libavformat/flvenc.c
	libavformat/mov.c
	libavformat/mp3enc.c
	libavformat/oggparsespeex.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-21 02:01:26 +02:00
Anton Khirnov 82ab61f901 lavc: use avpriv_ prefix for some mpegaudio symbols used in lavf.
Specifically, ff_mpa_freq_tab, ff_mpa_bitrate_tab, ff_mpa_decode_header,
ff_mpegaudio_decode_header.
2011-10-20 21:06:57 +02:00