Commit Graph

32907 Commits

Author SHA1 Message Date
Uoti Urpala f06fe7f80e TOOLS/matroska.py: recognize CodecName 2011-04-08 01:20:35 +03:00
Uoti Urpala 52f11f73b1 core: audio: cut audio writes at end of timeline part
Cut audio data written to AO at the point where current timeline part
ends (before, AO buffers were always completely filled, but playback
of the "extra" audio was then cut short by resetting the AO when
switching timeline parts). This doesn't make much difference for
current playback behavior, but will be used by timeline support for
audio-only files and is necessary for future encoding support where
"playback" of written audio cannot be aborted later.
2011-04-07 21:17:51 +03:00
Uoti Urpala 968154ba77 EDL: add support for new EDL file format
The timeline code previously added to support Matroska ordered
chapters allows constructing a playback timeline from segments picked
from multiple source files. Add support for a new EDL format to make
this machinery available for use with file formats other than Matroska
and in a manner easier to use than creating files with ordered
chapters.

Unlike the old -edl option which specifies an additional file with
edits to apply to the video file given as the main argument, the new
EDL format is used by giving only the EDL file as the file to play;
that file then contains the filename(s) to use as source files where
actual video segments come from. Filename paths in the EDL file are
ignored. Currently the source files are only searched for in the
directory of the EDL file; support for a search path option will
likely be added in the future.

Format of the EDL files

The first line in the file must be "mplayer EDL file, version 2".
The rest of the lines belong to one of these classes:
1) lines specifying source files
2) empty lines
3) lines specifying timeline segments.

Lines beginning with '<' specify source files. These lines first
contain an identifier used to refer to the source file later, then the
filename separated by whitespace. The identifier must start with a
letter. Filenames that start or end with whitespace or contain
newlines are not supported.

On other lines '#' characters delimit comments. Lines that contain
only whitespace after comments have been removed are ignored.

Timeline segments must appear in the file in chronological order. Each
segment has the following information associated with it:
- duration
- output start time
- output end time (= output start time + duration)
- source id (specifies the file the content of the segment comes from)
- source start time (timestamp in the source file)
- source end time (= source start time + duration)
The output timestamps must form a continuous timeline from 0 to the
end of the last segment, such that each new segment starts from the
time the previous one ends at. Source files and times may change
arbitrarily between segments.

The general format for lines specifying timeline segments is
[output time info] source_id [source time info]
source_id must be an identifier defined on a '<' line. Both the time
info parts consists of zero or more of the following elements:
1) timestamp
2) -timestamp
3) +duration
4) *
5) -*
, where "timestamp" and "duration" are decimal numbers (computations
are done with nanosecond precision). Whitespace around "+" and "-" is
optional. 1) and 2) specify start and end time of the segment on
output or source side. 3) specifies duration; the semantics are the
same whether this appears on output or source side. 4) and 5) are
ignored on the output side (they're always implicitly assumed). On the
source side 4) specifies that the segment starts where the previous
segment _using this source_ ended; if there was no previous segment
time 0 is used. 5) specifies that the segment ends where the next
segment using this source starts.

Redundant information may be omitted. It will be filled in using the
following rules:
- output start for first segment is 0
- two of [output start, output end, duration] imply third
- two of [source start, source end, duration] imply third
- output start = output end of previous segment
- output end = output start of next segment
- if "*", source start = source end of earlier segment
- if "-*", source end = source start of a later segment

As a special rule, a last zero-duration segment without a source
specification may appear. This will produce no corresponding segment
in the resulting timeline, but can be used as syntax to specify the
end time of the timeline (with effect equal to adding -time on the
previous line).

Examples:
----- begin -----
mplayer EDL file, version 2
< id1 filename

  0 id1 123
100 id1 456
200 id1 789
300
-----  end  -----
All segments come from the source file "filename". First segment
(output time 0-100) comes from time 123-223, second 456-556, third
789-889.

----- begin -----
mplayer EDL file, version 2
< f filename
f  60-120
f 600-660
f  30- 90
-----  end  -----
Play first seconds 60-120 from the file, then 600-660, then 30-90.

----- begin -----
mplayer EDL file, version 2
< id1 filename1
< id2 filename2

+10 id1 *
+10 id2 *
+10 id1 *
+10 id2 *
+10 id1 *
+10 id2 *
-----  end  -----
This plays time 0-10 from filename1, then 0-10 from filename1, then
10-20 from filename1, then 10-20 from filename2, then 20-30 from
filename1, then 20-30 from filename2.

