Commit Graph

2725 Commits

Author SHA1 Message Date
Uoti Urpala c8b3088c18 audio: move ready-for-ao data buffer from decoder to AO
Move the buffer storing audio data ready to be fed to the audio output
driver from the audio decoder object to the AO object. This will help
encoding code deal with end of input, and may also be useful to
improve other general gapless audio behavior (as AOs which do not
accept chunks smaller than a certain size may keep them in the buffer
while the decoder changes).

Less data may be dropped now when changing audio filters or switching
timeline parts.
2011-07-02 09:22:32 +03:00
Clément Bœsch 480f3fb8d0 cleanup: fix mp_dbg() format string warnings 2011-07-01 03:37:34 +03:00
reimar 57f48fc1bf vo_gl: don't accept 9/10-bit formats as input
Make mp_get_chroma_shift() simpler/more generic and add an argument
to get the per-component bit depth.
Use this to check more properly for supported formats in
gl and gl2 vos (only 8 and 16 bit are supported, 9 and 10 are not).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33452 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 10:49:41 +03:00
iive 49b31c2b43 vd_ffmpeg.c: fix one case of "-lavdopts vstats" crashing
Fix segfault with -lavdopts vstats and some codecs.
The vstats option relies on avctx->coded_frame being filled.
Unfortunately not all codecs do that (e.g. VP8) thus causing
NULL dereference.
FFmpeg code seems to always check if coded_frame != NULL,
so we should do the same.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33347 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 06:30:49 +03:00
Diego Biurrun 017c173d74 configure: Remove checks for default inline asm features
Remove checks for compiler support of >= 10 assembler operands and
named assembler arguments. Just assume the features are always
available. These features were only missing from obsolete GCC versions
which are not supported any more.
2011-06-28 19:04:22 +03:00
Uoti Urpala d3bef0286b vd_ffmpeg: autoselect output colorspaces without codecs.conf
Selecting the colorspace to output from a decoder is done in the
function mpcodecs_config_vo(). Add a new version of this function,
mpcodecs_config_vo2(), that allows the decoder to specify a list of
candidate colorspaces instead of always using a hardcoded list
specified in the codecs.conf entry. If the codecs.conf entry has any
"out" lines then those still take priority and the decoder-provided
list (if any) is ignored. Make vd_ffmpeg provide a list of the
colorspaces it's willing to output. Remove "out" lines from most
entries for libavcodec video decoders in codecs.conf, so that the
automatic values are now used instead.
2011-06-26 06:27:50 +03:00
Uoti Urpala aba8a1838a video/colorspaces: add new 9/10-bit formats from libavcodec
Add new internal 9/10-bit IMGFMT values and mappings to the
corresponding libav* PIX_FMT_* values.

Partially based on a patch from Arne Bochem <arneb.mp@ccan.de>.
2011-06-26 06:27:50 +03:00
Rudolf Polzer fbf6885395 vf_pullup, vf_yadif: pts handling fixes
vf_pullup: continue to calculate pts after detecting a seek

vf_yadif: add pts calculation for the one-frame-becomes-two mode
          (-vf yadif=1)
2011-06-24 22:31:44 +03:00
Uoti Urpala cbdb7e6305 vo_xvmc: drop XvMC support
Due to libavcodec changes vo_xvmc would have needed some modifications
to keep working. However, I think there's little real demand for XvMC,
so I'll just drop XvMC support. XvMC only supported MPEG-2, making it
of very limited usefulness nowadays, plus the vo_xvmc implementation
was not high quality and never worked particularly well or reliably
anyway.
2011-05-09 20:27:16 +03:00
Uoti Urpala b21e7dc7a9 audio: disallow partial samples, fix ad_pcm to comply
Add some asserts to check that decoders/filters produce complete
samples (byte amounts must be multiples of channels*datatype_size) and
that audio output drivers also accept input in complete units. Fix
ad_pcm which was known to violate this if its last input packet didn't
stop at a sample boundary.
2011-05-07 22:17:51 +03:00
Clément Bœsch b68f9fef32 cleanup: shut up more warnings 2011-05-06 18:33:16 +03:00
Uoti Urpala 24d0d48c4a audio: avoid duplicated error messages on init failure
dec_audio.c init_audio_codec() would in one case print
"ADecoder init failed :(\n" and return failure. Its only caller
init_best_audio_codec() printed exactly the same message if the
returned result was failure. Change the latter message to say
"Could not open audio decoder %s.\n" instead. Some of the
per-open-attempt messages are kind of value about their context; this
new message should make it more clear where the attempt to open one
specific codec ends.
2011-05-03 17:25:01 +03:00
Uoti Urpala 0321d683b4 ad_ffmpeg: return failure from init() if initial decode fails
The init() method in ad_ffmpeg tries to decode some audio data after
opening the libavcodec decoder; however the method returned success
even if this part failed. Change it to return failure instead,
indicating that the codec could not be successfully opened.

