Commit Graph

3789 Commits

Author SHA1 Message Date
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
Clément Bœsch 59fff90d94 options: change -alang and -slang to use string list type
There is no reason to use manual language list splitting when an
automatic split function is already available.

Some types change from "unsigned char" to "char", but this shouldn't
cause issues since [as]lang settings are unlikely to have characters
above 127.
2011-04-20 04:22:42 +03:00
cehoyos 42f97b2b82 codecs.conf, stheader.h: support CrystalHD decoding (libavcodec)
Add the various decoders to codecs.conf and increase the maximum
number of buffered pts in stheader.h (apparently CrystalHD can have
very high decoder lag).

Patch by Philip Langdale, philipl overt org

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33095 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-13 03:21:41 +03:00
reimar 7a3fd839ef audio: do not run the AC-3 parser on byte-swapped AC-3
Libavcodec has no parser that would work on byte-swapped AC3, but at
least don't run the normal AC-3 one which would only break things.

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33027 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-13 03:10:33 +03:00
cehoyos fa0d14555d codecs.conf, mp_taglists.c: add LXF PCM and dvvideo
Support audio in Leitch/Harris' VR native stream format (LXF).

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

Support dvvideo in Leitch/Harris' VR native stream format (LXF).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32991 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-04-12 19:39:30 +03:00
Uoti Urpala 9ef15ac4fc Merge branch 'edl'
* edl:
  core: support timeline with audio-only files
  core: wake up a bit less often for audio-only files
  core: audio: cut audio writes at end of timeline part
  EDL: add support for new EDL file format
  stream.[ch], ass_mp: new stream function for whole-file reads
  tl_matroska.c: move the find_files() function here
  bstr.[ch], path.[ch]: add string and path handling functions
  core: ordered chapters: move timeline creation to timeline/
  options: drop support for numeric -demuxer values
  cleanup: demuxer.[ch]: remove unused code, make functions static
  cleanup: reindent demuxer.h, use struct names for types
2011-04-08 22:50:06 +03:00
Uoti Urpala 511498818f demux_lavf: disable support for byte-based seeking
libavformat returns nonsense per-stream bitrate values for some MPEG
files (0 or many times higher than the overall bitrate of the file),
which triggered the heuristic to enable byte-based seeking in
demux_lavf and then made the byte-based seeks wildly inaccurate.
Disable the support for byte-based seeks. This will avoid problems
with files that have consistent timestamps, but on the other hand will
completely break seeking in MPEG files that have timestamp resets.
I'll probably add at least an option to manually enable byte-based
seeking later.
2011-04-08 02:47:02 +03:00
Uoti Urpala d4b5ee2cd5 demux_mkv: support runtime video track switching
Add code identical to the audio case to also support switching video
tracks at runtime.

Patch by "Hermi".
2011-04-08 02:33:57 +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 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 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
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
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