----- begin -----
mplayer EDL file, version 2
< t1 filename1
< t2 filename2

t1 * +2            # segment 1
+2 t2 100          # segment 2
t1 *               # segment 3
t2 *-*             # segment 4
t1 3 -*            # segment 5
+0.111111 t2 102.5 # segment 6
7.37 t1 5 +1       # segment 7
-----  end  -----
This rather pathological example illustrates the rules for filling in
implied data. All the values can be determined by recursively applying
the rules given above, and the full end result is this:
+2         0-2                 t1  0-2              # segment 1
+2         2-4                 t2  100-102          # segment 2
+0.758889  4-4.758889          t1  2-2.758889       # segment 3
+0.5       4.4758889-5.258889  t2  102-102.5        # segment 4
+2         5.258889-7.258889   t1  3-5              # segment 5
+0.111111  7.258889-7.37       t2  102.5-102.611111 # segment 6
+1         7.37-8.37           t1  5-6              # segment 7
2011-04-05 06:26:17 +03:00
Uoti Urpala e3631231a1 demux_mkv, demux_lavf: don't select initial audio track
Remove code that tries to select audio track during demuxer
initialization from demux_mkv and demux_lavf. Just leave audio
disabled at that point; the higher-level select_audio() function will
call the demuxer to switch track later anyway.

Removing this unneeded code also fixes use of these demuxers as the
main demuxer with -audiofile. Before the automatic track selection
would have enabled an audio track (if the file had any); as the main
demuxer was not used for audio the unused packets from this enabled
track would accumulate until they reached queue size limits.
2011-04-02 22:53:18 +03:00
Uoti Urpala 1bda89eaba core: do proper audio track selection for -audiofile demuxer
The select_audio() call was done on the main demuxer, not -audiofile
one (the "if (mpctx->num_sources)" test in the previous code was
always true). Call it on the -audiofile demuxer instead. The
-audiofile stuff still needs a proper cleanup later though.
2011-04-02 22:26:03 +03:00
Uoti Urpala adc941419d configure: remove old GUI-related options
Remove --with-glib-config, --with-gtk-config, --enable-gui,
--disable-gui, --enable-gtk1, --disable-gtk1. The only one of these
that still had any effect was --enable-gui which printed a warning
about GUI removal and exited. The --with options were still shown in
help output, the rest had already been deleted from that.
2011-04-02 22:09:27 +03:00
Uoti Urpala 1ca838918c demux_mkv: fix uninitialized variable
Commit de42015a97 ("demux_mkv: read tags") added code that
failed to initialize a loop variable. Fix. No visible problems caused
by the bug have been reported.
2011-04-02 19:59:39 +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 b8e1456c25 af_lavcac3enc: fix channel reordering
Reordering to libavcodec channel order was broken with libavcodec
versions using float input to the ac3 encoder because the reordering
code still assumed int16 sample size. Fix.
2011-03-31 23:51:19 +03:00
Uoti Urpala a8b93d4c81 demux_mkv: support Blu-ray subtitles
Recognize "S_HDMV/PGS" CodecID.
2011-03-31 03:44:37 +03:00
Uoti Urpala 9d4d5b4469 demux_mkv: simplify subtitle type recognition
Remove indirection through MATROSKA_SUBTYPE_* and instead set the
per-track type field to the letter identifier used in public sh_sub.
2011-03-31 03:44:37 +03:00
Uoti Urpala 56504de6ff demux_mkv: use generic packet handling code for subtitles
Duration may now be set for packet types other than subtitles; as far
as I can tell nothing should care. A check requiring valid duration
values for subtitles is removed, because duration may not be properly
set for all bitmap subtitle types; hopefully this doesn't make the
behavior with (already broken) subtitles without duration worse.
2011-03-31 03:44:37 +03:00
Uoti Urpala 993bc6a83f demux_mkv: support E-AC-3 audio
Recognize "A_EAC3" CodecID.
2011-03-31 03:44:37 +03:00
Uoti Urpala cb4394aea3 demux_lavf: fix initial "-vid"-based video selection
In 59058b54a7 (from svn r31129) Aurelien
changed demux_lavf -vid indexing, but failed to change the initial
video stream selection based on -vid to match. Fix.
2011-03-31 03:44:37 +03:00
Uoti Urpala 5949f5b9fd demux_lavf: fix stream switch returned index for no sound/video
If the argument given to demux_lavf audio/video switch code is not one
of -2, -1, or valid audio/video ID the code will treat it the same as
-2 (switch to no sound / no video). However the returned index was not
set to -2 in this case. Fix. Also change the returned index from -1 to
-2 when staying at no sound / video.
2011-03-31 03:44:20 +03:00
Uoti Urpala df31b077b4 core, demux: fix video index handling in stream switching
Fix bugs in the handling of stream index values in video stream
switching. This is similar to what commit 90bedd0b87
did for audio.