This improves behavior at least with some AAC files, for which the
libavcodec decoder can be successfully initialized but decoding
packets always fails. Before the audio would be decoded with
libavcodec, producing only a constant stream of errors; after this
commit audio decoder initialization falls back to FAAD (if available)
which works for these samples.
2011-05-03 16:52:57 +03:00
Clément Bœsch 6506d4ad84 cleanup: remove more warnings 2011-05-02 00:46:48 +03:00
Uoti Urpala 7e65428712 Merge branch 'mplayer1_changes' 2011-05-02 00:46:03 +03:00
reimar 84b2296c34 ad_speex: support decoding stream without header packet
Setup default speex modes, allows decoding of speex in flv which does
not contain a header packet.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33327 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:21 +03:00
reimar b977f59609 vd_ffmpeg: Make DR work with reget_buffer without buffer_hints
Allow DR to work with reget_buffer when no buffer_hints are set.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33287 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar d09882bd74 vd_ffmpeg: handle reget_buffer in DRI failure fallback code
Allow reget_buffer to somewhat work after direct rendering failure.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33286 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
reimar aeb6ac60ae ad_qtaudio: don't run win32 loader code when it's not used
Do not try to set up the FS segment when using quicktime to decode,
it makes no sense to do that.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33259 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
Rudolf Polzer 994b21a80a vf_*: fix pts values passed to the next filter
Many video filters failed to calculate or even just pass through pts
values for their output frames. Fix this, and also make the two
remaining filters that called vf_next_put_image() twice for the same
input frame (vf_softpulldown, vf_telecine) use vf_queue_frame() so
that e.g. framestepping properly sees both frames.

Changed filters: vf_bmovl, vf_detc, vf_divtc, vf_filmdint, vf_ivtc,
vf_lavc, vf_phase, vf_pullup, vf_softpulldown, vf_telecine, vf_tile,
vf_tinterlace.
2011-04-24 03:55:47 +03:00
Uoti Urpala c33fafd6f1 Update libav API uses
Update various code to use newer alternatives instead of deprecated
functions/fields that are being dropped at libav API bump. An
exception is avcodec_thread_init() which is being dropped even though
it's still _necessary_ with fairly recent libav versions, so there's
no good alternative which would work with both those recent versions
and latest libavcodec. I think there are grounds to consider the drop
premature and revert it for now; if that doesn't happen I'll add a
version-test #if check around it later.
2011-04-20 04:36:05 +03:00
Clément Bœsch 52743acba3 cleanup: avoid various GCC warnings 2011-04-20 04:22:53 +03:00
zuxy 78bdc33b48 vd_ffmpeg: require aligned stride in get_buffer()
Change MP_IMGFLAG_ACCEPT_STRIDE to MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE in
get_buffer() as various FFmpeg assembly routines assume aligned input.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33097 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-13 03:36:56 +03:00
cehoyos e43e0de9e6 ad_pcm, codecs.conf: support 'lpcm' in mov and float in aiff
Support 'lpcm' in mov files, has audible (clipping?) artefacts on some
systems.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33075 b3059339-0415-0410-9bf9-f77b7e298cf2

Support 32bit big endian float pcm in aiff.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33076 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-13 03:17:05 +03:00
reimar 55dbd183e3 ad_liba52: Fix -ac a52 with tags other than 0x2000 or dnet
Audio with all codec tags other than 0x2000 was byte-swapped, while
only "dnet" should be.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33028 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-13 03:15:05 +03:00
Uoti Urpala f9b5f2870c mp3lib: drop internal mp3lib tree
Delete mp3lib which has been the default mp3 decoder until now. In
addition to being an unnecessary embedded library it now fails to
compile correctly with the new gcc-4.6, producing noise.

