Commit Graph

79 Commits

Author SHA1 Message Date
reimar 71ed16bbb4 Remove another two useless special-case from flac metadata reading function
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26408 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-12 15:16:37 +00:00
reimar 4d4cb3a3f2 Simplify: use AV_RB24
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26407 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-12 15:14:02 +00:00
reimar 84121288c1 Remove useless checks
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26406 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-12 15:11:03 +00:00
reimar 88584511ff Simplify (currently disabled) get_flac_metadata
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26405 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-12 15:09:40 +00:00
reimar 933277ac0f Add a comment to the #if 0
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25926 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-29 22:44:55 +00:00
reimar c6894da2cd Disable reading of flac metadata, mere metadata is not worth such a mess.
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
2008-01-29 22:04:46 +00:00
reimar 80d22ebb9f Properly check length of flac metadata.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25917 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-29 22:00:58 +00:00
reimar 5960ddb8e5 Use defines to give names to the different seek flags.
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
2008-01-29 15:11:38 +00:00
reimar eb6b6698a1 Fix endless loop if nAvgBytesPerSec is 0.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25800 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-19 14:43:58 +00:00
reimar fd35d1bfe3 Avoid a division by 0 if i_bps is 0.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25799 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-19 14:38:24 +00:00
reimar 35ef167321 Make all demuxer_desc_t const, thus moving them to .rodata
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25735 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-13 16:00:39 +00:00
reimar e907bda20a Simplify: initialize at declaration at the start of the function
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24612 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-24 22:21:14 +00:00
reimar fc686f0d6d Get rid of rather pointless asserts
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24611 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-24 22:18:47 +00:00
uau b12a08fe6a demux_audio.c: Fix timestamp handling
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
2007-09-24 21:49:56 +00:00
reimar 33d26c72cf Get rid of: useless variable, useless cast and void * arithmetic
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23648 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-24 13:21:50 +00:00
reimar 4badc643ae Use AV_RL32
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23647 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-24 13:20:17 +00:00
diego e085bc8dcf Add explicit location for headers from the stream/ directory.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22623 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-15 18:36:36 +00:00
reimar ec62af965e Check for eof in loop searching for data chunk.
Fixes bug #775.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22604 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-15 10:38:51 +00:00
reimar e1b26346cc Fix wrong setting of samplesize (must be bytes per sample, not bits)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22437 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-04 12:43:55 +00:00
reimar 8fdb1522a2 Do not read beyond end of data chunk if chunk_size is set.
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
2007-02-04 09:33:57 +00:00
reimar 7ac56b70b8 doxify a comment
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21667 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-18 15:15:21 +00:00
reimar 9526342555 Require 12 consecutive MPEG-audio headers before detecting as audio.
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
2006-12-18 15:14:23 +00:00
reimar 08bea9d14d Try playing files with wrong wav header length, fixes riff_broken_hrdlen.wav
(bug #238)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20340 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-21 19:58:49 +00:00
reynaldo 32492483c0 drops casts from void * on malloc/calloc from libmpdemux code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19067 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-07-13 16:41:13 +00:00
uau 6723323303 Clean up audio pts handling, make audio pts tracking in the audio-only
case work the same as with video.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18713 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-06-14 19:48:54 +00:00
uau 7022f65d0c Change free_sh_audio() to take demuxer and stream id as parameters
(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
2006-06-14 14:05:59 +00:00
reynaldo c03b175452 Part3 of Otvos Attila's oattila AT chello-hu mp_msg changes, with lots of modifications as usual
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18177 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-22 05:12:10 +00:00
reimar 1e390288ed Use ULL for > 32 bits constant.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18118 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-16 13:45:21 +00:00
reimar 827ccaa941 try to detect flac bitrate early on to avoid division by zero problems.
Should also help with mencoder and -oac copy


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18076 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-11 10:46:52 +00:00
reimar b72ebc6fb8 check wav header length against upper limit, should protect against
some misdetections (esp. with text files).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18075 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-11 10:43:20 +00:00
diego a33158d60d Convert printfs in aviprint.c to mp_msg and give the information printing
functions in this file a verbosity_level parameter.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17978 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-27 17:25:41 +00:00
diego eebf08b978 Convert all if(verbose>X) to mp_msg_test calls.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17933 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-24 08:12:03 +00:00
aurel 88901c08d4 retrieve metadata from FLAC files (patch by Benjamin Zores < ben _at_ geexbox.org >)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17899 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-20 20:06:04 +00:00
reimar 0b48e15140 fix leak on read error (forgot to free demux packet)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17791 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-09 22:14:34 +00:00
reimar 425573eb0d "i < sizeof(buf)" must be "i < sizeof(buf) - 5", since later buf[i + 5] is used.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17776 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-08 13:07:36 +00:00
corey 1ab575101a Second-try commit of this patch.
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
2006-02-17 01:57:41 +00:00
reimar ceeff576d3 read data in nBlockAlign aligned chunks
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17555 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-07 22:12:34 +00:00
diego 36e1974be0 Unify include path handling, -I.. is in CFLAGS.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17013 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-11-18 14:39:25 +00:00
reimar 2912984517 move resync_audio_stream after seeking to demuxer.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16878 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-10-30 09:19:05 +00:00
reimar 2d6059c4e5 Fix seeking in wav files: align relative to start of data, not start of file
and use nBlockAlign if available.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16819 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-10-20 15:15:53 +00:00
reimar 021f63cd71 Ignore movi_end (except on error) to allow playing growing files.
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
2005-09-09 20:05:42 +00:00
ods15 d620029e4b Make -identify's 'ID_LENGTH=' print a float and not an integer.. The
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
2005-09-02 08:32:32 +00:00
rtognimp cd68e1618b Demuxer modularization
Demuxer selection by name with -demuxer command (bakward compatible)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16176 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-08-05 19:57:47 +00:00
reimar 1da3dc91bd set i_bps in demux_audio for WAV and MP3 to avoid division by zero before
decoder sets it.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16163 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-08-01 18:36:50 +00:00
reimar 5a5d4c946e Fix MP3 detection (list of found MP3 headers was not kep sorted).
Also remove code that only fixed the symptoms.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15216 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-04-18 20:51:34 +00:00
rfelker 5528785463 nico partially fixed the bug i reported; here's the rest of the fix.
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
2005-04-17 17:17:52 +00:00
nicodvb 4593e0f2cf skip framelen-4 bytes after having successfully detected an mpeg audio frame
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15205 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-04-17 17:08:55 +00:00
nicodvb aa8b3279f9 assign correct tag, dwScale and dwBlockAlign to mpeg audio; optionally 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
2005-04-17 09:42:51 +00:00
rfelker 47c016bd18 100l to reimar.. sh_audio->samplerate and sh_audio->i_bps are not the same
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14911 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-03-04 01:53:55 +00:00
reimar 78dda735d5 Fix possible hang when playing broken MP3 from linear stream and remove
duplicate code.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14609 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-01-29 12:55:56 +00:00