Also clean up the corresponding audio code a little bit.
2011-03-31 00:13:36 +03:00
Diogo Franco 5c731e2ea6 configure, Windows: support static pthreads on Windows
Windows pthreads requires certain functions to be called to initialize
itself. It can do that through DllMain but no such luck when linked
statically; mplayer needs to call the initialization explicitly.
2011-03-30 14:50:47 +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
Uoti Urpala 16e29bebf0 vo_mga, build: change include from "libavcore" to "libavutil"
Libavcore was merged back to libavutil. Change the mga_template.c
include of libavcore/imgutils.h to match. This means that split
libavcore/libavutil versions won't work any more; but since this only
affects people who enable vo_mga and there was no released version
using the split libs I won't bother with any conditionals for the
include.
2011-03-28 04:13:40 +03:00
Uoti Urpala 17528080d6 Copyright, LICENSE: change binary license to GPL 3
Change license indicated for compiled binaries to GPL 3 to match
talloc.c which is LGPL 3+. Note that at least for now the source
licenses have NOT been changed - almost everything is still GPL 2+ or
compatible, not GPL 3+.
2011-03-24 23:40:29 +02:00
Uoti Urpala 85f4633796 demux_ty: disable -subcc functionality (demux_ty_osd)
Disable compilation of demux_ty_osd.c because of its GPL v2-only
license. This only affects TiVo files with -subcc. After this no
v2-only code should get compiled (yuv4mpeg_intern.h has a v2-only
license, but the contents of the header look like they're not
copyrightable).
2011-03-24 22:23:12 +02:00
Stefano Pigozzi b10b2b5b2c vo_corevideo: add key_modifier_alt only when pressing left option key 2011-03-18 21:59:38 +02:00
Uoti Urpala ea828cbb37 .gitignore: add /cpuinfo
Ignore the "cpuinfo" binary. The configure script can create that on
systems which lack /proc/cpuinfo or equivalent.
2011-03-13 22:20:51 +02:00
Stefano Pigozzi e94a9076dc vo_corevideo: fix menubar showing 2 apples on snow leopard 2011-03-11 20:32:57 +02:00
Uoti Urpala 4c117849b3 stream.[ch], ass_mp: new stream function for whole-file reads
Add new stream_read_complete() function which reads the complete
contents of file. Use that in ass_mp.c which had custom code to do the
same.
2011-03-03 21:39:24 +02:00
Uoti Urpala 5e0a163886 tl_matroska.c: move the find_files() function here
Move the find_files() function from findfiles.c to tl_matroska.c.
Delete the findfiles.c file. Add a check against opendir() failure in
find_files().
2011-03-03 21:38:52 +02:00
Stefano Pigozzi cf664986ae vo_corevideo: support modifier keys in keyboard input 2011-03-03 13:27:30 +02:00
Uoti Urpala afef26425d core: hr-seek: fix soft hang with hrseek past EOF
When doing a precise seek video_out->frame_loaded was left to true
while frames were being skipped. However vo_get_buffered_frame()
always returns success if a frame is already loaded; due to this the
EOF detection in update_video() never triggered, and a hr-seek past
EOF could cause a soft hang (commands were still processed and it was
possible to seek again to exit the loop). This could also happen with
Matroska files using ordered chapters if an underlying file was
actually shorter than the chapter that was supposed to come from it.
Then seeking to a timestamp after the end of the file but before the
end of the chapter would trigger the bug.

Fix the problem by setting frame_loaded to false when we decide to
skip the frame in question.
2011-03-03 12:54:36 +02:00
Uoti Urpala 9f6b8e30d2 configure: remove --ffmpeg-source-dir help output
As things currently are the --ffmpeg-source-dir option will cause a
compilation failure. Maybe the video filters that depend on internal
FFmpeg headers to work should be deleted completely; for now I'll
remove the option from the help output as it can only confuse normal
users.
2011-03-01 23:56:41 +02:00
Uoti Urpala b27e4ca371 libdvdcss: drop internal libdvdcss tree
The internal libdvdcss version was only compiled if you used internal
libdvdread too; and libdvdread was not included in the sources, so
that'd only happen if you manually added libdvdread in the build
tree. Keeping libdvdcss for that case probably isn't worth it, so
delete it from the tree. The build system part is still there, so an
internal build is possible if you add the directory back.
2011-03-01 22:37:15 +02:00
Uoti Urpala 962eec0440 bstr.[ch], path.[ch]: add string and path handling functions
Add some new string and path handling functions to be used in
following commits.

