summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* stream: redo memory streamswm42013-06-284-8/+92
| | | | | Make memory streams actual streams. This causes fewer weird corner cases and actually allows using demuxers with them.
* options: rename --mkv-subtitle-preroll, --dtshdwm42013-06-282-32/+41
| | | | We still keep the old names as alias for short-time compatibility.
* options: rename --rawvideo to --demuxer-rawvideo, same with --rawaudiowm42013-06-283-37/+41
|
* options: rename -lavdopts to -vd-lavc, -lavfdopts to -demuxer-lavfwm42013-06-283-104/+98
| | | | | Also change manpage so that top-level options are documented instead of suboptions. Suboptions still work, but might go away eventually.
* options: remove -lavdopts debug suboptionwm42013-06-283-31/+1
| | | | This can be set as avopt instead.
* dec_sub: fix memory leak when using subtitle codepage conversionwm42013-06-281-0/+1
|
* dec_sub: don't print sub charset of it's emptywm42013-06-281-1/+1
|
* configure: fix wasapi0 checksJames Ross-Gowan2013-06-261-6/+6
|
* cocoa_common: schedule a redraw frame after a non live resizeStefano Pigozzi2013-06-251-3/+18
| | | | | | | | | | | A redraw forces recalculation of panscan and other stuff not accounted for in the resize_redraw codepath. This is actually a hack but works really well in my tests. Thanks @wm4 and @Cpuroast for the idea. Fixes #86 [ci skip]
* demux_lavf: add one more AAC mimetypewm42013-06-251-0/+1
|
* Merge branch 'sub_mess2'wm42013-06-2537-924/+1348
|\ | | | | | | ...the return.
| * DOCS: update tech-overview.txt to reflect some subtitle related changeswm42013-06-251-13/+19
| |
| * options: add -sub-speed optionwm42013-06-254-2/+24
| | | | | | | | | | | | | | | | Should we actually get into trouble for unproper handling of frame-based subtitle formats, this might be the simplest way to work this around. Also is a bit more intuitive than -subfps, which might use an unknown, misdetected, or non-sense video FPS. Still pretty silly, though.
| * dec_sub: add hack to display last MicroDVD subtitle eventwm42013-06-251-0/+11
| | | | | | | | The old subreader.c infrastructure handled this in a similar way.
| * sub: libguess support for -subcpwm42013-06-253-1/+57
| | | | | | | | Actually this is rather disappointing.
| * sub: add hack for Libav SRT demuxerwm42013-06-253-1/+102
| | | | | | | | | | | | | | Before this commit, SRT demuxing and display actually happened to work on Libav. But it was using the libavcodec srt converter (which is essentially unmaintained in Libav), and timing postprocessing didn't work. For some background explanations see sd_lavf_srt.c.
| * dec_sub: allow postprocessing between decoderswm42013-06-251-14/+41
| | | | | | | | | | | | | | Until now, timing and charset recoding postprocessing was applied on packets as they were output by the demuxer, and then passed to the decoders. Make it so that postprocessing can happen after some decoders in special situations.
| * dec_sub: change sublist memory allocationwm42013-06-251-10/+9
| |
| * dec_sub: move code aroundwm42013-06-251-45/+51
| |
| * demux_libass: do charset conversion by -subcpwm42013-06-251-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | Old code used to use libass' recoding feature, which is a copy of the old MPlayer code. We dropped that a few commits ago. Unfortunately, this made it impossible to load some subtitle files, like UTF-16 files. Make .ass loading respect -subcp again. We do this by recoding the probe buffer to UTF-8, and then trying to load it normally. (Yep.) Since UTF-16 in particular will effectively half the probe buffer size, double the probe size.
| * sub: prevent subtitle conversion if subs are known UTF-8wm42013-06-253-1/+3
| | | | | | | | | | Currently this happens only in an obscure case (reading UTF-16 files with the old subreader).
| * demux_subreader: remove iconv/enca codewm42013-06-251-154/+1
| | | | | | | | Not needed anymore, done by dec_sub.c instead.
| * sub: add subtitle charset conversionwm42013-06-255-5/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was once part of subreader.c, then traveled to libass, and now made its way back to the fork of the fork of the original code, MPlayer. It works pretty much the same as subreader.c, except that we have to concatenate some packets to do auto-detection. This is rather annoying, but for all we know the actual source file could be a binary format. Unlike subreader.c, the iconv context is reopened on each packet. This is simpler, and with respect to multibyte encodings, more robust. Reopening is probably not a very fast, but I suspect subtitle charset conversion is not an operation that happens often or has to be fast. Also, this auto-detection is disabled for microdvd - this is the only format we know that has binary data in its packets, but is actually decoded to text. FFmpeg doesn't really allow us to solve this properly, because a) the input packets can be binary, and b) the output will be checked whether it's UTF-8, and if it's not, the output is thrown away and an error message is printed. We could just recode the decoded subtitles before sd_ass if it weren't for that.
| * sub: attempt to use video FPS for frame based subtitle formatswm42013-06-253-0/+6
| | | | | | | | | | This only affects demux_subreader.c for now. Maybe there is some hope this can be used for libavformat demuxers too, but I'm not sure yet.
| * sub: add demux_libass wrapper, drop old hackswm42013-06-2514-177/+131
| | | | | | | | | | | | | | | | | | | | | | | | demux_libass.c allows us to make subtitle format detection part of the normal file loading process. libass has no probe function, but trying to load the start of a file (the first 4 KB) is good enough. Hope that libass can even handle random binary input gracefully without printing stupid log messages, and that the libass parser doesn't accept too many non-ASS files as input. This doesn't handle the -subcp option correctly yet. This will be fixed later.
| * core: don't set correct-pts mode randomlywm42013-06-252-5/+8
| | | | | | | | | | | | The default correct-pts mode depended on which demuxer was opened last. Often this is the subtitle demuxer. The correct-pts mode should be decided on the demuxer for video instead.
| * subreader: turn into actual demuxerwm42013-06-258-202/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subreader.c (before this commit renamed to demux_subreader.c) was special cased to the -sub option. The plan is using the normal demuxer codepath for all subtitle formats (so we can prefer libavformat demuxers for most formats). There are some subtle changes. The probe size is restricted to 32 KB (instead of unlimitted + giving up after 100 lines of input). For formats like MicroDVD, the video FPS isn't used anymore, because it's not available on the subtitle demuxer level. Instead, hardcode it to 23.976 FPS (libavformat seems to do the same). The user can probably still use -sub-fps to fix the timing. Checking the file extension for ".utf"/".utf8"/".utf-8" is simply removed (seems worthless, was in the way, and I've never seen this anywhere).
| * demux: add utility functions for preloading demuxerswm42013-06-252-5/+81
| | | | | | | | | | These will be needed by subtitle demuxers, which read all data on initialization.
| * stream: remove stream_unread_buffer()wm42013-06-252-21/+0
| | | | | | | | Replaced with stream_peek().
| * demux_lavf: use stream_peek() instead of read/unreadwm42013-06-251-6/+4
| | | | | | | | | | | | | | Simpler, reduces the amount of copying. We still have to malloc+memcpy the probe buffer though, because padding with FF_INPUT_BUFFER_PADDING_SIZE is required by libavformat.
| * stream: add stream_peek functionwm42013-06-252-0/+35
| | | | | | | | | | Makes probing easier, and this is perhaps a simpler interface than stream_unread_buffer().
| * stream: never let read functions return values < 0wm42013-06-251-3/+5
| | | | | | | | | | | | | | | | | | | | stream_read_unbuffered() can sometimes return negative values on error. Change that to return 0 - the negative values are nowhere used anyway. If distinguishing errors and EOF is really needed, a flag could be added instead. This also fixes the stream_read_partial() call in cache.c, which assumes the return values is always >= 0.
| * stream: readd memory streamswm42013-06-252-5/+21
| |
| * Move/rename subreader.cwm42013-06-258-6/+3
| |
| * sd_ass: fix nonsensewm42013-06-251-1/+4
| | | | | | | | | | | | Actually check the newly added text for whitespace, and not the uninitialized buffer after it. Also, if an even is only whitespace, don't add it at all.
| * sd_ass: disable special handling of subtitles with duration 0wm42013-06-252-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sd_ass contains some code that treats subtitle events with duration 0 specially, and adjust their duration so that they will disappear with the next event. This is most likely not needed anymore. Some subtitle formats allow omitting the duration so that the event is visible until the next one, but both subreader.c as well as libavformat subtitle demuxers already handle this. Subtitles embedded in mp4 files (movtext) used to trigger this code. But these files appear to export subtitle duration correctly (at least libavcodec's movtext decoder is using this assumption). Since commit 6dbedd2 changed demux_lavf to actually copy the packet duration field, the code removed with this commit isn't needed anymore for correct display of movtext subtitles. (The change in sd_movtext is for dropping empty subtitle events, which would now be "displayed" - libavcodec does the same.) On the other hand, this code incorrectly displayed hidden events in .srt subtitles. See for example the first event in SubRip_capability_tester.srt (part of FFmpeg's FATE). These intentionally have a duration of 0, and should not be displayed. (As of with this commit, they are still displayed in external .srt subs because of subreader.c hacks.) However, we can't be 100% sure that this code is really unneeded, so just comment the code. Hopefully it can be removed if there are no regressions after some weeks or months.
| * sd_ass: handle libavformat ASS comment packets as wellwm42013-06-232-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | Currently, we are filtering libavformat style ASS packets by checking whether they are prefixed "Dialogue: ". Unfortunately, comment packets are demuxed too. These start with "Comment: ", so they are not caught. Change the filtering, and use the codec ID instead. libavformat uses "ssa" as codec ID for ASS subtitles, while mpv uses "ass". Also, at least FFmpeg will change the ASS packet format to the same format mpv and Matroska use, and identify these with "ass" as codec ID, so this is works out nicely.
| * subreader: remove overlap handling codewm42013-06-231-243/+3
| | | | | | | | | | | | | | | | | | | | | | Some of this (fixing timing) is now done in dec_sub.c (although it's not active for subreader.c code yet - this will be fixed when subreader.c subs are read through a demuxer wrapper). Another reason to remove this is that this code doesn't do much good anymore. libass does handle overlap, and trying to fold overlapping lines into single subtitle events will prevent libass from handling this properly.
| * sub: do some timing postprocessing on preloaded subswm42013-06-233-13/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the -subfps option (which unfortunately is still useful), and fixes minor annoying timing errors (which unfortunately still happen). Note that none of these affect ASS or image subtitles. ASS is specially handled: libass loads subtitles as ASS_Track. There are no actual packets passed around, and sd_ass just uses the ASS_Track. Disable the --sub-no-text-pp option. It's misleading now and always was completely useless.
| * sub: preload external text subtitleswm42013-06-235-2/+109
| | | | | | | | | | | | | | | | If a subtitle is external, read it completely and add all subtitle events in advance when the subtitle track is selected. This is done for text subtitles only. (Note that subreader.c and subtitles loaded with libass are different and don't have anything to do with this commit.)
| * sub: remove redundant conditionwm42013-06-231-2/+2
| |
| * stream: remove padding parameter from stream_read_complete()wm42013-06-239-25/+24
| | | | | | | | | | | | | | | | Seems like a completely unnecessary complication. Instead, always add a 1 byte padding (could be extended if a caller needs it), and clear it. Also add some documentation. There was some, but it was outdated and incomplete.
| * demux: don't require fill_buffer callbackwm42013-06-233-13/+1
| |
* | cache: cache number of chapterswm42013-06-241-0/+10
| | | | | | | | | | | | | | | | | | Querying this caused the cache to block and wait. Some parts of the frontend (like progress bar) call this very often, so cache performance was ruined in these cases. Also print a message in -v mode when the cache is blocked for a STREAM_CTRL. This should make debugging similar issues easier.
* | av_log: change how ffmpeg log messages are formattedwm42013-06-221-4/+8
| | | | | | | | | | | | | | | | | | | | Don't print the ffmpeg context pointer as %p. This is usually useless and confusing. Prefix all messages with "ffmpeg" to make clear that ffmpeg is printing these messages, and not us. If libavcodec is from Libav, use "libav" as prefix instead. (In theory, FFmpeg/Libav libraries could be mixed, but I don't think that is actually possible in practice.)
* | configure: cocoa: link to libarcliteStefano Pigozzi2013-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | libarclite provides method stubs for the Subscripting headers added in 0407869ae3. This allows to correclty build mpv on OSX 10.7 (I had tested that commit with OSX 10.8 running 10.7 SDK). It seems on 10.8 this option does't make any difference in the linked libraries (checked with otool -L) so I just add it unconditionally. Warning: This doesn't mean mpv moved to ARC. To do that one would have to add `-fobjc-arc` to the cflags.
* | ildetect: $ILDETECT_RUN_INTERLACED_ONLY to only run the job if not progressiveRudolf Polzer2013-06-211-4/+10
| |
* | ildetect.sh: add a quiet mode; verify telecine decisionRudolf Polzer2013-06-201-5/+18
| | | | | | | | | | | | | | For quiet mode: ILDETECT_QUIET=1 ildetect.sh ... Telecine decision (guess by ildetect.so) is verified by retrying the ildetect run with the pullup filter inserted.
* | ildetect.sh: skip needlessly going through vo_lavcRudolf Polzer2013-06-201-2/+2
| | | | | | | | | | We can now turn off encoding mode by command line and use vo_null instead.
* | encoding: use --start for ratios, etc.Rudolf Polzer2013-06-202-7/+24
| | | | | | | | | | Note: this currently only works for formats without pts resets. Other formats will ignore this code.
* | command line: allow --o= to disable encoding (i.e. empty string file name)Rudolf Polzer2013-06-201-3/+3
| |
* | encode_lavc: simplify encoding status output; remove percentageRudolf Polzer2013-06-204-19/+18
| |
* | ildetect.sh: better interlace detection rangeRudolf Polzer2013-06-201-1/+1
| |
* | ildetect.sh: env vars supportRudolf Polzer2013-06-201-8/+35
| |
* | OSX: fix compilation with 10.7 SDKStefano Pigozzi2013-06-194-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work in the OS X parts of the code started using clang's support for Obj-C's support for Literals and Subscripting. These particular language features remove a lot of boilerplate code and allow to interact with collections as consicely as one would do in scripting languages like Ruby or Python. Even if these are compiler features, Subscripting needs some runtime support. This is provided with libarclite (coming with the compiler), but we need to add the proper method definitions since the 10.7 SDK headers do not include them. That is because 10.7 shipped before this language features. This will cause some warnings when compiling with the 10.7 SDK because the commit also redefines BOOL to make autoboxing/unboxing of BOOL literals to work. If you need to test this for whatever reason on 10.8, just pass in the correct SDK to configure's extra cflags: ./configure --extra-cflags='-mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' Fixes #117
* | ao_wasapi0: add new wasapi event mode aoJonathan Yong2013-06-184-1/+892
| |
* | vo_lavc: remove unused variablewm42