Commit Graph

260 Commits

Author SHA1 Message Date
Uoti Urpala 759231566a demux_lavf: for avi, use packet .dts instead of .pts
When playing avi files take timestamps from the .dts field of the
packet instead of .pts. For avi libavformat returns the original avi
timestamps in .dts; without GENPTS set .pts is sometimes unset, with
GENPTS set it'll contain some made up values which are not correct
pts. Current libavformat also has a bug take makes it loop over the
whole avi file if you use GENPTS with video streams disabled.

The timing code can cope with the avi timestamps even though they're
not really pts.
2010-11-06 23:29:45 +02:00
Uoti Urpala b04c615959 demux_lavf: avoid deprecated "first_iformat" by using newer API 2010-11-06 23:29:07 +02:00
Uoti Urpala 393bb7bb98 demux_lavf: add hack for stream-changing ogg input (internet radio)
Some internet radio streams are ogg/vorbis with a new stream for each
track (and the previous stream stops receiving data). Add a hack to
ignore the stream number in packets when input seems to match this
case; all packets will be effectively regarded as parts of the same
audio stream. This workaround can't work perfectly with current lavf
because it will keep adding streams and then hit its 20 stream
maximum; at that point playback will likely fail. Print a warning
about this problem and mention "-demuxer ogg" as a possible
workaround.

Currently there's no check that the vorbis extradata is actually
compatible between the streams.
2010-11-06 23:29:00 +02:00
Uoti Urpala 661d909f8e demux_lavf: more future proof AVInputFormat name comparison
AVInputFormat name fields consist of comma-separated components, more
of which may be added in backwards-compatible versions. demux_lavf did
a strcmp against the whole field at once; this would break if a
component was added. Change the code to search for individual
component matches within the field instead.
2010-11-06 23:26:21 +02:00
reimar c310aa4628 demux_lavf: handle new streams appearing during playback
Based on patch by KS Ng - dmbth [hk.dmbth gmail com]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32439 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
reimar fe6c4fcae2 cleanup: malloc+memset->calloc, sizeof(TYPE)->sizeof(*ptr)
Replace malloc+memset by calloc

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32181 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32182 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32183 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace some sizeof(type) by sizeof(*pointer)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32184 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32186 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32187 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32188 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace sizoef(type) by sizeof(*ptrvar).
Besides being consistent with FFmpeg style,
this reduces the size of a patch to rename these
types to not conflict with the windows.h definitions.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32189 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32191 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32192 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace sizeof(type) by sizeof(*ptrvar)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32193 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove a useless cast.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32194 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace sizeof(type)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32195 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove a useless cast.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32196 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace several sizeof(WAVEFORMATEX)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32197 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace one more instance of sizeof(WAVEFORMATEX); fix compilation.
patch by Clément Bœsch, ubitux gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32199 b3059339-0415-0410-9bf9-f77b7e298cf2

Avoid some pointless uses of sizeof() and one related cast.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32200 b3059339-0415-0410-9bf9-f77b7e298cf2