After the deletion the default decoder priority for mp3 will be first
libmpg123 (a newer version of the code that mp3lib was based on) if
available, then ffmp3float which should be available in all normal
compiles. I think that some tweaking may be required as these decoder
alternatives get wider testing, but any problems should be solvable
and there should be no need for mp3lib.
2011-04-02 07:28:53 +03:00
Uoti Urpala 7131fceb0b vd_ffmpeg: fix thread count setting with latest ffmpeg-mt
Recent ffmpeg-mt versions changed the API for setting the number of
decoding threads to use (I'm not sure whether dropping backwards
compatibility was intentional or not). As a result only one thread was
used. Make the thread setting compatible with the new API to restore
proper multithreaded decoding.
2011-03-29 18:54:33 +03:00
faust3 676d5401f3 ad_qtaudio: fix use with the libavformat mov demuxer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32863 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:23:52 +02:00
cboesch d037ba7331 vd_mpng: libpng API update, use color type getter
Use color type getter instead of direct access to private member.

Using the getter is mandatory since recent libpng 1.5 release.

Patch by Gianluigi Tiesi (mplayer - netfarm it)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32840 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:14:34 +02:00
michael a353f11132 libmpcodecs/vf_*.c: Replace memalign() by av_malloc()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32834 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix postprocessing and perspective filters on x86-64
(missing libavutil/mem.h include).

Original patch by Reinhard Tartler

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32835 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:12:50 +02:00
Uoti Urpala e1a8392cae fix compilation with old FFmpeg versions
af_lavcac3enc: use old SampleFormat names without AV_ prefix, the
latter were only added in 2010-11

vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use

demux_real: use ffmpeg_files/intreadwrite.h

stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for
old libavutil versions lacking it
2011-02-08 19:07:10 +02:00
Uoti Urpala 0cb63ea722 ad_ffmpeg: add missing extradata padding
One of two alternative code parts passing codec extradata to
libavcodec didn't add the buffer padding that libavcodec requires,
resulting in invalid reads beoynd allocated memory area. Fix.
2011-02-02 09:13:14 +02:00
Uoti Urpala 7cd7416c73 libmpeg2: drop libmpeg2 support
libavcodec mpeg2 decoder has been the default for a while and seems to
work fine.
2011-02-01 20:10:27 +02:00
Uoti Urpala 626d5ed628 vo_zr2: drop Zoran support
There were multiple files specific to Zoran support, and they also
depended on internal FFmpeg headers (so it would probably have been
hard to get them to compile now even if you tried). It's obsolete now,
so just drop the whole mess.
2011-01-31 16:03:11 +02:00
cehoyos 9a021242a9 codecs.conf, vd_ffmpeg: Enable fflagarith video decoder
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32773 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-01-31 16:03:10 +02:00
diego 42ed53f221 libfaad2:/ Remove forked internal libfaad2 copy
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32741 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove AAC/FAAD2 installation instructions.

There is nothing special about building and installing FAAD2, so there is
no longer a need to keep maintaining instructions for it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32742 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-01-31 16:00:58 +02:00
Uoti Urpala f50f34245e Merge branch 'sub'
* sub:
  sub/OSD: move some related files to sub/
  subtitles: options: enable -ass by default
  subtitles: change default libass rendering style
  demux_mkv, chapters: change millisecond arithmetic to ns
  cleanup: rename ass_* functions to mp_ass_*
  subs: use correct font aspect ratio for libass + converted subs
  cleanup: some random minor code simplification and cleanup
  vf_vo: fix EOSD change detection bug
  sd_ass: remove subreader use, support plaintext markup
  subtitles: style support for common SubRip tags and MicroDVD
  core: ordered chapters: fix bad subtitle parameter
  subs/demux: don't try to enable sub track when creating it
  subtitles/demux: store duration instead of endpts in demux packets
  subtitles: add framework for subtitle decoders
  options: add special -leak-report option
  subtitles: remove code trying to handle text subs with libavcodec
  cleanup: move MP_NOPTS_VALUE definition to mpcommon.h
  subtitles: move global ass_track to struct osd_state
  core: move most mpcommon.c contents to mplayer.c
  core: move global "subdata" and "vo_sub_last" to mpctx
  subtitles: remove sub_last_pts hack
  options: move -noconfig to option struct, simplify
