bugGnash - The GNU Flash player - Bugs: bug #21594, Small problems playing OGG streams

 
 

bug #21594: Small problems playing OGG streams

Submitted by:  Benjamin Wolsey <bwy>
Submitted on:  Thu 15 Nov 2007 05:15:06 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 24 Jan 2008 12:00:40 PM UTC, comment #10:

Not really, OGG works pretty well.

Benjamin Wolsey <bwy>
Project Member
Thu 24 Jan 2008 11:46:37 AM UTC, comment #9:

Ben, are there still problems playing ogg now ?

Sandro Santilli <strk>
Project Member
Sun 25 Nov 2007 05:59:46 PM UTC, comment #8:

I get no valgrind error playing kiro.ogg, but here's what I get with RMS_short.flv, which seems easy to understand:

==17472== Thread 2:
==17472== Invalid read of size 4
==17472== at 0x5207711: (within /usr/lib/libavcodec.so.1d.51.38.0)
==17472== Address 0x6267081 is 33 bytes inside a block of size 34 alloc'd
==17472== at 0x4021D67: operator new[](unsigned) (vg_replace_malloc.c:195)
==17472== by 0x45C965D: gnash::FLVParser::nextAudioFrame() (FLVParser.cpp:215)
==17472== by 0x4352FF9: gnash::NetStreamFfmpeg::decodeFLVFrame() (NetStreamFfmpeg.cpp:729)
==17472== by 0x4353385: gnash::NetStreamFfmpeg::av_streamer(gnash::NetStreamFfmpeg*) (NetStreamFfmpeg.cpp:654)
==17472== by 0x43534D0: boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, void ()(gnash::NetStreamFfmpeg), boost::_bi::list1<boost::_bi::value<gnash::NetStreamFfmpeg*> > >, void>::invoke(boost::detail::function::function_buffer&) (bind.hpp:231)
==17472== by 0x4F27419: boost::function0<void, std::allocator<boost::function_base> >::operator()() const (in /usr/lib/libboost_thread-gcc41-mt-1_34_1.so.1.34.1)
==17472== by 0x4F27046: (within /usr/lib/libboost_thread-gcc41-mt-1_34_1.so.1.34.1)
==17472== by 0x460D46A: start_thread (in /lib/tls/i686/cmov/libpthread-2.6.1.so)
==17472== by 0x4E336DD: clone (in /lib/tls/i686/cmov/libc-2.6.1.so)

Sandro Santilli <strk>
Project Member
Sun 25 Nov 2007 01:12:37 PM UTC, comment #7:

The packet comes from decodeMediaFrame (the second valgrind error below). It's not initilized with av_init_packet, but doing so doesn't fix the illegal reads.

With av_init_packet(&packet); after line 973, valgrind shows reads and writes just outside recently allocated data.

Without initializing the packets (i.e. with no changes to the code), valgrind shows reads inside recently freed data.

This is from a run with the av_init_packet line inserted:

==347== Invalid write of size 1:

