Commit Graph

3744 Commits

Author SHA1 Message Date
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
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 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
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
reimar 851bb3ce82 demux_asf: add sanity check
Check that rlen is valid before using it to increment a pointer.

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

vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use

demux_real: use ffmpeg_files/intreadwrite.h

stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for
old libavutil versions lacking it
2011-02-08 19:07:10 +02:00
ranma 1c37a03ac6 libmpdemux/mf.c: Don't hardcode filename length
Use limits.h to get the maximum length instead of hardcoding it.
Original patch by Sang-Uok Kum.

Signed-off-by: Tobias Diedrich <ranma@google.com>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32766 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-01-31 16:03:10 +02:00
Uoti Urpala f50f34245e Merge branch 'sub'
* sub:
  sub/OSD: move some related files to sub/
  subtitles: options: enable -ass by default
  subtitles: change default libass rendering style
  demux_mkv, chapters: change millisecond arithmetic to ns
  cleanup: rename ass_* functions to mp_ass_*
  subs: use correct font aspect ratio for libass + converted subs
  cleanup: some random minor code simplification and cleanup
  vf_vo: fix EOSD change detection bug
  sd_ass: remove subreader use, support plaintext markup
  subtitles: style support for common SubRip tags and MicroDVD
  core: ordered chapters: fix bad subtitle parameter
  subs/demux: don't try to enable sub track when creating it
  subtitles/demux: store duration instead of endpts in demux packets
  subtitles: add framework for subtitle decoders
  options: add special -leak-report option
  subtitles: remove code trying to handle text subs with libavcodec
  cleanup: move MP_NOPTS_VALUE definition to mpcommon.h
  subtitles: move global ass_track to struct osd_state
  core: move most mpcommon.c contents to mplayer.c
  core: move global "subdata" and "vo_sub_last" to mpctx
  subtitles: remove sub_last_pts hack
  options: move -noconfig to option struct, simplify
2011-01-26 20:42:15 +02:00
Uoti Urpala c9026cb321 sub/OSD: move some related files to sub/ 2011-01-26 20:39:05 +02:00
Uoti Urpala 304cafd31d demux_mkv, chapters: change millisecond arithmetic to ns
demux_mkv kept various integer timestamps in millisecond units.
Matroska timestamp arithmetic is however specified in nanoseconds
(even though files typically use 1 ms precision), and using ms units
instead of that only made things more complex. Based on the demux_mkv
example the general demuxer-level chapter structure also used ms
units. Change the demux_mkv arithmetic and demuxer chapter structures
to use nanoseconds instead. This also fixes a seeking problem in
demux_mkv with files using a TimecodeScale other than the usual
1000000 (confusion between ms and TimecodeScale*ns units).
2011-01-26 20:39:04 +02:00
Uoti Urpala 75c394df8f demux_ty: fix "seek to negative position" warning
demux_ty relied on demuxer->filepos being initially set to 0, but
demuxer.c has been changed to initialize it to -1. This caused a
"Invalid seek to negative position!" error message when running the
demux_ty file format check (so it occurred for any file which had not
been recognized as another type before that). Fix by making demux_ty
initialize filepos to 0.
2011-01-21 23:07:57 +02:00
Uoti Urpala c0724413fd demux_lavf: reject format probe matches with low score
When trying to determine the format of an input stream, demux_lavf
retries the probe with a larger buffer size up to some limit if the
match score is low, but when reaching the size limit it accepted the
best match (if any) regardless of its score. Change it to require a
score of at least AVPROBE_SCORE_MAX/4 to accept a match at all.
2011-01-21 22:52:15 +02:00
Uoti Urpala b86c9e5922 subs/demux: don't try to enable sub track when creating it
demuxer.c new_sh_sub_sid() tried to immediately select the created sub
track for playback if its id matched the "-sid" option value. This was
buggy, as more initialization is needed to properly enable subtitles.
Normally the correct track to play is selected after the demuxer has
been created. It's possible that some DVD use case or such depended on
the removed code to make -sid work with a subtitle track that's not
found at start and only added later (vobsubs probably would start
playing without separate initialization); if so then that needs to be
fixed later in a different way.
2011-01-18 14:58:09 +02:00
Uoti Urpala 8e7dae173d subtitles/demux: store duration instead of endpts in demux packets 2011-01-18 14:58:09 +02:00
Uoti Urpala e990fb2ffe subtitles: add framework for subtitle decoders
Add a framework for subtitle decoder modules that work more like
audio/video decoders do, and change libass rendering of demuxed
subtitles to use the new framework.

