Commit Graph

3908 Commits

Author SHA1 Message Date
mplayer-svn 62df332dd5 demux_real: set aspect ratio
RM demuxer: set aspect from container video dimensions.

Fixes the sample from FFmpeg trac issue #785.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34850 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 02:21:17 +02:00
mplayer-svn 804bf91570 commands, dvd, dvdnav, bluray: cleanup sub/audio track language display
Code cleanup: Use a stream_control instead of global functions to
get the language associate with a audio or subtitle stream from
the streaming layer.

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

Support showing the stream language with br:// playback.

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

Fix DVDs showing the subtitle language as "unknown"
for a long time.

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

Author: reimar

Note: heavily modified by wm4 for this fork of mplayer.
2012-08-03 01:59:15 +02:00
mplayer-svn 08a71392be demux_rtp: fix compilation with new LIVE555 libraries
Patch by Marty Jack, martyj19 comcast net

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34800 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cehoyos
2012-08-03 01:53:45 +02:00
mplayer-svn 3fa539c4e2 demux_audio: do not decode ID3v2 tag data as audio data
Minor simplification.

Part of patch by Benoît Thébaudeau [benoit thebaudeau () advansee com].

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

Detect ID3v2 tag at the end of the file and stop demuxing before
its start.
Avoids trying to decode its data as MP3.
Patch by Benoît Thébaudeau [benoit thebaudeau {} advansee com].

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

Author: reimar
2012-08-03 01:46:59 +02:00
mplayer-svn f200c85906 demux_mf: add j2c and jpc as jpeg2k, add tiff extension as tif image
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34587 b3059339-0415-0410-9bf9-f77b7e298cf2

demux_mf: add JPS/PNS image formats

add jps / pns image formats, sync'd from ffmpeg
samples: http://i2.i-2000.com/~siragusa/jpsvpns/data/

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

Author: compn
2012-08-03 01:43:44 +02:00
mplayer-svn 98f15b645f stream: add new stream control command STREAM_CTRL_GET_NUM_TITLES
This provides the total number of titles (aka tracks) of CDs / VCDs / DVDs.

Additionally, add a titles property to the get_property slave command.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34474 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: ib
2012-08-03 01:43:03 +02:00
mplayer-svn 6259df5313 demux_audio: improve WAV format detection
Make WAV format detection more restrictive so it does not incorrectly
grab qcp files.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34343 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:33:55 +02:00
mplayer-svn b8c3a20f5e demux_audo: fix wrong runtime and average bitrate for VBR MP3
Do so by determining the number of frames from the Xing/Info/VBRI
headers and by calculation a correct duration which leads to an
reasonable average bytes per seconds.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34273 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: ib
2012-08-03 01:32:39 +02:00
mplayer-svn 273d1ddd71 demux_audio: ensure that demuxer->movi_end will be set
This also simplifies the code that checks for TAG.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34272 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: ib
2012-08-03 01:32:20 +02:00
mplayer-svn 76ce3b7d6e Replace 'q' printf length modifier by 'll'
'q' is just a deprecated synonym of 'll' that should no longer be used.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34224 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: diego
2012-08-03 01:31:00 +02:00
wm4 ebaaa41f2a Remove teletext support
Teletext requires special OSD support. Because I can't even test
teletext, I can't restore support for it. Since teletext can be
considered ancient and obscure, and since it doesn't make sense to keep
the remaining teletext code without being able to use it, I'm removing
it.
2012-08-03 00:12:46 +02:00
wm4 c92538dfaa Remove dead code
This was done with the help of callcatcher [1]. Only functions which
are statically known to be unused are removed.

Some unused functions are not removed yet, because they might be needed
in the near future (such as open_output_stream for the encode branch).

There is one user visible change: the --subcc option did nothing, and is
removed with this commit.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
2012-08-01 17:07:35 +02:00
wm4 f752212c62 Change <endian.h> include to <sys/types.h>
This seems to be more portable. Should fix compilation on OSX and
FreeBSD. Apparently also works on MinGW-w64.
2012-07-31 23:37:56 +02:00
wm4 6e8633c734 configure: remove checks for malloc.h and alloca()
Including <malloc.h>, especially if all you want is malloc(), has no
legitimate uses (on sane platforms at least). Remove the check for it,
and remove all uses in the code.

Remove unused check for alloca().
2012-07-30 22:14:33 +02:00
wm4 1fde09db6f Remove some demuxers and decoders
Most of these demuxers and decoders are provided in better form by
libav, while the mplayer builtin ones are essentially unmaintained. The
only legimitate use case for not using the libav ones was working around
libav bugs or bugs related to the way mplayer uses libav. Instead of
trying to keep dead code alive, development effort should go into
improving libav or the mplayer libav glue code.