Use new path handling functions to simplify find_files().
2011-02-26 16:40:31 +02:00
Uoti Urpala e8af22db81 core: ordered chapters: move timeline creation to timeline/
Add new file timeline/tl_matroska.c. Move the code that parses
ordered chapter information from Matroska files and creates the
timeline structure based on that to the new file.

Initialize the format parameter given to open_stream() in the moved
code. The previous uninitialized value shouldn't have caused any
visible effects.
2011-02-26 16:34:42 +02:00
Uoti Urpala f7643ddde6 options: drop support for numeric -demuxer values
Drop support for specifying demuxer types by numeric ID (options
-demuxer, -audio-demuxer and -sub-demuxer). Stop printing the numeric
values in "-demuxer help" output. Convert the list of DEMUXER_TYPE_XXX
defines to "enum demuxer_type".
2011-02-22 15:16:41 +02:00
Uoti Urpala 5177b24b25 cleanup: demuxer.[ch]: remove unused code, make functions static
Remove some unused lines from demuxer.h. Make some demuxer.c functions
static. Move new_ds_stream() declaration from demuxer.h to stream.h
(the function is defined in stream.c). Clean up some code in mplayer.c
that had commented-out free_demuxer_stream() calls.
2011-02-22 15:16:41 +02:00
Uoti Urpala 496b09e04d cleanup: reindent demuxer.h, use struct names for types
Reindent demuxer.h and also change some comments. Change some types
from 'foo_t' to 'struct foo'.
2011-02-22 15:16:41 +02:00
Uoti Urpala e786c70de9 build: change version number generation
Force Makefile to always run version.sh to potentially regenerate
version.h. Drop compiler version and 'git-' prefix from version
number. Match only git tags starting 'v'+number when generating
version number; leave the 'v' out from the result.
2011-02-19 19:07:12 +02:00
Uoti Urpala d9c79b7dc6 configure: fix --enable-libvorbis with tremor installed
Autodetected libvorbis prevented tremor test from running, but
--enable-libvorbis didn't. Add an explicit check to disable tremor in
that case.
2011-02-18 16:16:30 +02:00
Uoti Urpala a3e92c22b2 .gitignore: add /po and /locale 2011-02-15 21:28:57 +02:00
Uoti Urpala bb79b19817 terminal output: change program name to "MPlayer2" 2011-02-15 19:38:59 +02:00
cehoyos 8affafc2a8 codecs.conf: Add FFmpeg WC4 xan decoder
Patch by Philip Langdale, philipl overt org

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32875 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:30:57 +02:00
reimar 7781f23d68 demux_ts: change DVB SPU format for libavcodec
Change DVB SPU stream format in TS demuxer so it can be decoded by
libavcodec (as soon as lavc is fixed not to fail just because of an
extra padding byte).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32866 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:30:01 +02:00
reimar 9e2b74b073 subs: Print a message when lavc subtitle decoding fails
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32865 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:28:59 +02:00
reimar 7b49d6763a demux_ts: DVB and PGS subtitle fixes
Fix r32587: the previous approach to return subtitles in time broke
DVB subtitles due to returning incomplete packets and even for
PGS subtitles resulted in incorrect pts values for the sub packets.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32864 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:25:15 +02: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
reimar f04d70ace1 demux_ts: Set subtitle stream type correctly for DVB subtitles
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32862 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:23:43 +02:00
diego 30f9c5cd2b cleanup: remove some casts of memalign() return value
Do not pointlessly cast the return value of memalign().
memalign() returns void*, which is compatible with any pointer in C.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32850 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:20:37 +02:00
compn 8aac9fae9b codecs.conf: add apco, ap4h, ai55, ai15 fourccs
add apco and ap4h fourcc to prores decoder
add ai55 and ai15 fourcc to h264 docoders

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32843 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:16:49 +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
reimar 005bbf0da4 stream/url.c: escape characters >= 127 in URLs
Escape character values >= 127 in URLs as required by the RFC.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32833 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 18:47:55 +02:00