The old subtitle code is messy, with details specific to handling
particular subtitle types spread over high-level code. This should
make it easier to clean things up and fix some bugs/limitations.
2011-01-18 14:58:09 +02:00
Uoti Urpala 757e43c3f8 demux: add sanity checks to packet allocation functions
Change new_demux_packet() and resize_demux_packet() length parameter
type from int to size_t and add a check to abort() if the size is over
1 GB. This should make integer overflow problems leading to memory
corruption in demuxers less likely; and aborting should be no worse
than insane memory consumption. Also make the functions abort() if the
actual allocation fails instead of trying to continue with a
zero-sized buffer.
2011-01-17 16:16:39 +02:00
Uoti Urpala e342a81d6f cleanup: move demux packet functions from demuxer.h to demuxer.c
There's no reason why the demux packet functions would need to be
inlined, so move them from the header to the .c file.
2011-01-17 15:47:57 +02:00
Uoti Urpala e9022ec470 cleanup: move MP_NOPTS_VALUE definition to mpcommon.h 2011-01-15 18:45:43 +02:00
Uoti Urpala 4a26b4c024 cosmetics: remove unused code, small formatting tweaks 2010-12-20 06:42:04 +02:00
Uoti Urpala 1cf4802c1d demux_mkv: remove old code for -nocorrect-pts support
There should be no reason for anyone to use demux_mkv in
-nocorrect-pts mode any more, so delete the code used for that.
2010-12-20 03:14:43 +02:00
Uoti Urpala 042ab4feb5 demux_mkv: fix seeks to before the first index entry
Make seeks backward from a time before the first index entry go to the
first entry instead of failing completely. This change doesn't affect
behavior for most files, because seeks are clamped to 0 from below and
normally files have the first index entry at 0.
2010-12-20 02:26:10 +02:00
reimar 14059eca7a demux_asf: Add a missing free to ASF demuxer close
Fixes bug #1238.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32711 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:24:25 +02:00
reimar 21367beef1 demux_mov: fix possible hang on invalid input
len < 8 is also invalid for 64-bit codec chunk size.
Previous code could cause hang.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32708 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar 7e24b8edb4 aviheader.c: avoid using uninitialized data in an error case
Avoid using uninitialized data if index read does not return enough data.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32707 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar fbd28ae939 demux_mov: fix some memory allocation handling
Always free before overwriting a pointer with a newly allocated one,
always use calloc instead of realloc when the previous data is not
needed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32703 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar 7ed3291a4f demux_gif: Fix memleaks on error
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32701 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar 7ab2c7bc15 demux_ts: change overlapping memcpy to memmove
Replace memcpy with memmove since at least src==dst is possible.
Fixes another issue that is part of bug #1280.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32697 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar ccd5c8566f demux_ts: fix several memleaks
Fixes bug 1280.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32696 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar b4c2cd422e demux_ts: cleanup
Replace malloc+memset with calloc and use sizeof(*variable).

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

Replace hard-coded number for loop limits for array index by
the define used in the array declaration.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32695 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar 68c262c6c4 demux_ts: avoid using unitialized data
Add memset to avoid using uninitialized data with sample in bug 1280.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32693 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar 3474d7e1b5 mp3_hdr.h: fix mp_check_mp3_header()
Fix mp_check_mp3_header: it checked for a byte-swapped MP3-header
on little-endian, and on big-endian it would only accept a MP3-header
that would be valid when read in both directions.
The latter was the reason for bug 905, causing the PS demuxer to
claim files far too agressively (the MP3 check avoiding misdetection
as DV is not exactly a sane approach, but it mostly works).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32692 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar 2b2929fc93 demux_demuxers: Fix crash with -audiofile and audio disabled
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32691 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:19 +02:00
reimar de8ec24998 demux_asf, asfheader.c: cleanup
Move setup of sh_audio->format to a more appropriate place (in asfheader.c).

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

Remove pointless assignments that are already handled in new_sh_audio.

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

Remove useless assignment already done in new_sh_video.

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

Use FFMAX for slightly better readability.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32687 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:18 +02:00
reimar 9a7ed638a6 demux_real: fix some unaligned writes
Fix some unaligned writes and avoid some (incorrect due to alignment) casts.
Might also fix bug #371.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32683 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 06:22:18 +02:00
reimar 41270c50cf demux_audio: Do not generate nonsensical pts values for FLAC
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32678 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 05:28:28 +02:00
reimar 51830c3bff demux_audio: Set needs_parsing to 1 for DTS audio
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32668 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 05:11:08 +02:00
reimar 831395e79b demux-ts: fix TS files with MP4 ES AAC descriptor
Fix TS files with MP4 ES AAC descriptor to be correctly recognized
as AAC and not AAC in LATM.
This fixes playback of http://samples.mplayerhq.hu/A-codecs/AAC/freetv_aac_latm.ts,
actual LATM samples seem unaffected.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32667 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 05:10:18 +02:00
compn 0f1ca625de mp_taglists.c: add tag for svq3
Fixes:
ffmpeg://rtsp://stream.diffusion.ens.fr/2008_10_03_albarede.mov
and other X-SV3V-ES rtsp streams opened with ffmpeg://

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32660 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 04:59:11 +02:00
reimar a17ab46ef3 demux_lavf: Add support for uncompressed BGR24 pixfmt
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32659 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 04:58:42 +02:00
reimar e23bf53fad cosmetics: make some arguments const, "unsigned char"->uint8_t
Mark input-only buffers as const.

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

Use uint8_t type instead of unsigned char.

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

Mark input buffer that is never modified as const.

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

Mark input-only buffer as const.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32655 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 04:57:18 +02:00
reimar 5e6c4de69e demux_avi: Add WAVEFORMATEXTENSIBLE support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32639 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 04:23:53 +02:00
reimar 9ffc22923e demux_audio: fix WAVEFORMATEXTENSIBLE support
Fix WAVEFORMATEXTENSIBLE support on big-endian.

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

Fix WAVEFORMATEXTENSIBLE condition.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32638 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 04:20:24 +02:00
reimar da15a4de00 demux_ts: fix -sb when -aid stream is not found
Make it seek back to the stream->start_pos position instead of 0 in
that case.
Fixes bug 1790.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32635 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-12-16 04:14:01 +02:00