[MPlayer-dev-eng] [PATCH] demuxer_lavf mp_seek() problem
emild at cs.technion.ac.il
emild at cs.technion.ac.il
Sat Jul 7 23:22:12 CEST 2007
Good evening everyone,
I have encountered a problem with mplayer when trying to play .flv files over
http streaming or (or any other non-seekable streams for that matter) using the
libavf demuxer. The playing stops almost immediately at the start and mplayer
starts complaing about corrupted frames (i.e. unknown packet types and strange
sizes). A sample output when running mplayer on a youtube media URL is shown at
the end of the message.
The problem is caused by the fact that url_filesize() from libavformat/avio.c
calls mp_seek() with a strange constant (AVSEEK_SIZE which is 0x1000) for
whence. This causes mp_seek() to fail, (i.e. it returns -1) after which
url_filesize() retries the call, this time with whence set to SEEK_END and
offset set to -1. This time causes the stream to reset its offset to 0, which
is not what we wanted and causes the corruption (the stream offset was supposed
to remain unchanged). The attached two-line patch fixes this problem.
Best regards,
Emil
$ ./mplayer 'http://lax-v187.lax.youtube.com/get_video?video_id=TG3_uP0Brk8'
MPlayer dev-SVN-r23739-4.1.2 (C) 2000-2007 MPlayer Team
CPU: Intel Celeron 2/Pentium III Coppermine,Geyserville (Family: 6, Model: 8,
Stepping: 3)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 SSE
Playing http://lax-v187.lax.youtube.com/get_video?video_id=TG3_uP0Brk8.
Resolving lax-v187.lax.youtube.com for AF_INET6...
ouldn't resolve name for AF_INET6: lax-v187.lax.youtube.com
Resolving lax-v187.lax.youtube.com for AF_INET...
Connecting to server lax-v187.lax.youtube.com[64.15.112.175]: 80...
Cache size set to 320 KBytes
Cache fill: 15.00% (49152 bytes)
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [FLV1] 320x240 0bpp 29.970 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
pening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffflv] vfm: ffmpeg (FFmpeg Flash video)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 8.0 kbit/1.13% (ratio: 1000->88200)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [oss] 22050Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 320x240 => 320x240 Planar YV12
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
[flv @ 0x86f3ee0]skipping flv packet: type 155, size 3801088, flags 0%
Stream not seekable!
[flv @ 0x86f3ee0]skipping flv packet: type 178, size 10591261, flags 0
Stream not seekable!
[flv @ 0x86f3ee0]skipping flv packet: type 231, size 10590787, flags 0
Stream not seekable!
<Other similar errors snipped>
[flv @ 0x86f3ee0]skipping flv packet: type 167, size 3544713, flags 0
[flv @ 0x8809300]illegal ac vlc code at 5x79/ 39 15% 2% 1018.4% 3 0 0%
[flv @ 0x8809300]Error at MB: 152
[flv @ 0x8809300]run overflow at 2x0 i:0
[flv @ 0x8809300]Error at MB: 2
[flv @ 0x8809300]concealing 300 DC, 300 AC, 300 MV errors
A: 1.5 V: 1.3 A-V: 0.188 ct: 0.133 40/ 40 15% 2% 992.3% 3 0 0%
Exiting... (End of file)
$
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demux_lavf.diff
Type: text/x-patch
Size: 409 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070708/197ee765/attachment.bin>
More information about the MPlayer-dev-eng
mailing list