==347== Address 0x1118097C is 0 bytes after a block of size 11,932 alloc'd
==347== at 0x4C1DBBD: memalign (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==347== by 0x8A3C092: av_new_packet (in /usr/lib64/libavformat.so.51.12.1)
==347== by 0x8A7D6AD: (within /usr/lib64/libavformat.so.51.12.1)
==347== by 0x8A3DA50: (within /usr/lib64/libavformat.so.51.12.1)
==347== by 0x51D88D1: gnash::NetStreamFfmpeg::decodeMediaFrame() (NetStreamFfmpeg.cpp:974)
==347== by 0x51D8B87: gnash::NetStreamFfmpeg::av_streamer(gnash::NetStreamFfmpeg*) (NetStreamFfmpeg.cpp:664)

Benjamin Wolsey <bwy>
Project Member
Sun 25 Nov 2007 01:02:24 PM UTC, comment #6:

I just gave easyvideo.swf a try and I do can see kiro.ogg, with minor problems. Just a tip: could you have the SWF trace a message about undefined _root.url and the need to pass it in query string ?
would be easy to know how to make it work (I had to look at source code instead).

Sandro Santilli <strk>
Project Member
Sun 25 Nov 2007 12:58:05 PM UTC, comment #5:

NetStreamFfmpeg::decodeFLVFrame() doesn't call av_init_packet against a stack-allocated and manually-initialized AVPacket.

Manually initializing that thing shouldn't be done as different ffmpeg versions might change the structure.
If it's allowed, I belive a lib-provided initialization functions must be called as first thing anyway.

We should check the ffmpeg documentation about it.

Sandro Santilli <strk>
Project Member
Sun 25 Nov 2007 11:34:50 AM UTC, comment #4:

Valgrind errors (in order of appearance...)

1. Use of uninitialised value of size 8 and Conditional jump or move depends on uninitialised value(s), both

at 0x92CBE34: (within /usr/lib64/libavcodec.so.51.40.4)
by 0x91135D2: avcodec_decode_video (in /usr/lib64/libavcodec.so.51.40.4)
by 0x51D6128: gnash::NetStreamFfmpeg::decodeVideo(AVPacket*) (NetStreamFfmpeg.cpp:837)

[line: avcodec_decode_video(m_VCodecCtx, m_Frame, &got, packet->data, packet->size); ]

======================

2. Invalid write of size 1
by 0x51D88AC: gnash::NetStreamFfmpeg::decodeMediaFrame() (NetStreamFfmpeg.cpp:973)

[AVPacket packet;
int rc = av_read_frame(m_FormatCtx, &packet); // <-- this line]

Reading frame information into packet.

========================
3. Invalid read of size 1
by 0x51D88AC: gnash::NetStreamFfmpeg::decodeMediaFrame() (NetStreamFfmpeg.cpp:973)

Same line.

All the problems seem AVPacket related...

Benjamin Wolsey <bwy>
Project Member
Fri 16 Nov 2007 05:49:22 PM UTC, comment #3:

Attaching about the simplest possible player for playing any movie.

Use the player so:

gnash easyvideo.swf?url=path/to/file.ogg

And it will play just about anything.

I've tested with ogg (theora and vorbis), and avi (2 mpeg streams, recorded from DVB-T), and both work, though unreliably and not very smoothly.

(file #14417, file #14418)

Benjamin Wolsey <bwy>
Project Member
Fri 16 Nov 2007 02:25:40 PM UTC, comment #2:

The backtrace from the FPE, showing it's an audio related bug. The video runs all the way through with -r1.

I'm obviously running an ffmpeg build; I haven't tried either case with gstreamer.

#0 0x00002b89e78d358c in av_resample () from /usr/lib64/libavcodec.so.51
No symbol table info available.
#1 0x00002b89e78d2fde in audio_resample () from /usr/lib64/libavcodec.so.51
No symbol table info available.
#2 0x00002b89e39375fa in gnash::NetStreamFfmpeg::decodeAudio (this=0x98a830,
packet=0x41001010) at NetStreamFfmpeg.h:227
output = (uint8_t *) 0xe899a0 ""
samples = 0
raw = <value optimized out>
frame_delay = <value optimized out>
frame_size = 0#0 0x00002b89e78d358c in av_resample () from /usr/lib64/libavcodec.so.51
No symbol table info available.
#1 0x00002b89e78d2fde in audio_resample () from /usr/lib64/libavcodec.so.51
No symbol table info available.
#2 0x00002b89e39375fa in gnash::NetStreamFfmpeg::decodeAudio (this=0x98a830,
packet=0x41001010) at NetStreamFfmpeg.h:227
output = (uint8_t *) 0xe899a0 ""
samples = 0
raw = <value optimized out>
frame_delay = <value optimized out>
frame_size = 0
ptr = (uint8_t *) 0xe43490 ""
#3 0x00002b89e3937a5d in gnash::NetStreamFfmpeg::decodeMediaFrame (
this=0x98a830) at NetStreamFfmpeg.cpp:979
s = <value optimized out>
packet = {pts = 0, dts = 0, data = 0xc0aae0 "\f��f�\001", size = 8,
stream_index = 1, flags = 1, duration = 46,
destruct = 0x2b89e71c60d0 <av_destruct_packet>, priv = 0x0, pos = -1}
rc = <value optimized out>
#4 0x00002b89e3937cd8 in gnash::NetStreamFfmpeg::av_streamer (ns=0x98a830)
at NetStreamFfmpeg.cpp:664
No locals.
#5 0x00002b89e6899d5f in boost::function0<void, std::allocator<boost::function_
ptr = (uint8_t *) 0xe43490 ""
#3 0x00002b89e3937a5d in gnash::NetStreamFfmpeg::decodeMediaFrame (
this=0x98a830) at NetStreamFfmpeg.cpp:979
s = <value optimized out>
packet = {pts = 0, dts = 0, data = 0xc0aae0 "\f��f�\001", size = 8,
stream_index = 1, flags = 1, duration = 46,
destruct = 0x2b89e71c60d0 <av_destruct_packet>, priv = 0x0, pos = -1}
rc = <value optimized out>
#4 0x00002b89e3937cd8 in gnash::NetStreamFfmpeg::av_streamer (ns=0x98a830)
at NetStreamFfmpeg.cpp:664
No locals.
#5 0x00002b89e6899d5f in boost::function0<void, std::allocator<boost::function_

Benjamin Wolsey <bwy>
Project Member
Thu 15 Nov 2007 05:40:10 PM UTC, comment #1:

A couple more things: it does work (also only sometimes) over a network, but there is always a long pause before it starts. And the playback is much less smooth than with flvs.

Benjamin Wolsey <bwy>
Project Member
Thu 15 Nov 2007 05:15:06 PM UTC, original submission:

The player (krechert's) attached will look for the ogg files also attached in the same directory.

There are two problems:

1. The theora codec usually isn't recognised. If you try long enough, it will be. (Running in gdb raises the chances that the correct codec is chosen).

2. The video Schnee.ogg causes a floating point exception when it's loaded. ffplay is happy with it, though.

Both videos were produced with ffmpeg2theora.

Benjamin Wolsey <bwy>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #14417:  easyvideo.c added by bwy (2KiB - text/x-csrc)
file #14418:  easyvideo.swf added by bwy (304B - application/x-shockwave-flash)
file #14404:  uv_kiro.swf added by bwy (10KiB - application/x-shockwave-flash)
file #14405:  uvschnee.swf added by bwy (10KiB - application/x-shockwave-flash)
file #14406:  kiro.ogg added by bwy (349KiB - application/ogg)
file #14407:  Schnee.ogg added by bwy (106KiB - application/ogg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by bwy (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 24 Jan 2008 12:00:40 PM UTCbwyStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Thu 24 Jan 2008 11:46:37 AM UTCstrkStatusNone=>Ready For Test
    Fri 16 Nov 2007 05:49:22 PM UTCbwyAttached File-=>Added easyvideo.c, #14417
      Attached File-=>Added easyvideo.swf, #14418
    Thu 15 Nov 2007 05:15:06 PM UTCbwyAttached File-=>Added uv_kiro.swf, #14404
      Attached File-=>Added uvschnee.swf, #14405
      Attached File-=>Added kiro.ogg, #14406
      Attached File-=>Added Schnee.ogg, #14407

    Back to the top


    Powered by Savane 3.1-cleanup1