summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mkv.c
Commit message (Collapse)AuthorAgeFilesLines
* Add improved relative seek modeUoti Urpala2009-03-241-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the new mode is active relative seeks are converted to absolute ones (current video pts + relative seek amount) and forward/backward flag before being sent to the demuxer. This mode is used if the demuxer has set the accurate_seek field in the demuxer struct and there is a video stream. At the moment the mkv and lavf demuxers enable the flag. This change is useful for later Matroska ordered chapter support (and for more general timelime editing), but also fixes problems in existing functionality. The main problem with the old mode, where relative seeks are passed directly to the demuxer, is that the user wants to seek relative to the currently displayed position but the demuxer does not know what that position is. There can be an arbitrary amount of buffering between the demuxer read position and what is displayed on the screen. In some situations this makes small seeks fail to move backward at all (especially visible at high playback speed, when audio needs to be demuxed and decoded further ahead to fill the output buffers after resampling). Some container formats that can be used with the lavf demuxer do not always have reliable timestamps that could be used for unambiguous absolute seeking. However I made the demuxer always enable the new mode because it already converted all seeks to absolute ones before sending them to libavformat, so cases without reliable absolute seeks were failing already and this should only improve the working cases.
* demux_mkv: Parse ordered chapter informationUoti Urpala2009-03-221-2/+73
| | | | | | Parse the ordered chapter structure if present and place the information in the public demuxer structure. Nothing uses the information yet.
* demux_mkv: Some cleanup, fix duration printed at verbose levelUoti Urpala2009-03-211-154/+134
| | | | | | | | | | | Clean up demux_mkv_read_info() and demux_mkv_read_chapters() somewhat. (Why do the names of static functions have a stupid prefix like that? Didn't remove it now however). Demux_mkv_read_info() now delays printing duration information until the end of the function where we hopefully have the correct timescale for converting it to seconds. The code to calculate the duration had been fixed for that earlier but the message had not.
* Merge svn changes up to r28537Uoti Urpala2009-02-121-89/+11
|\
| * change internal real video packetizing format to the more straight forward oneaurel2009-02-091-86/+8
| | | | | | | | | | | | | | | | see [MPlayer-dev-eng] [PATCH] cleanup/uniformize real video packetizing patch blessed by Roberto git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28503 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Convert CONFIG_ZLIB into a 0/1 option.diego2009-02-071-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28475 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28461Uoti Urpala2009-02-041-7/+7
|\|
| * Adapt to lzo changes in libavutilreimar2009-02-021-7/+7
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28448 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27841Uoti Urpala2008-10-281-208/+0
|\| | | | | | | | | Conflicts: mplayer.c
| * Factorize vobsub idx/extradata handling.aurel2008-10-271-208/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27841 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Revert bad changes to SSA/ASS subtitle packet formatuau2008-09-081-38/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following commits are reverted partially or completely: "a valid ASS line contains 9 ',' before actual text" "demux_mkv: output correctly formated ASS packets" "libass: add a new ass_process_data() to process demuxed subtitle packets" These commits converted the internal representation of SSA/ASS subtitle packets from the format used by Matroska to a custom format where each packet has contents exactly matching one line in complete SSA script files. AFAIK no files natively use such a format for muxed subtitles. The stated reason for this change was to use a format that could in principle be muxed into a maximal number of containers. SSA subtitles do not have an implicit duration so both start time and duration or end time need to be specified explicitly; the new format moved timing information inside the codec packet data so it could be muxed without modification into containers that can represent only start time at the container level. However such a change is wrong from the viewpoint of program architecture. Timing information belongs to the demuxer level, but these commits moved not only the duration but also the authoritative value of the start time to inside the codec data. Additionally the new format lost the value of the Matroska ReadOrder field which is used by MPlayer. This commit changes the internal packet format back to that used by Matroska and makes the internal Matroska demuxer output that format again. Libavformat still outputs the "new" format; it could be converted back to the Matroska format in demux_lavf.c, but I'm not adding that code at least yet. The current lavf code has similar problems as the reverted code in MPlayer, and it also currently fails to provide any way to access the value of the ReadOrder field. I hope that the lavf side will be improved; if it isn't conversion can be added later. For now I'll make MPlayer default to the internal Matroska demuxer instead of the lavf one in a separate commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27550 b3059339-0415-0410-9bf9-f77b7e298cf2
| * demux_mkv: output correctly formated ASS packetsaurel2008-09-051-1/+38
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27529 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27374Uoti Urpala2008-07-301-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h cfg-mplayer.h command.c configure libmpcodecs/dec_video.c libmpcodecs/vd.c libmpcodecs/vf_vo.c libmpdemux/demuxer.h libmpdemux/stheader.h mp_core.h mplayer.c stream/stream_radio.c
| * Start unifying names of internal preprocessor directives.diego2008-07-301-6/+6
| | | | | | | | | | | | | | | | Replace all USE_ prefixes by CONFIG_ prefixes to indicate options which are configurable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove unused function, fixes the warning:diego2008-05-151-19/+0
| | | | | | | | | | | | | | libmpdemux/demux_mkv.c:2242: warning: 'demux_mkv_reverse_id' defined but not used git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26784 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove unused variable, fixes the warning:diego2008-05-151-1/+0
| | | | | | | | | | | | | | libmpdemux/demux_mkv.c:1401: warning: unused variable 'mkv_d' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26782 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: Break overly long lines.diego2008-05-151-5/+7
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26781 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Mark static tables const.diego2008-05-151-4/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26780 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Revert r26412: policy violationrtogni2008-04-191-8/+7
| | | | | | | | | | | | | | Mixes cosmetics and functional changes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26470 b3059339-0415-0410-9bf9-f77b7e298cf2
* | demux_mkv.c: Compiler warning fixesUoti Urpala2008-04-281-31/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libmpdemux/demux_mkv.c:218: warning: passing argument 1 of ‘grow_array’ from incompatible pointer type * libmpdemux/demux_mkv.c:1235: warning: passing argument 1 of ‘grow_array’ from incompatible pointer type Change grow_array to return the reallocated pointer instead of setting it through a void **. * libmpdemux/demux_mkv.c:1396: warning: unused variable ‘mkv_d’ Remove. * libmpdemux/demux_mkv.c:1740: warning: pointer of type ‘void *’ used in arithmetic Change struct mkv_track->private_data from void * to unsigned char *. * libmpdemux/demux_mkv.c:2693: warning: assignment from incompatible pointer type Add a cast. * libmpdemux/demux_mkv.c:2239: warning: ‘demux_mkv_reverse_id’ defined but not used Remove the function (together with preceding useless advance declaration of demux_mkv_seek).
* | Move dvdsub_id to options structUoti Urpala2008-04-231-5/+0
| | | | | | | | | | | | | | Name the field "sub_id" as it's not specific to DVD subs. Remove some other unused extern declarations together with dvdsub_id from demux_mkv.c and demux_lavf.c.
* | Move correct_pts to options structUoti Urpala2008-04-231-1/+3
|/
* demux_mkv.c: Mark some static tables constuau2008-04-121-7/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26412 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support 'default' attribute for audio and subtitle tracks.eugeni2008-03-301-0/+2
| | | | | | | | | The first default track is chosen for playback if language-based selection failes. Additionally, for audio tracks, the first one is chosen if there are no default tracks at all. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26301 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unused function.eugeni2008-02-291-20/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26125 b3059339-0415-0410-9bf9-f77b7e298cf2
* Reindent.eugeni2008-02-291-18/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26124 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't select audio stream in lavf and mkv demuxers.eugeni2008-02-291-11/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26123 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't select subtitle track in lavf and mkv demuxers.eugeni2008-02-291-21/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26120 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove stupid checks of free() argument.eugeni2008-02-291-20/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26117 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fill sh_sub_t.lang in lavf, mkv and ogg demuxers. Use it for printing subtitleeugeni2008-02-291-20/+2
| | | | | | | track language. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26116 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fill sh_audio_t.lang in lavf and mkv demuxers. Use it for printing audio trackeugeni2008-02-291-21/+2
| | | | | | | language when available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26115 b3059339-0415-0410-9bf9-f77b7e298cf2
* FFmpeg now uses different (unified) #include paths.diego2008-02-251-5/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26101 b3059339-0415-0410-9bf9-f77b7e298cf2
* -chapter is now handled uniformly calling demuxer_seek_chapter() insteadnicodvb2008-02-111-11/+0
| | | | | | | of letting individual demuxers and stream readers do their nasty job git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25987 b3059339-0415-0410-9bf9-f77b7e298cf2
* Allow demuxers to choose a default value for correct_ptsreimar2008-02-031-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25951 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use defines to give names to the different seek flags.reimar2008-01-291-5/+6
| | | | | | | | A better solution should be considered later, esp. for the many broken demuxers that do not treat these flags correctly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25911 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make all demuxer_desc_t const, thus moving them to .rodatareimar2008-01-131-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25735 b3059339-0415-0410-9bf9-f77b7e298cf2
* Instead of keeping attachments in mkv demuxer, use demuxer_add_attachment().eugeni2008-01-121-44/+1
| | | | | | | These attachments are passed to libass after demuxer is opened. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25686 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move all subtitle parsing from mkv demuxer to update_subtitles().eugeni2008-01-111-22/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25683 b3059339-0415-0410-9bf9-f77b7e298cf2
* Init and destroy ass_tracks in demuxer.c based on sh_sub->type value.eugeni2008-01-111-40/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25682 b3059339-0415-0410-9bf9-f77b7e298cf2
* Set extradata for subtitle tracks in mkv demuxer.eugeni2008-01-111-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25681 b3059339-0415-0410-9bf9-f77b7e298cf2
* Factorize private data decoding for subtitle tracks in mkv demuxer.eugeni2008-01-111-20/+12
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25679 b3059339-0415-0410-9bf9-f77b7e298cf2
* Vobsub support tridx setting in .idx file.ulion2007-12-191-2/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25460 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move temp variable declaration into inner loop scope.ulion2007-12-101-2/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25332 b3059339-0415-0410-9bf9-f77b7e298cf2
* Convert vobsub custom colors from rgb to yuv using a common function.ulion2007-12-091-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25326 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move vobsub palette->yuv convert code into a common function.ulion2007-12-081-9/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25320 b3059339-0415-0410-9bf9-f77b7e298cf2
* Restore y of palette into the same value range as it was in the .ifo file.ulion2007-12-081-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25317 b3059339-0415-0410-9bf9-f77b7e298cf2
* add support for wavpack into matroskaaurel2007-10-211-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24833 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix warnings:diego2007-08-261-2/+0
| | | | | | | | | | demux_mkv.c: In function 'demux_mkv_read_chapters': demux_mkv.c:1299: warning: unused variable 'mkv_d' demux_mkv.c: In function 'handle_subtitles': demux_mkv.c:2740: warning: unused variable 'mkv_d' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24219 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid crash if a non-existent audio track is selected with -aidreimar2007-07-161-5/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23790 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix typo in a commentaurel2007-07-131-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23771 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add some missing frees.reimar2007-07-051-2/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23724 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpyreimar2007-07-051-2/+3
| | | | | | | instead of plain strlcat/strlcpy git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
* index_mode is already defined in demuxer.hreimar2007-06-241-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23650 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove the now unused demux_mkv_change_subs functionreimar2007-06-241-39/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23620 b3059339-0415-0410-9bf9-f77b7e298cf2
* Set demuxer->sub->sh to one of the s_streams like done for audio and video.reimar2007-06-241-24/+17
| | | | | | | | This makes the code simpler and more like the other demuxers, allowing to remove some special cases in mplayer.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23618 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l, last demux_mkv patch passed ints instead of pointers to them to sscanfreimar2007-06-231-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23611 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use sh_sub_t instead of mkv_track_t argument where possible, simplifying the ↵reimar2007-06-231-30/+30
| | | | | | code a bit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23610 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_mkv very long seek fixuau2007-06-201-1/+1
| | | | | | | | | | | | | | | | | | The seek code searching for the closest position in the index used "int64_t min_diff=0xFFFFFFFL" as the initial "further from the goal than any real alternative" value. The unit is milliseconds so seeks more than about 75 hours past the end of the file would fail to recognize the last index position as the best match. This was triggered in practice by chapter seek code which apparently uses a seek of 1000000000 seconds forward to mean "seek to the end". The practical effect was that trying to seek to the next chapter in a file without chapters made MPlayer block until it finished reading the file from the current position to the end. Fixed by increasing the initial value from FFFFFFF to FFFFFFFFFFFFFFF. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23592 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't set random codec parameters for AC3/DTS in mkv.aurel2007-06-101-2/+2
| | | | | | | | | Those values are not needed anyway. This fixes stream copying from mkv with mencoder. Patch by Trent Piepho. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23534 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix segfault when encoding from an mkv file with embedded fonts.eugeni2007-06-071-1/+2
| |