Note that the libav demuxer have been preferred over the mplayer builtin
ones for a while in mplayer2. There were some exceptions: playing DVDs
with dvdnav or playing network sources. (That's because some stream
modules and network.c requested explicit file formats, such as
DEMUXER_TYPE_MPEG_PS, which mapped to builtin demuxers.) With this
commit, they are switched to use libav. One caveat is that the requested
format is not passed to libavformat, instead we rely on the auto probing
to select the correct libav demuxer (see code in demux_open_stream()).
2012-07-30 22:14:32 +02:00
wm4 6b4cdfe1c8 Remove XMMS plugin support
XMMS has been dead since 2007.
2012-07-30 02:19:50 +02:00
wm4 521a598068 mplayer: let frontend print stream info, instead of demuxers
When playing a file, users (i.e. me) expect mplayer to print a list of
video/audio/subtitle streams. Currently, this is done in each demuxer
separately. This also means the output is formatted differently
depending which demuxer is active.

Add code to print an uniformly formatted streams list in the player
front end. Extend the streams headers to export additional information
about the streams. Change the lavf and mkv demuxers to follow this new
scheme, and raise the log level for the "old" printing functions.

The intention is to make every demuxer behave like this eventually.

The stream list output attempts to provide codec information. It's a
bit hacky and doesn't always provide useful output, and I'm not sure
how to do it better.
2012-07-30 01:42:55 +02:00
wm4 74df1d8e05 Remove compile time/runtime CPU detection, and drop some platforms
mplayer had three ways of enabling CPU specific assembler routines:
a) Enable them at compile time; crash if the CPU can't handle it.
b) Enable them at compile time, but let the configure script detect
   your CPU. Your binary will only crash if you try to run it on a
   different system that has less features than yours.
   This was the default, I think.
c) Runtime detection.

The implementation of b) and c) suck. a) is not really feasible (it
sucks for users). Remove all code related to this, and use libav's CPU
detection instead. Now the configure script will always enable CPU
specific features, and disable them at runtime if libav reports them
not as available.

One implication is that now the compiler is always expected to handle
SSE (etc.) inline assembly at runtime, unless it's explicitly disabled.

Only checks for x86 CPU specific features are kept, the rest is either
unused or barely used.

Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler
to select decent settings.

