summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_audio.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove another two useless special-case from flac metadata reading functionreimar2008-04-121-20/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26408 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify: use AV_RB24reimar2008-04-121-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26407 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove useless checksreimar2008-04-121-8/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26406 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify (currently disabled) get_flac_metadatareimar2008-04-121-11/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26405 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a comment to the #if 0reimar2008-01-291-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25926 b3059339-0415-0410-9bf9-f77b7e298cf2
* Disable reading of flac metadata, mere metadata is not worth such a mess.reimar2008-01-291-1/+3
| | | | | | | | If you want this, fix the implementation to not crash at least occasionally, or wait till I get bored enough to fix it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25918 b3059339-0415-0410-9bf9-f77b7e298cf2
* Properly check length of flac metadata.reimar2008-01-291-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25917 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use defines to give names to the different seek flags.reimar2008-01-291-4/+4
| | | | | | | | 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
* Fix endless loop if nAvgBytesPerSec is 0.reimar2008-01-191-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25800 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid a division by 0 if i_bps is 0.reimar2008-01-191-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25799 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
* Simplify: initialize at declaration at the start of the functionreimar2007-09-241-10/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24612 b3059339-0415-0410-9bf9-f77b7e298cf2
* Get rid of rather pointless assertsreimar2007-09-241-12/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24611 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_audio.c: Fix timestamp handlinguau2007-09-241-14/+15
| | | | | | | | | | | | | | | | | | The code calculated the pts values of audio packets by adding the length of the current packet to the pts of the previous one. The length of the previous packet should be added instead. This broke WAV timestamps near the end of the stream where a short packet occurs. Change the code to store the pts of the next packet instead of the last one. This fixes the WAV timestamps and allows some simplifications. MP3 timestamps are not affected as packets are always treated as constant decoded length, and FLAC timestamps still have worse problems (FLAC is treated as as if it was constant bitrate even though it isn't). Also store the timestamps as double instead of float. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24609 b3059339-0415-0410-9bf9-f77b7e298cf2
* Get rid of: useless variable, useless cast and void * arithmeticreimar2007-06-241-8/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23648 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use AV_RL32reimar2007-06-241-3/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23647 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add explicit location for headers from the stream/ directory.diego2007-03-151-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22623 b3059339-0415-0410-9bf9-f77b7e298cf2
* Check for eof in loop searching for data chunk.reimar2007-03-151-1/+1
| | | | | | | Fixes bug #775. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22604 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix wrong setting of samplesize (must be bytes per sample, not bits)reimar2007-03-041-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22437 b3059339-0415-0410-9bf9-f77b7e298cf2
* Do not read beyond end of data chunk if chunk_size is set.reimar2007-02-041-1/+6
| | | | | | | Sample: http://samples.mplayerhq.hu/A-codecs/wavpcm/ahh.wav git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22121 b3059339-0415-0410-9bf9-f77b7e298cf2
* doxify a commentreimar2006-12-181-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21667 b3059339-0415-0410-9bf9-f77b7e298cf2
* Require 12 consecutive MPEG-audio headers before detecting as audio.reimar2006-12-181-1/+1
| | | | | | | Fixes misdetection of http://samples.mplayerhq.hu/FLV/flv_misdetected_as_mpa git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21666 b3059339-0415-0410-9bf9-f77b7e298cf2
* Try playing files with wrong wav header length, fixes riff_broken_hrdlen.wavreimar2006-10-211-4/+2
| | | | | | | (bug #238) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20340 b3059339-0415-0410-9bf9-f77b7e298cf2
* drops casts from void * on malloc/calloc from libmpdemux codereynaldo2006-07-131-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19067 b3059339-0415-0410-9bf9-f77b7e298cf2
* Clean up audio pts handling, make audio pts tracking in the audio-onlyuau2006-06-141-6/+1
| | | | | | | case work the same as with video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18713 b3059339-0415-0410-9bf9-f77b7e298cf2
* Change free_sh_audio() to take demuxer and stream id as parametersuau2006-06-141-3/+2
| | | | | | | | | | | | | | (same as new_sh_audio()) instead of sh_audio_t *, use those to remove the pointer from demuxer->a_streams[] before freeing it. Some demuxers use free_sh_audio() to undo the creation of an already-allocated audio stream in case of error. These uses were unsafe since free_sh_audio() freed the data structure but left the pointer in demuxer->a_streams[], leading to double free later in free_demuxer() (and perhaps use of the freed stream before that, I didn't check). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18711 b3059339-0415-0410-9bf9-f77b7e298cf2
* Part3 of Otvos Attila's oattila AT chello-hu mp_msg changes, with lots of ↵reynaldo2006-04-221-1/+2
| | | | | | modifications as usual git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18177 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use ULL for > 32 bits constant.reimar2006-04-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18118 b3059339-0415-0410-9bf9-f77b7e298cf2
* try to detect flac bitrate early on to avoid division by zero problems.reimar2006-04-111-2/+16
| | | | | | | Should also help with mencoder and -oac copy git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18076 b3059339-0415-0410-9bf9-f77b7e298cf2
* check wav header length against upper limit, should protect againstreimar2006-04-111-0/+8
| | | | | | | some misdetections (esp. with text files). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18075 b3059339-0415-0410-9bf9-f77b7e298cf2
* Convert printfs in aviprint.c to mp_msg and give the information printingdiego2006-03-271-2/+2
| | | | | | | functions in this file a verbosity_level parameter. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17978 b3059339-0415-0410-9bf9-f77b7e298cf2
* Convert all if(verbose>X) to mp_msg_test calls.diego2006-03-241-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17933 b3059339-0415-0410-9bf9-f77b7e298cf2
* retrieve metadata from FLAC files (patch by Benjamin Zores < ben _at_ ↵aurel2006-03-201-0/+145
| | | | | | geexbox.org >) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17899 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix leak on read error (forgot to free demux packet)reimar2006-03-091-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17791 b3059339-0415-0410-9bf9-f77b7e298cf2
* "i < sizeof(buf)" must be "i < sizeof(buf) - 5", since later buf[i + 5] is used.reimar2006-03-081-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17776 b3059339-0415-0410-9bf9-f77b7e298cf2
* Second-try commit of this patch.corey2006-02-171-1/+1
| | | | | | | | | | | | 1. Include audio_delay as an argument to demux_seek. 2. Modify demux_seek_avi to adjust the audio/video stream positions so that mplayer/mencoder will instantly be in sync even when -delay is specified. I've quadruple checked this time; hopefully I haven't missed anything. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17637 b3059339-0415-0410-9bf9-f77b7e298cf2
* read data in nBlockAlign aligned chunksreimar2006-02-071-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17555 b3059339-0415-0410-9bf9-f77b7e298cf2
* Unify include path handling, -I.. is in CFLAGS.diego2005-11-181-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17013 b3059339-0415-0410-9bf9-f77b7e298cf2
* move resync_audio_stream after seeking to demuxer.creimar2005-10-301-5/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16878 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix seeking in wav files: align relative to start of data, not start of filereimar2005-10-201-1/+3
| | | | | | | and use nBlockAlign if available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16819 b3059339-0415-0410-9bf9-f77b7e298cf2
* Ignore movi_end (except on error) to allow playing growing files.reimar2005-09-091-3/+6
| | | | | | | | Also adds a check if stream_read read the requested length. This and the movi_end check on error help not accidently playing ID3 tags. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16439 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make -identify's 'ID_LENGTH=' print a float and not an integer.. Theods152005-09-021-1/+1
| | | | | | | | accuracey may be totally fake for some demuxers (mpg), but accurate for others.. (avi) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16347 b3059339-0415-0410-9bf9-f77b7e298cf2
* Demuxer modularizationrtognimp2005-08-051-6/+23
| | | | | | | Demuxer selection by name with -demuxer command (bakward compatible) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16176 b3059339-0415-0410-9bf9-f77b7e298cf2
* set i_bps in demux_audio for WAV and MP3 to avoid division by zero beforereimar2005-08-011-10/+31
| | | | | | | decoder sets it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16163 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix MP3 detection (list of found MP3 headers was not kep sorted).reimar2005-04-181-2/+3
| | | | | | | Also remove code that only fixed the symptoms. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15216 b3059339-0415-0410-9bf9-f77b7e298cf2
* nico partially fixed the bug i reported; here's the rest of the fix.rfelker2005-04-171-0/+1
| | | | | | | | | | | | basically demux_audio was mixing data in its header buffer in a bogus manner, whereby it could sometimes "make up" valid mpeg headers where no such header actually occurred in the file. it should be correct now. btw these changes also fix the bug where mplayer reports huge initial cpu usage for sound when playing mp3 files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15206 b3059339-0415-0410-9bf9-f77b7e298cf2
* skip framelen-4 bytes after having successfully detected an mpeg audio framenicodvb2005-04-171-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15205 b3059339-0415-0410-9bf9-f77b7e298cf2
* assign correct tag, dwScale and dwBlockAlign to mpeg audio; optionally ↵nicodvb2005-04-171-8/+8
| | | | | | assign layer and samples_per_frame when parsing mpa header git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15200 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l to reimar.. sh_audio->samplerate and sh_audio->i_bps are not the samerfelker2005-03-041-4/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14911 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix possible hang when playing broken MP3 from linear stream and removereimar2005-01-291-29/+26
| | | | | | | duplicate code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14609 b3059339-0415-0410-9bf9-f77b7e298cf2
* better, tuneable (via #define) MP3 detection, limit demux_audio to scanningreimar2004-09-281-27/+118
| | | | | | | only the first 30000 bytes for headers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13504 b3059339-0415-0410-9bf9-f77b7e298cf2
* moved sh_audio initialization from dec_audio to demuxer.c to fixreimar2004-09-161-1/+0
| | | | | | | | -hr-mp3-seek bug (pts was -inf after seeking) and remove the workaround from demux_audio.c. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13358 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix seeking with -hr-mp3-seek. maybe not the best fix (why is last_ptsrfelker2004-09-051-0/+1
| | | | | | | | | | | | | ever infinite?!?!) but at least it makes it work... :) patch by Balazs KOSSOVICS (tevefeju AT freemail.hu): Hi! When we listening music with "-hr-mp3-seek" option, than there is a negative value at the first rewinds in the statusrange (-52 hours, some minutes). The patch is against this. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13257 b3059339-0415-0410-9bf9-f77b7e298cf2
* DTS support via lavc and libdtsrtognimp2004-08-121-0/+40
| | | | | | | | Patch by Aurelien Jacobs ( aurel at gnuage dot org ) dts in wav by me git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13007 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l to me: writing outside allocated memoryrtognimp2004-04-151-1/+1
| | | | | | | | Patch by Mikulas Patocka < mikulas (at) artax (dot) karlin (dot) mff (dot) cuni (dot) cz> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12214 b3059339-0415-0410-9bf9-f77b7e298cf2
* FLAC decoding support via imported libmpflac.lumag2003-10-041-0/+20
| | | | | | | TODO: fix FLAC-in-ogg decoding. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11005 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fixed 'reading after EOF'. demuxers didn't check, how many they've read!lumag2003-09-201-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10892 b3059339-0415-0410-9bf9-f77b7e298cf2
* get_percent_pos support in demux_audio, patch by ROSEN Jeremy <jeremy.rosen ↵faust32003-09-191-0/+21
| | | | | | at c-s.fr> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10883 b3059339-0415-0410-9bf9-f77b7e298cf2
* don't set audio pts to infinity after seeking in mp3 files :)rfelker2003-06-041-0/+1
| | | | | | | (10l) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10245 b3059339-0415-0410-9bf9-f77b7e298cf2
* Warning fix, patch by Dominik Mierzejewskyrtognimp2003-03-221-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9656 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l cbSize not inited for l=16.\n Could give problem in print_wave_headerrtognimp2003-03-171-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9617 b3059339-0415-0410-9bf9-f77b7e298cf2
* Same behaviour as old code for short headersrtognimp2003-03-151-2/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9597 b3059339-0415-0410-9bf9-f77b7e298cf2
* Read extradata for wav files, based on patch by <dimakar(at)yahoo.com>. ↵rtognimp2003-03-151-5/+16
| | | | | | Required for truespeech files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9592 b3059339-0415-0410-9bf9-f77b7e298cf2
* fixed mp3 seeking near end of filearpi2002-12-041-2/+3
| | | | | | | patch by ??? (sorry i can't find that mail) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8360 b3059339-0415-0410-9bf9-f77b7e298cf2
* *HUGE* set of compiler warning fixes, unused variables removalarpi2002-11-061-0/+1
| | | | | | | based on patch by Dominik Mierzejewski <dominik@rangers.eu.org> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8124 b3059339-0415-0410-9bf9-f77b7e298cf2
* skip id3v2 junk when looking for mp3rfelker2002-11-051-0/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8117 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10larpi2002-11-051-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8111 b3059339-0415-0410-9bf9-f77b7e298cf2
* A-V sync cleanup: sh_audio->timer replaced by sh_audio->delay, it containsarpi2002-11-021-3/+3
| | | | | | | | delay relative to sh_video->timer (or to 0 if audioonly). It fixes ct: drifts of very long (several hours) playback. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8057 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup config option handling in libmpdemux.arpi2002-10-231-14/+1
| | | | | | | | removed overcompilacted m_config_register_options() mess - export the subconfig structs instead git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7868 b3059339-0415-0410-9bf9-f77b7e298cf2
* dump wav headerarpi2002-10-221-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7848 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix vbr muxing and win32 codec crash on initalbeu2002-07-211-3/+13
| | | |