summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demux: improve DVD sub auto-selection hackwm42013-07-114-42/+37
| | | | | | | | | | | | | | | | | | | | | | | The code touched by this commit makes sure that DVD subtitle tracks known by libdvdread but not known by demux_lavf can be selected and displayed properly. These subtitle tracks have the first packet some time late in the packet stream, so that libavformat won't immediately recognize them, and will add the track as soon as the first packet is seen during normal demuxing. demux_mpg used to handle this elegantly: you just set the MPEG ID of the stream you wanted. demux_lavf couldn't do this, so it was emulated with a DEMUXER_CTRL. This commit changes it so that new streams are selected by default (if autoselect is enabled), and the playloop simply can take appropriate action before the lower layer throws away the first packet. This also changes the demux_lavf behavior that subtitle packets are always demuxed, even if not needed. (They were immediately thrown away, so there was no advantage to this.) Further, this adds the ability to demux.c to deal with demuxing more than one stream of a kind at once. (Though currently it's not useful.)
* demux_lavf: use AVDISCARD_DEFAULT instead of AVDISCARD_NONEwm42013-07-111-1/+1
| | | | | | AVDISCARD_DEFAULT is probably a bit better for normal decoding. AVDISCARD_NONE would (as by documentation) include "useless" packets too, while DEFAULT filters these.
* video: eliminate frametime variablewm42013-07-118-21/+9
|
* ad_lavc: re-unsimplify, fix libavcodec API usagewm42013-07-111-2/+19
| | | | | | | | | | | | | | | | | | | | | | It turns out that some code that was removed earlier was still needed. avcodec_decode_audio4() can decode packets "partially". In that case, you have to "slice" the packet and call the decode function again. Codecs which need this are obscure and in low numbers. One sample that needs it is here: rsync://fate-suite.ffmpeg.org/fate-suite/lossless-audio/luckynight-partial.shn (This one decodes in rather small increments.) The new code is much simpler than what has been removed earlier, though. The fact that we own the packet returned by the demuxer helps a lot. Not sure what should happen if avcodec_decode_audio4() returns 0. Currently, we throw away the packet in this case. We don't want to be stuck in an endless loop (could happen if the decoder produces no output either).
* demux: refactorwm42013-07-113-145/+126
|
* core: don't access demux_stream outside of demux.c, make it privatewm42013-07-1113-123/+97
| | | | | | | | | | | | | | | | | | | Generally remove all accesses to demux_stream from all the code, except inside of demux.c. Make it completely private to demux.c. This simplifies the code because it removes an extra concept. In demux.c it is reduced to a simple packet queue. There were other uses of demux_stream, but they were removed or are removed with this commit. Remove the extra "ds" argument to demux fill_buffer callback. It was used by demux_avi and the TV pseudo-demuxer only. Remove usage of d_video->last_pts from the no-correct-pts code. This field contains the last PTS retrieved after a packet that is not NOPTS. We can easily get this value manually because we read the packets ourselves. Reuse sh_video->last_pts to store the packet PTS values. It was used only by the correct-pts code before, and like d_video->last_pts, it is reset on seek. The behavior should be exactly the same.
* tv: add hack in preparation of demux_stream removalwm42013-07-113-4/+25
| | | | | | | | | | Currently, all demuxer fill_buffer functions have a demux_stream parameter. We want to remove that, but the TV code still depends on it. Add a hack to remove that dependency. The problem with the TV code is that reading video and audio frames blocks, so in order to avoid a deadlock, you should read either of them only if the decoder actually requests new data.
* demux_lavf: different hack for DVD sub autoselection hackwm42013-07-111-3/+2
| | | | | | | | | | | For now, we want to get rid of the demux->sub access, because this field will become private to demux.c in a later commit. So replace the current hack with another hack. The need for the hack will be removed sooner or later. (Instead of autoselecting a specific stream, all new streams will be enabled by default, so that no packets can get lost. The frontend will then be responsible to deselect unwanted streams.)
* mplayer: invert negated boolean variablewm42013-07-111-10/+10
| | | | | Boolean variables shouldn't carry a negated meaning, so rename non_interleaved to interleaved.
* mplayer: fix incorrect audio sync after format changeswm42013-07-114-12/+9
| | | | | | | | | | | This is not directly related to the handling of format changes itself, but playing audio normally after the change. This was broken: the output byte rate was not recalculated, so audio-video sync was simply broken. Fix this by calculating the byte rate on the fly, instead of storing it in sh_audio. Format changes are relatively common (switches between stereo and 5.1 in TV recordings), so this fixes a somewhat critical bug.
* ad_spdif: better PTS syncwm42013-07-111-1/+3
| | | | | | | | | | | pts_bytes can't just be changed at the end. It must be offset to the pts value, which is reset with each packet read from the demuxer. Make sure the pts_byte field is always reset after receiving a new PTS, i.e. increment it after actually writing to the output buffer. Flush the AVFormatContext's write buffer, because otherwise the audio PTS will jump around too much: the calculation doesn't use the exact output buffer size if there's still data in the avio buffer.
* mplayer: remove "old" audio PTS calculation codewm42013-07-111-27/+9
| | | | | | | | Removing this code doesn't change anything. All remaining audio decoders are well-behaved enough to not overwrite sh_audio->pts if they don't know the PTS. And if they don't know the PTS, the d_audio->last_pts field can't contain any usable value either, because both fields contain theame value: the last known valid PTS found in an audio packet.
* mplayer: don't set bogus video pts after seek resetwm42013-07-111-5/+2
| | | | | | As the comment n the removed code says, this was once needed for something subtitle related. This code has been cleaned up long ago, so at least the original reason for it is gone.
* demux: remove facility for partial packet readswm42013-07-1111-283/+126
| | | | | | | | | | | | | | | | | | Partial packet reads were needed because the video/audio parsers were working on top of them. So it could happen that a parser read a part of a packet, and returned that to the decoder. With libavformat/libavcodec, packets are already parsed, and everything is much simpler. Most of the simplifications in ad_spdif could have been done earlier. Remove some other stuff as well, like the questionable slave mode start time reporting (could be replaced by proper code, but we don't bother). Remove the unused skip_audio_frame() functionality as well (it was used by old demuxers). Some functions become private to demux.c, like demux_fill_buffer(). Introduce new packet read functions, which have simpler semantics. Packets returned from them are owned by the caller, and all packets in the demux.c packet queue are considered unread. Remove special code that dropped subtitle packets with size 0. This used to be needed because it caused special cases in the old code.
* core: remove demux_mpg subtitle PTS hackwm42013-07-101-23/+4
| | | | | | | | | This code used to be part of the demux_mpg and vobsub specific code path. Then (just recently) the different code paths for subtitles were merged, so this code became active even for demux_lavf and demux_mkv. As far as I can tell, this code won't help much, and at least sd_lavc (which will be used for DVD subs and other potentially weird things) can deal with NOPTS values.
* core: simplify some no-correct-pts codewm42013-07-101-33/+13
| | | | | | | | | | | | | | Remove the special handling for mng/mkv. These don't profit at all from no-correct-pts mode, and even removing the mkv specific code makes mkv work better (wow!). Don't check for (int)fps == 1000. I don't know where this value comes from. Maybe it was once a special value which triggered certain behavior, but the code for that must have gone away. The only way to trigger this value would be by coincidence if two frames are 1 ms apart. Otherwise, the behavior should be exactly the same, except for some removed messages.
* core: move code from demux/video.c to mplayer.cwm42013-07-104-98/+63
| | | | | Although I don't like putting even more crap into mplayer.c, this is a bit better, especially with coming cleanups in mind.
* ad_lavc: simplifywm42013-07-101-30/+5
| | | | | | | | | We don't need to deal with partial packet reads, manually using an audio parser, or having to call the libavcodec decoder multiple times per packet. Actually, I'm not sure about the last point. ffplay still does this, but the ffmpeg demuxing.c example doesn't.
* ms_hdr: remove unused definitionswm42013-07-101-46/+0
|
* demux: remove ds_read_packet()wm42013-07-103-21/+15
|
* audio: remove decoder input bufferwm42013-07-104-21/+2
| | | | This was unused.
* demux: remove some more minor unused thingswm42013-07-104-16/+0
|
* options: remove --ignore-startwm42013-07-085-21/+0
| | | | This was used only with demux_avi.
* Merge branch 'master' into remove_old_demuxerswm42013-07-0825-2196/+2487
|\ | | | | | | | | | | Conflicts: DOCS/man/en/changes.rst DOCS/man/en/options.rst
| * configure: fix oversight in log messagewm42013-07-081-1/+1
| |
| * command: add screenshot_to_file commandwm42013-07-088-28/+116
| |
| * input: actually copy sub commandswm42013-07-081-0/+12
| | | | | | | | | | | | | | | | | | This was missing from the previous commit. It worked by luck, because the sub-commands weren't freed either (as long as the original command was around), but this is proper. Also, set the original string for command lists (needed for input-test only).
| * cache: fix compilation without posix timersStefano Pigozzi2013-07-081-0/+1
| | | | | | | | | | | | This is a regression caused by 854303a. This commit removed the include of `sys/time.h` which was included in `cache.c` through a chain of recurvive includes.
| * input: allow binding multiple commands to a keywm42013-07-084-6/+74
| | | | | | | | Separate the commands with ';'.
| * configure: make zlib non-optionalwm42013-07-081-1/+1
| | | | | | | | | | | | This is needed by demux_mkv to decode files with compressed tracks. Requested by nikoli.
| * Merge remote-tracking branch 'origin/low_quality_intel_crap'Martin Herkt2013-07-082-14/+17
| |\ | | | | | | | | | | | | Conflicts: video/out/gl_video_shaders.glsl
| | * Merge branch 'master' into low_quality_intel_crapwm42013-04-30147-7124/+7534
| | |\ | | | | | | | | | | | | | | | | | | | | Conflicts: video/out/gl_video_shaders.glsl video/out/vo_opengl.c
| | * | vo_opengl: avoid texture arrays for compatibility with Intel low quality crapwm42013-03-052-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a0b43a1 changed textures to an array, because additional per-texture information was needed and managing this as array is more elegant. This broke playback on Windows with Intel drivers (window shows green video, even though subtitles/OSD work correctly). So change it back to make it work again. Affected driver: Intel(R) HD Graphics 3000 9.17.10.2932
| * | | manpage: proofread and fix formattingMartin Herkt2013-07-089-2124/+2246
| | | |
| * | | stream/tv: remove unused dshow-specific optionsMartin Herkt2013-07-082-26/+1
| | | |
| * | | sub: Do not use deprecated “Sans” fontconfig aliasMartin Herkt2013-07-081-1/+1
| | | |
| * | | stream_radio: fix buildwm42013-07-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was accidentally broken with 37c5c11 and has been nroken for 5 months. Does anyone (want to) use this at all?
| * | | configure: fix previous commitwm42013-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This doesn't help if -pthread is omitted. (Apparently, glibc 2.17, on which I tested the previous commit, doesn't require -lpthread in order to use pthreads either.)
| * | | configure: link with -lrtwm42013-07-081-0/+16
| | | | | | | | | | | | | | | | | | | | In order to use clock_gettime() (which we need for use with pthread_cond_timedwait()), most glibc versions need to link with -lrt.
| * | | Fix building with --disable-libasswm42013-07-081-0/+2
| | | | | | | | | | | | | | | | Obscure corner case, but in theory we support this.
* | | | demux: simplify demux_open() callswm42013-07-086-47/+15
| | | | | | | | | | | | | | | | | | | | | | | | The demux_open as well as demux_open_withparams calls don't use the stream selection parameters anymore, so remove them everywhere. Completes the previous commit.
* | | | demux: remove separate arrays for audio/video/sub streams, simplifywm42013-07-0812-134/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These separate arrays were used by the old demuxers and are not needed anymore. We can simplify track switching as well. One interesting thing is that stream/tv.c (which is a demuxer) won't respect --no-audio anymore. It will probably work as expected, but it will still open an audio device etc. - this is because track selection is now always done with the runtime track switching mechanism. Maybe the TV code could be updated to do proper runtime switching, but I can't test this stuff.
* | | | demux: merge functionswm42013-07-081-17/+9
| | | |
* | | | demux: remove unused functionwm42013-07-081-5/+0
| | | |
* | | | demux: remove video_read_propertieswm42013-07-083-23/+13
| | | |
* | | | demux: remove some old stream header functionswm42013-07-087-47/+14
| | | |
* | | | demux: remove audio parserwm42013-07-086-104/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The audio parser was needed only by the "old" demuxers, and demux_rawaudio. All other demuxers output already parsed packets. demux_rawaudio is usually for raw audio, so using a parser with it doesn't usually make sense. But you can also force it to read compressed formats with fixed packet sizes, in which case the parser would have been used. This use case is probably broken now, but you will be able to do the same thing with libavformat demuxers.
* | | | Remove old demuxerswm42013-07-0737-10597/+38
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete demux_avi, demux_asf, demux_mpg, demux_ts. libavformat does better than them (except in rare corner cases), and the demuxers have a bad influence on the rest of the code. Often they don't output proper packets, and require additional audio and video parsing. Most work only in --no-correct-pts mode. Remove them to facilitate further cleanups.
* | | stream: unbreak streams with large sector sizes (stream_cdda)wm42013-07-071-1/+2
| | | | | | | | | | | | | | | | | | | | | Commit 7b16d4b changed some stream implementations to check the buffer size passed to them. This made stream_cdda stop working, because the default buffer size is smaller than the CDIO frame size. So pass the sector size instead of the (arbitrary) default buffer size.
* | | osdep: remove unused mmap compatibility hackswm42013-07-075-176/+1
| | | | | | | | | | | | | | | | | | | | | Not sure how this worked. Only af_export.c and tvi_v4l2.c were using mmap, but they didn't include osdep/mmap.h or mmap_anon.h. In any case, we trust that the target system is sufficiently POSIX compliant if mmap is actually defined (as checked by configure).
* | | configure: simplify arch macroswm42013-07-071-33/+12
| | |
* | | configure: prune some more crapwm42013-07-071-45/+0
| | | | | | | | | | | | All of the removed lines are hopefully useless and didn't do anything.
* | | stream: don't treat position 0 speciallywm42013-07-071-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Seeking to position 0 meant to try reconnecting with some streams, actually just the internal http implementation. This