Get rid of support for the following operating systems:
- BSD/OS (some ancient BSD fork)
- QNX (don't care)
- BeOS (dead, Haiku support is still welcome)
- AIX (don't care)
- HP-UX (don't care)
- OS/2 (dead, actual support has been removed a while ago)

Remove the configure code for detecting the endianness. Instead, use
the standard header <endian.h>, which can be used if _GNU_SOURCE or
_BSD_SOURCE is defined. (Maybe these changes should have been in a
separate commit.)

Since this is a quite violent code removal orgy, and I'm testing only
on x86 32 bit Linux, expect regressions.
2012-07-30 01:37:28 +02:00
wm4 08caadb9c0 bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstr
Replace all uses of bstr() with bstr0().
Also remove the ridiculous C++ workaround.
2012-07-28 23:47:42 +02:00
wm4 74e7a1e937 osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.

Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)

Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.

Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.

Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.

Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.

The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-07-28 23:36:07 +02:00
wm4 51e198c2a1 Merge remote-tracking branch 'origin/master'
Conflicts:
	.gitignore
	bstr.c
	cfg-mplayer.h
	defaultopts.c
	libvo/video_out.c

The conflict in bstr.c is due to uau adding a bstr_getline function in
commit 2ba8b91a97. This function already existed in this branch.
While uau's function is obviously derived from mine, it's incompatible.
His function preserves line breaks, while mine strips them. Add a
bstr_strip_linebreaks function, fix all other uses of bstr_getline, and
pick uau's implementation.

In .gitignore, change vo_gl3_shaders.h to use an absolute path
additional to resolving the merge conflict.
2012-07-28 17:24:05 +02:00
Uoti Urpala 99141377c8 demux_rawdv.c: fix change missing from recent 8079f4ff82
Like vd_vfw.c fixed earlier, demux_rawdv.c was also missing a change
needed for the "flags"->"keyframe" demux packet field rename. This
broke compilation with libdv enabled.

Hopefully there aren't more cases. It's hard to reliably check for
references in files that aren't compiled in the local tree if they use
different base variable names, as the "flags" name itself is used for
many unrelated things.
2012-07-27 04:12:03 +03:00
Uoti Urpala 4d71fb7098 demux_lavf: use lavf for RealMedia (.rm) files by default
RealMedia was listed as a format for which the internal demuxer
(demux_real) was preferred over lavf. The original reason for this
(lavf failing to give any timing information for some video frames)
has been fixed in libavformat since. Make demux_lavf the preferred
demuxer for RealMedia.

The libavformat demuxer does still have issues. COOK audio initially
misbehaves after a seek (inconsistent timestamps, audio remaining from
the before-seek position). However, the internal demuxer seemed to be
_consistently_ out of sync with a test file. I haven't done thorough
testing, but the internal demuxer does not seem less buggy.
2012-07-26 18:32:09 +03:00
Uoti Urpala 8079f4ff82 demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEY
There was some confusion about the "flags" field in demuxer packets.
Demuxers set it to either 1 or 0x10 to indicate a keyframe (and the
field was not used to indicate anything else). This didn't cause
visible problems because nothing read the value. Replace the "flags"
field with a boolean "keyframe" field. Set AV_PKT_FLAG_KEY based on
this field in packets fed to libavcodec video decoders (looks like PNG
and ZeroCodec are the only ones which depend on values from demuxer;
previously this was hardcoded to true for PNG).

Make demux_mf set the keyframe field in every packet. This matters for
PNG files now that the demuxer flag is forwarded to libavcodec.

Fix logic setting the field in demux_mkv. It had probably not been
updated when adding SimpleBlock support. This probably makes no
difference for any current practical use.
2012-07-25 01:10:30 +03:00
Uoti Urpala 5f3c3f8c32 video, audio: use lavc decoders without codecs.conf entries
Add support for using libavcodec decoders that do not have entries in
codecs.conf. This is currently only used with demux_lavf, and the
codec selection is based on codec_id returned by libavformat. Also
modify codec-related terminal output somewhat to make it use
information from libavcodec and avoid excessively long default output.

The new any-lavc-codec support is implemented with codecs.conf entries
that invoke vd_ffmpeg/ad_ffmpeg without directly specifying any
libavcodec codec name. In this mode, the decoders now instead select
the libavcodec codec based on codec_id previously set by demux_lavf
(if any). These new "generic" codecs.conf entries specify "status
buggy", so that they're tried after any specific entries with
higher-priority status.

Add new directive "anyinput" to codecs.conf syntax. This means the
entry will always match regardless of fourcc. This is used for the
above new codecs.conf entries (so the driver always gets to decide
whether to accept the input, and will fail init() if it can't find a
suitable codec in libavcodec). Remove parsing support for the obsolete
codecs.conf directive "cpuflags". This directive has not had any
effect and has not been used in default codecs.conf since many years
ago.

Shorten codec-related terminal output. When using libavcodec decoders,
show the libavcodec long_name field rather than codecs.conf "info"
field as the name of the codec. Stop showing the codecs.conf entry
name and "vfm/afm" name by default, as these are rarely needed;
they're now in verbose output only. Show "VIDEO:" line at VO
initialization rather than at demuxer open. This didn't really belong
in demuxer code; the new location may show more accurate values (known
after decoder has been opened) and works right if video track is
changed after initial demuxer open.

The vd.c changes (primarily done for terminal output changes) remove
round-to-even behavior from code setting dimensions based on aspect
ratio. I hope nothing depended on this; at least the even values were
not consistently guaranteed anyway, as the rounding code did not run
if the video file did not specify a nonzero aspect value.
2012-07-24 09:01:47 +03:00
Uoti Urpala 39a45c7a17 build: use python3 to generate some files previously in git
Some files used during build are generated with Python scripts in
TOOLS/. Before, the generated files were included in the git tree.
Start creating them at build time. This introduces a build-dependency
on python3.

The files in question are:
libvo/vdpau_template.c
libmpdemux/ebml_types.h
libmpdemux/ebml_defs.c
2012-07-16 21:08:42 +03:00
wm4 87f4cafe9c Merge remote-tracking branch 'origin/master'
Conflicts:
	command.c
	libao2/ao_alsa.c
	libao2/ao_dsound.c
	libao2/ao_pulse.c
	libao2/audio_out.h
	mixer.c
	mixer.h
	mplayer.c

Replace my mixer changes with uau's implementation, which is based on
my code.
2012-04-28 00:54:26 +02:00
Uoti Urpala 4680beb6dc demux_lavf: try harder to make up a frame rate
Frame rate information is mostly irrelevant for playback, but it's
needed at least to convert frame numbers used in some subtitle formats
(like MicroDVD) into timestamps. Libavformat stopped making up a frame
rate if no "reliable" information is available (commit 7929e22bd
"lavf: don't guess r_frame_rate from either stream or codec timebase",
1.5 months ago). This caused a regression with AVI files and MicroDVD
subtitles. Add a heuristic similar to what libavformat used to have,
to make up FPS values which should work at least for the AVI+MicroDVD
use case.
2012-04-14 03:27:53 +03:00
wm4 1aa2e36122 Merge remote-tracking branch 'origin/master'
Conflicts:
	bstr.c
	bstr.h
	etc/input.conf
	input/input.c
	input/input.h
	libao2/ao_pulse.c
	libmpcodecs/vf_ass.c
	libmpcodecs/vf_vo.c
	libvo/gl_common.c
	libvo/x11_common.c
	mixer.c
	mixer.h
	mplayer.c
2012-04-01 22:52:33 +02:00
Uoti Urpala 4f1e4eae99 cosmetics: misc minor cleanups
The deleted ZRM* things were only relevant to vo_zr, which was deleted
earlier.
2012-03-25 22:30:37 +03:00
wm4 6de8120822 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	command.c
	mp_core.h
	mplayer.c
	screenshot.c
2012-03-16 19:14:44 +01:00
wm4 a1244111a7 windows support: unicode filenames
Windows uses a legacy codepage for char* / runtime functions accepting
char *. Using UTF-8 as the codepage with setlocale() is explicitly
forbidden.

Work this around by overriding the MSVCRT functions with wrapper
macros, that assume UTF-8 and use "proper" API calls like _wopen etc.
to deal with unicode filenames. All code that uses standard functions
that take or return filenames must now include osdep/io.h. stat()
can't be overridden, because MinGW-w64 itself defines "stat" as a
macro. Change code to use use mp_stat() instead.

This is not perfectly clean, but still somewhat sane, and much better
than littering the rest of the mplayer code with MinGW specific hacks.
It's also a bit fragile, but that's actually little different from the
previous situation. Also, MinGW is unlikely to ever include a nice way
of dealing with this.
2012-03-09 20:48:54 +02:00
wm4 8dc0743571 Merge remote-tracking branch 'origin/master' into my_master
Conflicts:
	mplayer.c
	screenshot.c
2012-03-05 22:24:57 +01:00
wm4 24be34f1e9 cleanup: Silence compilation warnings on MinGW-w64
Some of the code, especially the dshow and windows codec loader parts,
are extremely hacky and likely full of bugs. The goal is merely getting
rid of warnings that could obscure more important warnings and actual
bugs, instead of fixing actual problems. This reduces the number of
warnings from over 500 to almost the same as when compiling on Linux.

Note that many problems stem from using the ancient wine-derived
windows headers. There are some differences to the "proper" windows
header. Changing the code to compile with the proper headers would be
too much trouble, and it still has to work on Unix.

Some of the changes might actually break compilation on legacy MinGW,
but we don't support that anymore. Always use MinGW-w64, even when
compiling to 32 bit.

Fixes some warnings in the win32 loader code on Linux too.
2012-03-01 00:22:30 +02:00
Uoti Urpala afecdb681b aviheader.c: silence a warning
libmpdemux/aviheader.c:235:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2012-02-29 02:49:48 +02:00
wm4 021d012c97 core: sort chapters
Ensure that chapters are sorted by time. There are some broken mkv
files that have chapters in random order. Using simple chapter
skipping with the seek_chapter slave command is very confusing and
just doesn't work if the chapters are not in order.

The chapters are resorted every time a chapter is added, that would
make the chapter list unsorted. While this is algorithmically very
stupid, it doesn't require changes per demuxer, or reasoning when
exactly chapters could be added. Turning this into an insertion sort
isn't worth the code, and the added demuxer_sort_chapters() function
could possibly be moved to the "right" place later.

This is not done when ordered chapters are used, because timeline
support uses different data structures for chapters.
2012-02-26 21:29:03 +01:00
Uoti Urpala 9f9bbb3c8b demux_lavf: update growing file size info for AVSEEK_SIZE
demux_lavf was returning a static size value when libavformat queried
file size with AVSEEK_SIZE. Add code to query the stream for possibly
changed value first. This at least improves seeking with growing MPEG
files; before seeks would never go beyond the part of the file that
existed when the stream was first opened.
2012-02-26 05:53:13 +02:00
wm4 3b83d43da3 Don't print awkward negative seek message when playing directory
This was caused by a demuxer trying to undo the header read when probing
for its file format. This is pointless in any case, because the core
demuxer code seeks back to the start of the file when initializing a
demuxer.
2012-02-19 17:16:05 +01:00
Uoti Urpala fc6a9e4a3e build: switch to libavutil bswap.h and intreadwrite.h
Remove the private bswap and intreadwrite.h implementations and use
libavutil headers instead.

Originally these headers weren't publicly installed by libavutil at
all. That already changed in 2010, but the pure C bswap version in
installed headers was very inefficient. That was recently (2011-12)
improved and now using the public bswap version probably shouldn't
cause noticeable performance problems, at least if using a new enough
compiler.
2012-02-01 22:46:27 +02:00
Uoti Urpala cdb6d157cc demux_lavf: use Libav RIFF tag lists directly
Change demux_lavf to use CodecID -> RIFF tag mappings that are now
available through the public Libav API. Previously it used a copy in
ffmpeg_files/taglists.c. That can now be deleted.
2012-02-01 22:46:27 +02:00
Uoti Urpala db8cdc73e3 Update Libav API uses
Change various code to use the latest Libav API. The libavcodec
error_recognition setting has been removed and replaced with different
semantics. I removed the "--lavdopts=er=<value>" option accordingly,
as I don't think it's widely enough used to be worth attempting to
emulate the old option semantics using the new API. A new option with
the new semantics can be added later if needed.

Libav dropped APIs that were necessary with all Libav versions
until quite recently (like setting avctx->age), and it would thus not
be possible to keep compatibility with previous Libav versions without
adding workarounds. The new APIs also had some bugs/limitations in the
recent Libav release 0.8, and it would not work fully (at least some
avcodec options would not be set correctly). Because of those issues,
this commit makes no attempt to maintain compatibility with anything
but the latest Libav git head. Hopefully the required fixes and
improvements will be included in a following Libav point release.
2012-02-01 22:46:27 +02:00
wm4 55560d62ee core: add new support for reading .cue files
Playing a .cue file directly will now parse the .cue file, and load and
play the file(s) referenced in the cue. If multiple files are referenced,
a timeline including all files will be created to create the impression
of a single, flat audio file containing all the tracks.

For each track, a chapter is created. The chapter navigation commands can
be used to jump between tracks. The chapter titles will use the string
provided by the track's TITLE cue command. (The -identify command can be
used to print all chapters in a not so user friendly way.)

Other than the chapter names, there is no attempt at displaying or exposing
any other meta data contained in the cue files yet.

The handling (or lack of thereof) of gaps (track pregaps and postgaps) is
probably not correct yet. In general, mplayer's mapping of tracks to the
source audio files can be verified by examining the timeline, which will
be printed when passing the -v switch.

Note that this has nothing to do with the old cue:// support. The old code
isn't touched, and is still only able to play .cue/.bin pairs. Prefixing a
.cue file with cue:// will always invoke the old code, while playing a .cue
file directly (i.e. "mplayer file.cue") will always use the new code.

Playing audio images (.cue/.bin pairs of files) doesn't work yet.
2012-01-18 04:25:19 +01:00
Uoti Urpala 62e3877417 ad_ffmpeg: pass packet side data from libavformat
Pass avpacket->side_data when using a libavcodec audio decoder
together with libavformat demuxer (this was already done for video).
2012-01-08 23:32:40 +02:00
Uoti Urpala 1bd5871762 Libav API updates (remove most deprecated-in-0.7 uses)
Update various code using Libav libraries to remove use of API
features that were deprecated at Libav release 0.7. I think this
removes them all with the exception of URLContext functions still used
in stream_ffmpeg.c (at least other uses that generated deprecation
warnings with libraries from 0.7 are removed).
2011-12-22 04:43:02 +02:00
Uoti Urpala 37e4a928ca configure, build: require at least Libav 0.7
Require versions of the Libav libraries corresponding to Libav release
0.7. These are:
libavutil   51.7.0
libavcodec  53.5.0
libavformat 53.2.0
libswscale   2.0.0
libpostproc 52.0.0

Also disable the fallback to simple header check if these libraries
could not be found with pkg-config; now compiling without pkg-config
support for these always requires explicitly setting --enable-libav
and any needed compiler/linker flags. The simple check would have let
compilation proceed even if a version mismatch was detected.
2011-12-22 01:27:45 +02:00
Uoti Urpala 2e1cdcb9e6 configure, build: remove --disable-libav support
Remove support for building the player without libavcodec and
libavformat. These libraries are now always required.
2011-12-11 07:48:26 +02:00
wm4 e3f5043233 core, demux: fix --identify chapter output with ordered chapters
Information about individual chapters was printed during demuxer
opening phase, and total chapter count (ID_CHAPTERS) was printed
according to mpctx->demuxer->num_chapters. When playing a file with
ordered chapters, this meant that chapter information about every
source file was printed individually (even though only the chapters
from the first file would be used for playback) and the total chapter
count could be wrong. Remove the printing of chapter information from
the demuxer layer and print the chapter information and count actually
used for playback in core print_file_properties().

Also somewhat simplify the internal chapters API and remove possible
inconsistencies.
2011-10-25 22:09:33 +03:00
Uoti Urpala 07b7503200 demux_demuxers: fix seeking bug (--audiofile)
Demux_demuxers checked a pts value against 0 to see if it was unset,
but other code uses MP_NOPTS_VALUE for that now. As a result audio and
subtitle streams could seek to a large negative position (effectively
to 0) instead of the correct target position. This broke --audiofile;
the --initial-audio-sync code could compensate for wrong demuxer seek
up to 5 minutes from the start of the file, masking the bug, but
seeking further than that audio would seek to 0 instead.

Note that the current --audiofile implementation using the
demux_demuxers wrapper is a fundamentally unsound design and still not
expected to generally work properly even after fixing this particular
problem.
2011-10-23 03:29:42 +03:00
Uoti Urpala 3595dcc089 audio/video: delete buggy "dynamic plugin" code
Codec selection for audio and video decoding had a "dynamic plugin"
feature that tried to load a shared library for any codec that had not
been enabled at compilation (disabled by default, but could be enabled
with --enable-dynamic-plugins configure switch; for unknown reasons
some distro packages have enabled it). The implementation was buggy
and could cause normal codec selection fallback to fail if the feature
was enabled. I'm not aware of any real uses of such dynamic plugins
and the feature seems questionable anyway (there are no ABI guarantees
that would make it safe to use). Remove the buggy feature.
2011-10-20 02:16:35 +03:00
Uoti Urpala 49b2bc5947 demux_lavf: set rawvideo codec_tag based on pix_fmt
Libav stopped automatically filling missing codec_tag field for raw
codecs based on pix_fmt in libav commit bb416bd68c ("lavf: do not set
codec_tag for rawvideo"). This broke demux_lavf for raw video in
formats like YUV4MPEG, as the video format was not exported from
demux_lavf in any form (the information only existed in the pix_fmt
field of the struct AVCodecContext from libavformat, and that is not
exported). Add an explicit call to avcodec_pix_fmt_to_codec_tag() to
set the codec tag again so that selecting the correct raw decoder
based on the tag works.
2011-10-18 06:49:56 +03:00
Uoti Urpala c9e681fca3 demux_mkv: avoid hang with some broken files
Return failure to open file in one case that could lead to an infinite
loop with broken Matroska files before.
2011-09-25 18:35:09 +03:00
Uoti Urpala 5a13d47b97 demux_mf: fix option value allocated with strdup
demux_mf allocated the "type" suboption of "--mf" with strdup if it
was not explicitly set. This caused a crash after playing an mf://
entry. Fix to use talloc instead.
2011-09-02 08:04:52 +03:00
Uoti Urpala 506ab685d4 demuxer.h: raise pad amount to allow compiling against FFmpeg
FFmpeg has increased FF_INPUT_BUFFER_PADDING_SIZE to 16 (unlike Libav
which still has it at 8). Raise MP_INPUT_BUFFER_PADDING_SIZE to 16 to
allow compilation against FFmpeg too (demuxer.c checks the padding
size for packets is at least as much as libavcodec wants for its
decoders, and this check failed with the previous value of 8).
2011-08-26 06:29:36 +03:00
Uoti Urpala 2c5285c151 demux_lavf: Adding av_dup_packet() missing from recent 6e8d420a41
Commit 6e8d420a41 ("demux: avoid a copy of demux packets with lavf,
reduce padding") was missing an av_dup_packet() line. As a result at
least formats that use parsing on the lavf side could fail (with
parsing the packet may contain pointers to temporary fields that
will be overwritten/freed when reading further packets, and
av_dup_packet() is required to allocate permanent storage).
2011-08-21 21:55:32 +03:00
Uoti Urpala c9c6b878be demux_mkv: fix failure to open some files from 0ece360eea
After 0ece360eea ("demux_mkv: skip files faster in ordered chapter
file search") some Matroska files failed to open. The problem was that
demux_mkv_read_info() returned 0 on success, but the opening code
interpreted this as a value to stop parsing further headers. Fix this
and also modify some of the other return value handling.
2011-08-20 21:45:42 +03:00
Uoti Urpala 9c7c4e5b7d core, demux, vd_ffmpeg: pass side data from demux_lavf to vd_ffmpeg
Pass the libavformat packet side_data field from demux_lavf to
vd_ffmpeg. Libavcodec/libavformat use this field for palette data, and
passing it is required for the playback of some paletted video codecs.

The implementation works by giving vd_ffmpeg a copy of the struct
demux_packet used to store the video packet (from which it can access
the avpacket field). The definition of struct demux_packet is moved to
new file demux_packet.h so that vd_ffmpeg.c can use it without
including all of demuxer.h.
2011-08-20 20:25:43 +03:00
Uoti Urpala e2ca8853a6 demux_mkv: support extradata for wavpack audio tracks
Export the codec private data field for WavPack and TrueHD audio
tracks. At least for WavPack this is necessary to make some samples
work.

Also change some other cases to use the same data-copying code.
2011-08-20 06:06:12 +03:00
Uoti Urpala 46d90010ba demux_mkv: clean up audio codec handling somewhat 2011-08-20 05:54:27 +03:00
Uoti Urpala 01fa34d537 demux_mkv: check for valid track in video/audio switching
When switching audio or video tracks, demux_mkv only checked that the
new index fell in the range corresponding to tracks existing in the
file being played. However, if the demuxer can not recognize the
format of a track or detects an error, some of those tracks in the
file may not be exported from the demuxer and are not visible to the
rest of the player. Selecting such a track would cause a crash. Add
checks skip such tracks when cycling to next track and switch to
nosound instead if given an explicit track number corresponding to
such a track.
2011-08-20 02:43:51 +03:00
Uoti Urpala f253de24af demux_mkv: remove bad mkv_free() from 0ece360eea
demuxer.c calls demuxer->close() even if opening failed. Thus the
mkv_free() call added in 0ece360eea ("demux_mkv: skip files faster
in ordered chapter file search") was wrong, and could cause a crash
from a double free if some data structures were allocated before the
opening attempt was aborted.
2011-08-19 21:37:16 +03:00
Uoti Urpala 3043beffab demuxer.h: avoid including stream.h
Drop the unnecessary include and add a missing direct include in some
files. This also revealed that demux_rtp_internal.h was missing a
config.h include, fix that too.
2011-08-19 21:37:16 +03:00
Uoti Urpala b2e213d889 aviheader.h: avoid including demuxer.h
Remove unnecessary demuxer.h include from aviheader.h. Through
stheader.h aviheader.h is included in a lot of files. Add missing
mp_msg.h includes to av_sub.c and sd_ass.c (previously hidden by
indirect inclusion through demuxer.h and stream.h).
2011-08-19 21:37:16 +03:00
Uoti Urpala 6e8d420a41 demux: avoid a copy of demux packets with lavf, reduce padding
When demux_lavf read a new packet it used to copy the data from
libavformat's struct AVPacket to struct demux_packet and then free the
lavf packet. Change it to instead keep the AVPacket allocated and
point demux_packet fields to the buffer in that.

Also change MP_INPUT_BUFFER_PADDING_SIZE to 8 which matches
FF_INPUT_BUFFER_PADDING SIZE; demux_lavf packets won't have more
padding now anyway (it was increased from 8 earlier when
FF_INPUT_BUFFER_PADDING_SIZE was increased in libavcodec, but that
change was reverted).
2011-08-19 21:32:47 +03:00
Uoti Urpala ca9065b93f demux_lavf: don't interpret MPEG codec tags as generic tags
Don't interpret native MPEG codec tags using our generic
format-agnostic codec tag tables. MPEG may use tag 3 for MP3, whereas
the generic tables map 3 to uncompressed PCM. Make the code ignore the
codec_tag field for the "mpeg" and "mpegts" libavformat demuxers and
rely on the codec_id value provided by lavf only.
2011-08-10 22:52:35 +03:00
Uoti Urpala 0ece360eea demux_mkv: skip files faster in ordered chapter file search
Ordered chapter code tries opening files to find those matching the
SegmentUID values specified in the timeline. Previously this scan did
a full initialization of the Matroska demuxer for each file, then
checked whether the UID value in the demuxer was a match. Make the
scan code instead provide a list of searched-for UIDs to the demuxer
open code, and make that do a comparison against the list as soon as
it sees the UID in the file, aborting if there is no match.

Also fix units used in "Merging timeline part" verbose message.
2011-08-04 08:38:39 +03:00
Uoti Urpala f1bb6fde32 core: audio: if audio pts is missing return MP_NOPTS_VALUE
Change written_audio_pts() and playing_audio_pts() to return
MP_NOPTS_VALUE if no reasonable pts estimate is available. Before they
returned some incorrect value typically around zero (but not
necessarily exactly that).
2011-07-30 21:05:59 +03:00
Uoti Urpala b33bb28ea3 build: fix --enable-debug, remove some "#ifdef MP_DEBUG"
Recent commit 5d5ca22a6d ("options: commandline: accept --foo=xyz
style options") left some bad code under "#ifdef MP_DEBUG" in
playtree.c, which caused a compilation failure if configured with
"--enable-debug". Fix this. Having the "#ifdef MP_DEBUG" there was
completely unnecessary; it only increased the risk for this kind of
problems for no real benefit - executing the asserts under it would
have no noticeable performance or other penalty in default builds
either. Remove several cases of such harmful "#ifdef MP_DEBUG".
2011-07-30 19:03:20 +03:00
Uoti Urpala 0958620591 bstr: rename BSTR() -> bstr()
Rename the BSTR() function to bstr(). The former caused a conflict
with some Windows OS name, and it's no longer a macro so uppercase
naming is less appropriate.
2011-07-27 08:38:12 +03:00
Uoti Urpala a4f4130819 cleanup: do libav* initialization on startup
Do the global initialization of libavcodec and libavformat
(avcodec_register_all(), av_register_all()) immediately on program
startup and remove the initialization calls from various individual
modules that use libavcodec/libavformat functionality.
2011-07-18 00:57:05 +03:00
Clément Bœsch 2174cbfa2f cleanup: silence most of the clang warnings 2011-07-09 04:23:24 +03:00
Anton Khirnov 00ec1a40f1 demux/mp_taglists: Move Bink audio tags to override list
Some versions of lavf abuse codec_tag for passing Bink version
information to the decoder, which broke detection based on codec tag
(though this has already stopped again in latest Libav). Move bink
audio codec IDs from mp_wav_tags to mp_codecid_override_tags so that
codec tags are completely ignored for them.
2011-07-06 20:27:45 +03:00
Uoti Urpala 2670ceeb81 Merge branch 'mplayer1_changes' 2011-07-06 13:07:37 +03:00
reimar 684e54587e demux_rtp.cpp: Add a hack to receive audio while probing video FPS
Otherwise newer live555 versions would just hang.
Fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1874

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33793 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:08 +03:00
diego 4e89bae12c cleanup: demux_vqf: typo/wording fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33762 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:08 +03:00
reimar b327f6fcb6 demux_lavf: Do not set AVIOContext for AVFMT_NOFILE formats
Setting AVIOContext for AVFMT_NOFILE formats now triggers a warning
from libavformat (and triggered an error for a while), so add a check
to avoid setting AVIOContext when not necessary.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33695 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
reimar 681133d10d demux_lavf: fix code printing subtitle type
Fix printing of subtitle type, the wrong index was used to look up the
type.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33664 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
Uoti Urpala 6075b4d4b2 demux_lavf: add missing #include <libavutil/mathematics.h>
Not included by avutil.h any more in recent Libav versions.
2011-07-06 10:53:08 +03:00
cehoyos 55d4f6528c cosmetics: Fix typos
Patch by Mike Castle, dalgoda+mplayer gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33575 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 09:46:17 +03:00
ib f52b41600d demux_asf: Fix play duration calculation error
Acording to the ASF documentation, the play duration is zero
if the preroll value is greater than the play duration.

The new way of determining it (suggested by reimar) prevents
overflows as well.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33492 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 07:23:26 +03:00
ib 30d81cf726 cosmetics: asf.h: Fix comment error
According to the ASF documentation,
MF_PD_ASF_FILEPROPERTIES_PREROLL (preroll) is UINT64. Fix type
mentioned in comment.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33484 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 06:52:22 +03:00
Uoti Urpala 8ff5b2b889 OSD: when switching sub/audio tracks show title of new track
If the played file has per-track titles for audio and subtitles show
those on the OSD when switching tracks. This changes the OSD message
from 'Audio: (2) eng' to 'Audio: (2) eng ("Director's commentary")'.
2011-07-03 20:41:46 +03:00
Uoti Urpala c5364305be commands: change property mechanism to use talloc strings 2011-07-03 20:04:21 +03:00
Uoti Urpala 774bb252aa cosmetics: reformat demux_lavf.c, m_option.[ch] and m_property.c 2011-07-03 18:39:26 +03:00
Uoti Urpala 1a8384401b demux: use talloc for sh_* structs and "lang" field 2011-07-03 15:01:24 +03:00
Uoti Urpala eb61456065 cleanup: reindent stheader.h
Also improve some comments and change two fields from int to bool.
2011-07-03 13:26:39 +03:00
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
cehoyos ede0eed089 demux_ts: Support S302M audio
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33461 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 11:11:50 +03:00
reimar 00ffdc0da6 cleanup: some warning fixes and minor cleanups
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33399 b3059339-0415-0410-9bf9-f77b7e298cf2

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

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

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33426 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 09:17:19 +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 38b55f8cef demux: pad even 0-size demux packet data (fixes sd_ass crash)
sd_ass relies on there being a zero byte after packet data. However
the packet allocation routines special-cased data length 0 and left
the data pointer as NULL in that case. This could cause a crash in
sd_ass if there was an empty subtitle packet. Change the allocation
routines to stop special-casing empty data and always allocate
padding. Empty packets are not so common that special casing them
would be a worthwhile optimization.

Also fix resize_demux_packet() to use MP_INPUT_BUFFER_PADDING SIZE as
the padding size, instead of a hardcoded value of 8.
2011-06-18 20:02:39 +03:00
Clément Bœsch b68f9fef32 cleanup: shut up more warnings 2011-05-06 18:33:16 +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 a3bf88ddef mp_taglists.c: add CODEC_ID_ANM and CODEC_ID_AVS
Add mapping between codec ID and tag for ANM and AVS.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33288 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
diego f8471184e8 demux_ts: Hint at -tsprobe option when no audio stream is found
patch by Godmar Back, godmar gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33271 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:36:20 +03:00
cehoyos 673a2c7597 codecs.conf, mp_taglists: add FFmpeg Bitmap Brothers JV decoder
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33125 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-05-02 00:35:48 +03:00
Clément Bœsch 9790fc444e demux_ogg: fix slang selection
Commit 59fff90d94 ("options: change -alang and -slang to use string
list type") failed to change demux_ogg accordingly. Add the missing
change.
2011-04-23 05:41:45 +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