summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
Commit message (Collapse)AuthorAgeFilesLines
* audio: FLAC: support new libavcodec parser, use lavf to demuxUoti Urpala2010-12-091-0/+3
| | | | | Parse FLAC data with new libavcodec parser if needed. Use libavformat demuxer for raw FLAC files by default.
* demux: fix initial subtitle track selectionUoti Urpala2010-11-161-4/+4
| | | | | | | | | | Commit 3c2cfee488 ("demux: improve -alang / -slang track choosing logic") had a copy/paste error which left the subtitle code using audio variables and broke initial subtitle track selection. Fix. I actually realized soon after creating the original commit that I'd forgotten to change the variables and went back to fix it, but then somehow thought that it was already OK and didn't change it...
* core: give pts as parameter to demuxer_get_current_chapter()Uoti Urpala2010-11-131-6/+2
| | | | | | | | | demuxer_get_current_chapter() accessed sh_video/sh_audio pts fields to determine playback position. demux layer shouldn't access those and the values used weren't quite correct anyway. Give the playback position as a parameter to the demux layer function instead. Also change the top-level get_current_chapter() to use get_current_time() in the timeline case where it didn't refer to demux layer.
* options: move -cache-min and cache-seek-min to option structClément Bœsch2010-11-111-5/+2
|
* options: move [no]hr-mp3-seek to option structClément Bœsch2010-11-111-3/+1
|
* options: move some demux options to option structClément Bœsch2010-11-111-37/+27
| | | | | Following options were moved: audiofile, audiofile-cache, subfile, demuxer, audio-demuxer, sub-demuxer, [no]extbased.
* demux: change "%s file format detected" messageUoti Urpala2010-11-101-2/+6
| | | | | | | | | "libavformat file format detected" wasn't a very useful message due to the many file formats supported to libavformat. Change the message so that for demux_lavf it says something like "Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat)" (using long name from FFmpeg), and for non-lavf something like "Detected file format: Matroska".
* demuxer.c: clean up demux_open_stream()Uoti Urpala2010-11-101-136/+98
| | | | | Refactor the code to avoid duplication. Behavior should be mostly the same as before.
* demux: error out if given invalid -demuxer optionUoti Urpala2010-11-101-0/+5
| | | | | | | | | The code choosing the demuxer to use only printed an error if given an unknown demuxer name, then continued with default demuxer selection. Change it to abort instead. This feels like more sensible behavior. Also there's no fallback to autodetection in the case where the demuxer name is recognized but the demuxer fails to open the file either.
* demux: improve -alang / -slang track choosing logicUoti Urpala2010-11-081-47/+40
| | | | | | | | | | | | When -alang / -slang was specified the numerically first matching track (if any) was always chosen. This meant that specifying "-alang eng" could change the track choice even if all tracks were in English, because now the default flag of tracks was ignored. Change the logic to take the default flag into account as a secondary sorting key. The code also accepted prefix matches, so that "-slang g" would match track language "ger". I think that was not intentional. Change it to require exact matches.
* core: move video pos/length query functions from demux to coreUoti Urpala2010-11-081-63/+0
| | | | | | | | | Move functions to query current playback position, percentage position and total video length from from the demuxer layer to top level. The functions need access to playback state that doesn't belong on the demuxing level. Make the new functions more capable and simplify some code that can now rely on them. This fixes some errors in displayed in OSD and slave mode information when using timeline (ordered chapters).
* demux: fix -correct-pts autoselection with -audiofileUoti Urpala2010-11-081-1/+1
| | | | | | Make demuxer-based -correct-pts autoselection base the decision on the video demuxer in case several are being used, such as with -audiofile.
* demuxer.c: add missing parser list fourccscehoyos2010-11-081-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32596 b3059339-0415-0410-9bf9-f77b7e298cf2
* demuxer.c: fix parser list fourcc typo: 'MPE '->'MP3 'cehoyos2010-11-081-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32595 b3059339-0415-0410-9bf9-f77b7e298cf2
* demuxer.c: Add support for parsing LATMreimar2010-11-081-0/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32582 b3059339-0415-0410-9bf9-f77b7e298cf2
* build: enable/disable all FFmpeg libraries togetherUoti Urpala2010-11-021-9/+9
| | | | | | | | | Enable all of libavcodec, libavformat, libswscale, and libpostproc together (libavutil is always required). based on svn commit by diego: git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32226 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add central init_avcodec() to avoid duplicated libavcodec init codediego2010-11-021-6/+4
| | | | | | | | | | | | | | | | Patch by Vlad Seryakov, vseryakov gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32043 b3059339-0415-0410-9bf9-f77b7e298cf2 Refactor more instances of avcodec_initialized handling into init_avcodec(). This is a leftover from the previous commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32044 b3059339-0415-0410-9bf9-f77b7e298cf2 Add missing #include for vd_ffmpeg.h; fixes the warning: libmpcodecs/vf_zrmjpeg.c:472: warning: implicit declaration of function 'init_avcodec' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32176 b3059339-0415-0410-9bf9-f77b7e298cf2
* demuxer.c: reset subtitle EOF on seekingreimar2010-11-021-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32031 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: print subtitle type in more casesreimar2010-11-021-0/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32006 b3059339-0415-0410-9bf9-f77b7e298cf2
* demuxer.c: add new_sh_sub_sid_langUoti Urpala2010-11-021-0/+11
| | | | | | Allocates a new sh_sub and specifies language at the same time. I don't think this is a particularly good API but add it for easier compatibility with some svn changes.
* demuxer.c: Make ds_get_next_pts work for the first packet of a streamreimar2010-10-271-1/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31338 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make audio stream index handling saner in stream switchingUoti Urpala2010-05-221-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handling of audio stream numbering was handled in the stream selection property was a total mess. The most important issue was confusion between values used as index for demuxer->audio_streams[] array (consistently stored in demuxer->audio->id) and values stored in sh_audio->aid and used as "-aid N" option values. Now demuxer audio switch control functions and demuxer_switch_audio() are supposed to return the new value for the "-aid" option (internal MPEG demuxers still don't; the demuxer requirement could perhaps be dropped as it can be easily calculated afterwards). That is also the value returned for the "switch_audio" property. The main changes are: - Make command.c mp_property_audio() consistently use and return the "-aid" values. Before it used that as input but the array index as output, with extra mess related to demuxer_switch_audio() return value. Don't modify the audio_id option field any more. - Make demuxer_switch_audio() always return "-aid" values (like it takes as input). There are two changes for this: picking this return value in case the demuxer doesn't support switching, and overriding demuxer return value (for internal MPEG demuxers). - Make demux_lavf return "-aid" values from DEMUXER_CTRL_SWITCH_AUDIO code. This isn't actually necessary because of the override part above. Here's some history of the relevant behavior that I looked up: * For most demuxers array index and "-aid" values are the same. At least demux_mkv, (some of?) the internal MPEG demuxers and demux_ogg have differed for a long time. demux_ogg doesn't matter because it doesn't support stream switching. * Old code seemed to assume that demuxer_switch_audio() return value was array index, but this wasn't true at least for demux_mkv. * In svn r19951 reimar mostly removed use of the return value. * In r20162 ptt added mp_property_audio(). This set the global audio_id variable (-aid option value) to the return value of demuxer_switch_audio() and treated the global as the persistent value of the property, apparently assuming that it would be set to the "-aid" value, not array index. This was false for internal MPEG. * In r30124 reimar changed the property code so that even though it still modified the option value it didn't use that as the value of the property any more; instead it incorrectly used the array index. This meant that for demux_mkv the return value didn't match -aid any more (though input still did, so setting the property and querying it didn't match as they used different value systems). * In r31129 aurel made demux_lavf changes that resulted in its -aid and array index values no longer matching either. He didn't change the return value from audio switch when changing -aid, so it now matched array index only. The latter part didn't cause additional problems from r20162 though because either choice would have been broken anyway after r30124 as long as they weren't the same value.
* stream.h: remove bad EOF check in stream_seek()Uoti Urpala2010-05-221-1/+0
| | | | Also remove a redundant stream->eof = 0 in demuxer.c.
* demux: use bstr arguments for demuxer_add_attachment() and demuxer_add_chapter()Anton Khirnov2010-05-221-13/+12
|
* demuxer.c: add demux_info_add_bstr(), use talloc for info fieldAnton Khirnov2010-05-211-15/+16
| | | | demux_info_add() is now a wrapper around demux_info_add_bstr().
* Fix chapter handling with first chapter not at beginning of fileUoti Urpala2010-04-251-2/+2
| | | | | | | | | | Before "-chapter 1" did nothing even if the first chapter didn't start at the beginning of file. Fix it. Before all chapter property commands (including chapter seek keys) failed if the current playback position was before the start of the first chapter. Now they'll work. Relative chapter seeks will go to the first chapter (even if that's in the wrong direction for backward seeks).
* demuxer.c: clean up stream-seek codeUoti Urpala2010-04-231-22/+29
| | | | | | | | | Only try to use the dvd/dvdnav stream seek hack with those stream types. Generally demuxers can not be expected to cope with the stream suddenly seeking under them. In principle it would be more correct to make the test demuxer-based (instead of assuming that using stream seeks in this manner is OK with whatever demuxer that will be used with these streams), but that'd be more work.
* Move some sh_audio field setting out of demuxer.cUoti Urpala2010-04-231-2/+0
| | | | These fields are decoder details, not information set by the demuxer.
* Move seek-reset functionality out of demuxer.cUoti Urpala2010-04-231-37/+0
| | | | | | | Move code for resetting decoders after seeks, chapter seeks and angle changes out of demuxer.c. This functionality belongs on a higher level; the demux layer can't always know what kind of reinitialization is required.
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30748Uoti Urpala2010-03-101-2/+1
|\
| * Do not cast the results of malloc/calloc/realloc.diego2010-02-261-2/+1
| | | | | | | | | | | | | | | | These functions return void*, which is compatible with any pointer, so there is no need for casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Drop weird and unnecessary _s/_st suffixes from demuxer struct names.diego2010-02-211-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30686 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30672Uoti Urpala2010-03-101-3/+3
|\|
| * Do not discard stream buffer on eof, instead reuse it to slightly improvereimar2010-02-201-1/+1
| | | | | | | | | | | | | | format autodetection with -nocache and non-seekable streams. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30668 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Print demuxer name in "freeing demuxer" message.reimar2010-02-201-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30666 b3059339-0415-0410-9bf9-f77b7e298cf2
| * libmpdemux: Mark functions not used outside of their files as static.diego2010-02-171-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30612 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove ds_fill_buffer calls from demux_resync, they cause issues at least withreimar2010-01-261-2/+5
| | | | | | | | | | | | | | | | the ASF demuxer (seek seems to end up right after the keyframe?) and seem to have no purpose anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30438 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge branch 'matroska'Uoti Urpala2010-01-281-33/+24
|\ \
| * | demux: take chapter/attachment name strings without 0-terminationUoti Urpala2010-01-271-33/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change the demuxer_add_attachment() and demuxer_add_chapter() functions to take a length argument for various name strings, so those strings do not need to be 0-terminated. This will make it easier to directly pass demuxed data without first making a copy just to add 0-termination. Also allocate the struct demuxer data structures for attachments and chapters with talloc.
* | | Merge svn changes up to r30437Uoti Urpala2010-01-281-6/+29
|\ \ \ | |/ / |/| / | |/
| * Add support for parsing MLP and TrueHD.reimar2010-01-241-0/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30427 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove now unused variables.reimar2010-01-241-2/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30423 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Reset the parser on seek. Should fix some cases of audio "blips" after seeking.reimar2010-01-241-6/+23
| | | | | | | | | | | | | | AC3 is still broken due to the libavcodec parser being broken. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30421 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Move the resync-related code into more consistent places instead of having itreimar2010-01-241-35/+22
| | | | | | | | | | | | | | scattered all over the place with half of it forgotten in some places. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30420 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30136Uoti Urpala2009-12-301-1/+135
|\| | | | | | | Ignore another broken correct-pts change in 30134.
| * Add support for parsing audio streams (though should be easy to extend to video)reimar2009-12-271-1/+135
| | | | | | | | | | | | | | | | | | | | | | via libavcodec. Parsing can be done at the demuxer stage (currently disabled) or at the decoder (ad_ffmpeg, enabled). Should allow using the libavcodec AAC, DTS, ... decoders independent of container format. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30130 b3059339-0415-0410-9bf9-f77b7e298cf2
* | options: Move ass_enabled to options structUoti Urpala2009-12-021-1/+1
| |
* | Merge svn changes up to r29912Uoti Urpala2009-11-161-21/+8
|\|
| * Free demuxer->teletext when closing the demuxer.reimar2009-11-101-0/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29874 b3059339-0415-0410-9bf9-f77b7e298cf2
| * demuxer.c: Add initialization missing from previous commituau2009-11-021-21/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Reimar's previous commit ("Unbreak the demuxer-specific code in video.c with e.g.") added the new field "non_interleaved" in demux_stream structs, but this field was not initialized anywhere. Under suitable circumstances this could cause a "Too many video/audio packets in the buffer" error and failing playback. Fix the problem by cleaning up the code that creates new instances of the struct. Now fields will be initialized to 0 by default. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29812 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29684Uoti Urpala2009-09-161-0/+4
|\|
| * Reduce verbosity if demuxer sets an info value to the same as the current value.reimar2009-09-141-0/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29676 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29644Uoti Urpala2009-09-041-11/+4
|\|
| * Reuse ds_get_packet in ds_get_packet_ptsreimar2009-08-231-11/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29546 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29532Uoti Urpala2009-08-181-2/+3
|\|
| * Handle demuxers that never set filepos by using stream_tell.reimar2009-08-171-2/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29528 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove internal libass treeUoti Urpala2009-07-261-4/+1
| | | | | | | | | | Remove the libass/ directory and use the newest standalone version of the library instead.
* | Merge svn changes up to r29412Uoti Urpala2009-07-071-0/+7
|\|
| * Print information about chapters with -identify.reimar2009-06-281-0/+7
| | | | | | | | | | | | | | Patch by Adrian Stutz [adrian sttz ch] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29408 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29304Uoti Urpala2009-07-071-1/+19
|