2011-01-26 20:42:15 +02:00
Uoti Urpala c9026cb321 sub/OSD: move some related files to sub/ 2011-01-26 20:39:05 +02:00
Uoti Urpala a248c2c7a1 cleanup: rename ass_* functions to mp_ass_*
The various ass_* functions were created when libass was part of the
MPlayer tree and the distinction between MPlayer-specific and other
functions was less clear. Now that libass is a clearly separate
library, using the same ass_* namespace for player functions is ugly.
Rename the functions to use mp_ass_ prefix instead.
2011-01-26 20:39:04 +02:00
Uoti Urpala 966340b31a subs: use correct font aspect ratio for libass + converted subs
Rendering of ASS subtitles tries to be bug compatible with VSFilter
and stretches fonts when the video is anamorphic (some scripts try to
compensate for this VSFilter behavior, so trying to render them
"correctly" would give the wrong result). However this behavior is not
appropriate for subtitles we converted to ASS format ourselves for
libass rendering, as they certainly don't have VSFilter bug
workarounds. Change the code to use different behavior for "native"
ASS tracks and converted ones. It's questionable whether the
VSFilter-compatible behavior is appropriate for external .ass files
either, as there could be anamorphic and non-anamorphic versions of
the same video and the bug-compatible behavior can only be correct for
one alternative at most. However it's probably better to keep it as a
default at least, so that extracting a muxed subtitle track and using
that does not give behavior different from the original muxed one.

The aspect ratio setting is per ASS_Renderer, and changing it resets
libass caches. For that reason this commit adds separate renderer
instances to use for the "correct" and "VSFilter bug compatible"
cases.
2011-01-26 20:38:53 +02:00
Uoti Urpala 8612c771fc cleanup: some random minor code simplification and cleanup 2011-01-26 13:04:17 +02:00
Clément Bœsch 69fdb30400 mp_msg: Remove uses of MSGT_MENCODER
Some of the code that could run outside MEcoder used MSGT_MENCODER.
Replace those with appropriate MSGT_ types.
2011-01-25 03:15:18 +02:00
Clément Bœsch 83f37b54de cleanup: remove unused MEncoder-related code
Remove some code and variables that were no longer used after MEncoder
removal. Also remove some MEncoder references in comments.
2011-01-25 02:29:31 +02:00
Uoti Urpala 6d65f6889a vf_vo: fix EOSD change detection bug
vf_vo had code setting its prev_visibility variable correctly, then a
line that overrode the value just set with an incorrect one. Remove
the wrong extra line. As a result of the bug the "contents changed"
indicator wasn't forced to true when switching from a subtitle track
to "no track" and then back. A visible effect was at least that a
currently visible static subtitle disappeared when doing that switch
back and forth.
2011-01-18 16:54:52 +02:00
Uoti Urpala e9022ec470 cleanup: move MP_NOPTS_VALUE definition to mpcommon.h 2011-01-15 18:45:43 +02:00
Uoti Urpala adedee4285 subtitles: move global ass_track to struct osd_state 2011-01-15 18:45:43 +02:00
Uoti Urpala 4a26b4c024 cosmetics: remove unused code, small formatting tweaks 2010-12-20 06:42:04 +02:00
Uoti Urpala 2bc2399797 vd_ffmpeg: set thread count to number of cores on machine by default
Make "-lavdopts threads=0" mean an autodetected number of threads, and
make that the default value of the option. Also increase the upper
limit of the option from 8 to 16. Add new file osdep/numcores.c which
tries to determine the number of cores available on the machine.

numcores.c is based (heavily modified) on public domain numcpus.c by
Philip Willoughby <pgw99@doc.ic.ac.uk>, downloaded from
http://csgsoft.doc.ic.ac.uk/numcpus/
2010-12-20 05:53:28 +02:00
reimar 05fa96c6dc ad_faad: fix crash when used on an empty audio stream
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32706 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar c11757c5af ad_speex: improve timestamp handling
Improve speex codec pts handling, make audio timestamps work reasonably
even with the native demuxer as long as seeking is not done.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32704 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00