Merge one malloc() + memset() invocation into calloc().

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32202 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32203 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace sizeof(WAVEFORMATEX) occurrences.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32205 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace malloc+memset by calloc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32206 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace sizeof(BITMAPINFOHEADER)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:46 +02:00
reimar dec2db6326 demux_lavf: Always use convergence_duration for subtitles
Otherwise subtitles will stay on screen forever for ASS subtitles in
mkv if no ASS renderer is used.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32032 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:49 +02:00
reimar 0e82595632 demux_lavf: print subtitle type in more cases
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32006 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:49 +02:00
reimar 9e537d1f6e subs: Add support for DVB and XSUB subtitles, not yet working properly
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31694 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:43 +02:00
reimar 96c17fe68b subs: Add support for PGS subtitle decoding via libavcodec
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31665 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:43 +02:00
aurel d7a9c6d240 demux_lavf: stricter check for convergence_duration validity
Avoid using meaningless values

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31642 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:20 +02:00
reimar 815460d289 demux_lavf: Avoid a crash if stream->url is not set
Print a warning since this is not supposed to happen.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31587 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:11:43 +02:00
Uoti Urpala dde8b753e4 Merge svn changes r31318 to r31328
r31328 is a somewhat questionable (changing the option at that point
isn't quite safe), but it was a failure case already...
2010-06-05 23:35:42 +03:00
reimar 29b2cae621 Also print current stream position in mp_read debug output.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31326 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-06-05 16:14:56 +00:00
reimar 1581d9deb2 Remove explicit eof check for mp_read code, stream code handles this case
better, e.g. properly supporting growing files.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31325 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-06-05 16:12:36 +00:00
reimar 159f5f451d Di not do a stream_reset on seeking backwards, the seek itself should
do whatever is best/necessary, this method will just drop cached data.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31324 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-06-05 16:00:49 +00:00
reimar 637edc7a27 Try always enabling correct pts again for lavf demuxer, since the know
issue with PAFF seems solved to me, and disabled correct-pts causes
flickering with -ass (which of course should be fixed as well though).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31313 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-06-03 21:01:37 +00:00
aurel 9be39d0640 Switch mkv demuxing to lavf by default.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31294 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-31 19:44:02 +00:00
Uoti Urpala 8ce2c41ca5 Merge svn changes up to r31226 2010-05-30 16:25:04 +03:00
diego c0262f7435 Drop pointless _t suffix from 'struct lavf_priv'.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31247 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-28 00:25:28 +00:00
reimar 1e0b9a97fd Switch ogg demuxing to lavf by default.
This has the side-effect of using fftheora by default instead of
theora, which possibly should be changed.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31225 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-26 18:01:38 +00:00
hyc 3c1cedaa56 Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31218 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-25 23:07:28 +00:00
Uoti Urpala 90bedd0b87 Make audio stream index handling saner in stream switching
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.
2010-05-22 10:11:25 +03:00
Anton Khirnov bc072fb7dc demux: use bstr arguments for demuxer_add_attachment() and demuxer_add_chapter() 2010-05-22 06:40:28 +03:00
cehoyos 4e2622ed33 Do not use correct-pts for mpeg-ps: It breaks PAFF samples.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31190 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-22 01:17:59 +00:00
Uoti Urpala e1cd86076f Merge svn changes up to r31141 2010-05-07 22:13:35 +03:00
Uoti Urpala eee666c3b5 Merge svn changes up to r31133 2010-05-07 21:19:53 +03:00
aurel 88b6dd6fc2 cosmetic: typo, this wasn't supposed to be plural
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31137 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-04 18:46:42 +00:00
aurel eaff21c633 print a more detailed and more useful description of each stream with lavf
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31132 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-03 22:45:00 +00:00
aurel c58a1d4acb 10l: correctly use video_stream instead of audio_stream in the video section
( copy&paste error :( )


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31131 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-03 22:40:00 +00:00
aurel 8be7c74c64 add ID_..._NAME to -identify for each lavf stream which has a title
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31130 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-03 22:30:06 +00:00
aurel 59058b54a7 uniformize handling of aid and vid with lavf so that it matches handling of sid
aid and vid are now 0-based, instead of being a globally unique id.
This matches the way sid is handled and the way other demuxers manage aid.
As a side effect, it slightly simplifies demux_lavf.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31129 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-03 22:19:52 +00:00
reimar 11b178be9a Continue probing even for score == AVPROBE_SCORE_MAX / 4 to match
FFmpeg's behaviour.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31111 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-01 15:38:37 +00:00
reimar dd8db7f620 Use av_probe_input_format2 and avoid accepting detection
while the score is still low.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31110 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-01 13:50:49 +00:00
Uoti Urpala 4785c2617e Merge svn changes up to r30967 2010-04-26 17:42:20 +03:00
Uoti Urpala 7be5f14c3a demux_lavf, stream_ffmpeg: support librtmp seeks 2010-04-23 23:50:34 +03:00
Uoti Urpala 1d4d1bff82 stream_ffmpeg, demux_lavf: Use flv demuxer for rtmp streams
Use lavf's flv demuxer for rtmp/rtmps/... stream types. Letting
generic format probing handle this could work, but with the current
probing implementation it'd at least depend on not-really-guaranteed
details of the stream layer (probing different formats and then
decoding depends on seeking back in between; rtmp streams don't
support such seeking directly so would need to rely on details of
caching behavior).
2010-04-23 22:57:25 +03:00
Uoti Urpala 4583c12a2c options: move lavfdopts to option struct 2010-04-23 22:08:18 +03:00
reimar 364fb6d26f Reindent
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30947 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-22 19:39:43 +00:00
reimar b28b15db30 Start probing with a size matching the stream buffer size so it is possible
to restart without seeking even without cache for easily detectable formats.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30946 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-22 19:38:42 +00:00
Uoti Urpala 00323c06e2 Delete things related to old translation system
Remove the help/ subdirectory, configure code to create toplevel
help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
2010-03-10 03:47:14 +02:00
Uoti Urpala 13221a7165 Merge svn changes up to r30663
Conflicts:
	gui/cfg.c
	libmpcodecs/vd_dmo.c
	mplayer.c
2010-03-10 00:13:11 +02:00
Uoti Urpala c37f09693d Merge svn changes up to r30643 2010-03-10 00:00:06 +02:00
Uoti Urpala 36e7a20e69 Merge svn changes up to r30550 2010-03-09 23:03:14 +02:00
Uoti Urpala bc0f524909 Merge svn changes up to r30502
Conflicts:
	libswscale/rgb2rgb.c
	libswscale/rgb2rgb.h
	libswscale/swscale.c
	libvo/x11_common.c
2010-03-09 19:44:28 +02:00
reimar 1bb4898483 Print all 64 bits of seek position.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30662 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-20 11:21:51 +00:00
diego 0055441774 Add header for AVI print functions; avoids many forward declarations.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30631 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-18 00:18:50 +00:00
reimar 59d3c04b58 Dynamically increase probe size for lavf demuxer up to 2 MB.
This will read progressively more data if we still did not detect
the format. The lavfpref demuxer is unaffected to avoid hanging
for a long time in case of a slow network stream that some native
demuxer may be able to handle.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30547 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-12 20:38:29 +00:00
reimar 78ecbc1e6f Replace incorrect usage of strncpy.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30500 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-03 22:36:47 +00:00
reimar 9d9b7a1e22 Reindent
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30499 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-03 22:33:35 +00:00