Commit Graph

3672 Commits

Author SHA1 Message Date
Uoti Urpala fc66c94360 demux_mkv: seek: with no track-specific index entries use any
The Cue entries in typical Matroska files have information for the
video track only. This caused seeks to fail when playing with
-novideo, as demux_mkv tried to use audio track index entries then.
Add a fallback case that uses any index entries without caring what
track they're for if there are no entries specific to the track we're
interested in.
2010-11-08 18:05:12 +02:00
Uoti Urpala 0619b75cb1 demux_mkv: fix relative seeks without index
Relative seeks didn't add the current position as they should. Fix.

Note that this had no effect in normal playback case even if the file
had no index, because the "accurate_seek" logic at higher level would
convert all commands to absolute seeks before calling demuxer level.
2010-11-08 18:05:12 +02:00
Uoti Urpala 5c3aaf03b1 demux_mkv: fix seek hang when going past end of file without index 2010-11-08 18:05:12 +02:00
Uoti Urpala 4de3f19426 demux_mkv: cleanup: separate index creation part of seeking
Move the code to build an index and seek without using cue information
from the file to a separate function.
2010-11-08 18:05:12 +02:00
Uoti Urpala a7b91626cf core: use correct demuxer with -audiofile / -subfile
Various code referred to "mpctx->demuxer" where it should really have
referred to the one used for audio/subtitles in case those differ. Fix
by using "mpctx->d_audio->demuxer" etc instead. Disable the copying of
streams in demux_demuxers; that was a partial workaround for things
referring to the main demuxer (and it wasn't enough anyway).

This fixes, among other things, switching audio tracks within the file
specified by -audiofile.
2010-11-08 18:05:12 +02:00
Uoti Urpala 82cd2f7aec demux_demuxers: initialize stream_pts to MP_NOPTS_VALUE
demux_demuxers doesn't run the normal demuxer.c initialization for new
demuxers. Initialize stream_pts separately (it won't ever be changed
with the current implementation). This at least avoids other code
assuming it was set properly.
2010-11-08 18:05:12 +02:00
Uoti Urpala 9a663ffec6 core: move video pos/length query functions from demux to core
Move functions to query current playback position, percentage position
and total video length from from the demuxer layer to top level. The
functions need access to playback state that doesn't belong on the
demuxing level. Make the new functions more capable and simplify some
code that can now rely on them. This fixes some errors in displayed in
OSD and slave mode information when using timeline (ordered chapters).
2010-11-08 18:05:12 +02:00
Uoti Urpala 3628a903f4 demux: fix -correct-pts autoselection with -audiofile
Make demuxer-based -correct-pts autoselection base the decision on the
video demuxer in case several are being used, such as with
-audiofile.
2010-11-08 18:05:12 +02:00
cehoyos 458350350b demuxer.c: add missing parser list fourccs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32596 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:12 +02:00
cehoyos 9bb304898b demuxer.c: fix parser list fourcc typo: 'MPE '->'MP3 '
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32595 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:11 +02:00
reimar 47ba682a63 demux_ts: Fix subtitle sync issues
Ensure we queue all subtitle packets before demuxing the next video
packet.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32587 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:11 +02:00
reimar 50d5197611 codecs_conf, mp_taglists: Use only one fourcc for LATM
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32584 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:07 +02:00
reimar e666e3ce91 demuxer.c: Add support for parsing LATM
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32582 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:03:35 +02:00
reimar 8d89878e7f demux_lavf: Fix program switching
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32580 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:03:35 +02:00
reimar eb4db3a9ff demux_lavf: Print PROGRAM_ID -identify output similar to demux_ts
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32579 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:03:35 +02:00
cehoyos 0a2d29a75b codecs.conf, mp_taglists: Support FFmpeg LATM decoding
Also move libfaad codecs.conf entry into the same position as in svn
(no functionality change since ffaac is marked buggy so only faad is
used by default regardless or order).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32571 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:03:27 +02:00
Uoti Urpala 759231566a demux_lavf: for avi, use packet .dts instead of .pts
When playing avi files take timestamps from the .dts field of the
packet instead of .pts. For avi libavformat returns the original avi
timestamps in .dts; without GENPTS set .pts is sometimes unset, with
GENPTS set it'll contain some made up values which are not correct
pts. Current libavformat also has a bug take makes it loop over the
whole avi file if you use GENPTS with video streams disabled.

The timing code can cope with the avi timestamps even though they're
not really pts.
2010-11-06 23:29:45 +02:00
Uoti Urpala b04c615959 demux_lavf: avoid deprecated "first_iformat" by using newer API 2010-11-06 23:29:07 +02:00
Uoti Urpala 393bb7bb98 demux_lavf: add hack for stream-changing ogg input (internet radio)
Some internet radio streams are ogg/vorbis with a new stream for each
track (and the previous stream stops receiving data). Add a hack to
ignore the stream number in packets when input seems to match this
case; all packets will be effectively regarded as parts of the same
audio stream. This workaround can't work perfectly with current lavf
because it will keep adding streams and then hit its 20 stream
maximum; at that point playback will likely fail. Print a warning
about this problem and mention "-demuxer ogg" as a possible
workaround.

Currently there's no check that the vorbis extradata is actually
compatible between the streams.
2010-11-06 23:29:00 +02:00
Uoti Urpala 661d909f8e demux_lavf: more future proof AVInputFormat name comparison
AVInputFormat name fields consist of comma-separated components, more
of which may be added in backwards-compatible versions. demux_lavf did
a strcmp against the whole field at once; this would break if a
component was added. Change the code to search for individual
component matches within the field instead.
2010-11-06 23:26:21 +02:00
diego ed8e92afcc Remove #warning preprocessor directives
The #warning preprocessor directive is non-standard and not available with all
compilers. Furthermore, the warnings it causes are noisy and have not led to
getting any of the underlying issues fixed in the space of a decade.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32480 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:10 +02:00
cehoyos 2158f1b401 demux_ts: fix subtitle stream breaking audio track switch
Fix switching audio track with the native MPEG-TS demuxer after an
additional subtitle stream was detected.

Patch by KS Ng, hk D dmbth A gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32445 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
reimar c310aa4628 demux_lavf: handle new streams appearing during playback
Based on patch by KS Ng - dmbth [hk.dmbth gmail com]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32439 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
diego 7acaf6db39 demux_pva: move functions, add "static"
Mark pva_get_payload() as static, it is not used outside of the file.

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

Move pva_get_payload() around to avoid a forward declaration.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32436 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
diego 342c68283e mpeg_hdr.c: move function to avoid forward declaration
Move mp_unescape03 function around to avoid forward declaration.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32433 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
diego 03dae530f8 demux_real.c: Remove unused hexdump() forward declaration
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32432 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
diego 1de42d8c64 demux_[mpg|ts|ty]: #include dec_audio.h for skip_audio_frame()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32431 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
reimar 044fc491fa demux_mkv: fix decoded length calculation of LZO decompression
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32305 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:17:04 +02:00
Uoti Urpala 7aa202d9a7 demux_mkv: add some sanity checks
Add some checks to prevent bad files from creating arbitrarily large
buffer blocks (which could result in integer overflows and memory
corruption). Remove a test with little use from demux_mkv_decode(); it
compared an int with size_t, and was useless on 64-bit platforms at
least.
2010-11-02 04:17:04 +02:00
Uoti Urpala c5e462b33d build: enable/disable all FFmpeg libraries together
Enable all of libavcodec, libavformat, libswscale, and libpostproc
together (libavutil is always required).

based on svn commit by diego:

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32226 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:55 +02:00
Uoti Urpala 389c32b5c7 Remove MEncoder
Disable MEncoder compilation and remove files used by MEncoder
only. There's no attempt to remove all references to MEncoder from the
build system, documentation etc at this point.

Removed files: (muxers, audio/video encoders, misc)

mencoder.c
cfg-mencoder.h
parser-mecmd.[ch]
xvid_vbr.[ch]
libmpdemux/muxer*
libmpcodecs/ae*
libmpcodecs/ve*
libmpcodecs/native/rtjpegn.[ch]
libmpcodecs/native/mmx.h   // was used by rtjpegn only

Rationale:

MEncoder is still useful for some people, but there's not much
potential for further development; in the long run almost all use
cases can be handled better by solutions based on something else (for
example using FFmpeg or encoding MPlayer output). FFmpeg is already
getting video filtering support which should work for some common
MEncoder uses.

Keeping MEncoder working takes extra work that is away from player
development. While that amount of work is not huge (mostly MEncoder
can be just ignored), it's not completely insignificant either.

MEncoder is still maintained to some degree in the svn tree, so if
necessary it's possible to use it from there for now. This tree has
never had major improvements for the MEncoder side, so using svn
MEncoder instead should be no major loss.
2010-11-02 04:16:55 +02:00
reimar 5896036cb3 demux_nemesi: Remove a pointless if
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32208 b3059339-0415-0410-9bf9-f77b7e298cf2

Reindent.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32209 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:46 +02:00
reimar fe6c4fcae2 cleanup: malloc+memset->calloc, sizeof(TYPE)->sizeof(*ptr)
Replace malloc+memset by calloc

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

Replace malloc+memset by calloc.

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

Replace malloc+memset by calloc.

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

Replace some sizeof(type) by sizeof(*pointer)

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

Replace malloc+memset by calloc.

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

Replace malloc+memset by calloc.

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

Replace malloc+memset by calloc

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

Replace sizoef(type) by sizeof(*ptrvar).
Besides being consistent with FFmpeg style,
this reduces the size of a patch to rename these
types to not conflict with the windows.h definitions.

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

Replace malloc+memset by calloc.

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

Replace malloc+memset by calloc.

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

Replace sizeof(type) by sizeof(*ptrvar)

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

Remove a useless cast.

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

Replace sizeof(type)

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

Remove a useless cast.

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

Replace several sizeof(WAVEFORMATEX)

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

Replace one more instance of sizeof(WAVEFORMATEX); fix compilation.
patch by Clément Bœsch, ubitux gmail com

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

Avoid some pointless uses of sizeof() and one related cast.

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

Merge one malloc() + memset() invocation into calloc().

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

Replace malloc+memset by calloc

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

Replace sizeof(WAVEFORMATEX) occurrences.

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

Replace malloc+memset by calloc.

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

Replace sizeof(BITMAPINFOHEADER)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:46 +02:00
diego 44f851a3ed demux_rtp: Remove pointless typedef keyword
Remove "typedef" from struct RTPState declaration; fixes:
libmpdemux/demux_rtp.cpp:90: warning: 'typedef' was ignored in this declaration

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32170 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:46 +02:00
diego f2899d96ee Add central init_avcodec() to avoid duplicated libavcodec init code
Patch by Vlad Seryakov, vseryakov gmail com

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

Refactor more instances of avcodec_initialized handling into init_avcodec().
This is a leftover from the previous commit.

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

Add missing #include for vd_ffmpeg.h; fixes the warning:
libmpcodecs/vf_zrmjpeg.c:472: warning: implicit declaration of function 'init_avcodec'

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32176 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:51 +02:00
reimar dec2db6326 demux_lavf: Always use convergence_duration for subtitles
Otherwise subtitles will stay on screen forever for ASS subtitles in
mkv if no ASS renderer is used.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32032 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:49 +02:00
reimar 415b948f2e demuxer.c: reset subtitle EOF on seeking
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32031 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:49 +02:00
reimar 0e82595632 demux_lavf: print subtitle type in more cases
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32006 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:49 +02:00
diego 15fee47bc6 demux_ogg.c: remove unused variable
Avoid redundant use of variable 'size' in demux_ogg_read_packet(), fixes:
libmpdemux/demux_ogg.c:266: warning: unused variable 'size'

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31946 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:48 +02:00
diego 26541aeb8b printf format fixes ("%d" -> "%zd")
Add 'z' length modifier to %d printf format specifier for size_t argument.
stream/http.c:675: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

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

Add 'z' length modifier to %d printf format specifiers for size_t arguments.
libmpdemux/demux_avi.c:553: warning: format '%u' expects type 'unsigned int', but argument 5 has type 'size_t'
libmpdemux/demux_avi.c:553: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'size_t'

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

Add 'z' length modifier to %d printf format specifiers for size_t arguments.
libmpdemux/demux_lmlm4.c:75: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t'
libmpdemux/demux_lmlm4.c:163: warning: format '%d' expects type 'int', but argument 6 has type 'ssize_t'
libmpdemux/demux_lmlm4.c:163: warning: format '%d' expects type 'int', but argument 7 has type 'ssize_t'

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

Add 'z' length modifier to %d printf format specifier for size_t argument.
stream/asf_streaming.c:676: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31938 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:48 +02:00
diego 7e57bfd853 demux: Move mp_a52_framesize from demux_ts.c to parse_es.c
The function is used in the MPEG muxer as well and not specific to MPEG-TS.
Jointly developed by Nico Sabbi and myself.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31929 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:48 +02:00
reimar 1e403d0593 demux_ts.c: cleanup
Remove some useless casts.

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

Remove an unused variable.

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

Simplify ts_sync. Might also make it easier to optimize a bit.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31923 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:48 +02:00
siretart 2e6ff523dd spelling fixes
Found by the Debian QA tool 'lintian'

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

reintroduce typo in genres.h that was fixed fixed r31913 to match the id3v2 spec

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31920 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:03 +02:00
diego 900ca4cb3e demux_ts.c: avoid compiler warning by adding initialization
Initialize frame_length variable to zero to avoid the warning:
libmpdemux/demux_ts.c:669: warning: 'frame_length' may be used uninitialized in this function

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31874 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:46 +02:00
diego 578ad534b3 configure: Rename "network" variable and option to "networking"
This avoids conflicts with the FFmpeg variable of the same name.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31749 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:44 +02:00
reimar 8362b060d4 demux_ts: Improve subtitle support
Make it use the infrastructure for subtitle handling so e.g. switching
subtitles at runtime works and add support for PGS subtitles.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31724 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:44 +02:00
Uoti Urpala 7d17b5e254 demuxer.c: add new_sh_sub_sid_lang
Allocates a new sh_sub and specifies language at the same time. I
don't think this is a particularly good API but add it for easier
compatibility with some svn changes.
2010-11-02 04:14:44 +02:00
reimar 9e537d1f6e subs: Add support for DVB and XSUB subtitles, not yet working properly
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31694 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:43 +02:00
reimar ce19a13986 asfheader, demux_audio: Remove some pointless be2me/le2me
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31685 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:43 +02:00
reimar 5f65cbcc07 demux_pva.c: Remove completely nonsensical le2me usages
The only effect these had was breaking playback on big-endian.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31682 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:43 +02:00