summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\|
| * Add standard license header to all files in libmpdemux.diego2009-05-081-1/+19
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29280 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-25/+29
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-25/+25
| | | | | | | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* | Merge branch 'ordered_chapters'Uoti Urpala2009-04-081-59/+18
|\ \
| * | Change demuxer_seek_chapter() parametersUoti Urpala2009-04-021-56/+15
| | | | | | | | | | | | | | | | | | Remove the "num_chapters" and "mode" parameters that aren't needed by any callers. Change "float *seek_pts" to "double *". Allocate the string returned via "chapter_name" with talloc.
| * | Allocate struct demuxer with tallocUoti Urpala2009-03-211-3/+3
| | | | | | | | | | | | Makes it possible to add data to it without explicit freeing code.
* | | Merge svn changes up to r29117Uoti Urpala2009-04-011-0/+4
|\ \ \ | |/ / |/| / | |/
| * Update demuxer->sub->id and demuxer->sub->sh if a new subtitle stream isreimar2009-03-291-0/+4
| | | | | | | | | | | | | | | | created that matches the user-requested one. Fixes -slang and -sid with DVDs (anything that uses demux_mpg actually). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29095 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28951Uoti Urpala2009-03-141-2/+0
|\|
| * Remove native nuv demuxer, it only needs more code to achieve the same thingreimar2009-03-091-2/+0
| | | | | | | | | | | | | | as the libavformat demuxer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28907 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28087Uoti Urpala2008-12-041-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_ivtv.c libao2/ao_v4l2.c libmpcodecs/dec_video.h libvo/aspect.h libvo/sub.c libvo/sub.h libvo/vo_directx.c libvo/vo_macosx.m libvo/vo_quartz.c mp_core.h mplayer.c mplayer.h osdep/getch2.h osdep/timer.h
| * Get rid of pointless 'extern' keywords.diego2008-12-031-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28065Uoti Urpala2008-12-021-0/+4
|\|
| * MNG demuxer by Stefan Schuermans, stefan blinkenarea orgdiego2008-11-301-0