Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:164 m_channelSize += GST_BUFFER_OFFSET_END(buffer) - GST_BUFFER_OFFSET(buffer); in case of ogg file input without BOS information (e.g: http://labs.dinahmoe.com/ToneCraft/) m_channelSize will be always '0' so I think.. the code is needed to change like this, m_channelSize += buffer->size * 0.25 i tested tonecraft page and succeed.
(In reply to comment #0) > Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:164 > m_channelSize += GST_BUFFER_OFFSET_END(buffer) - GST_BUFFER_OFFSET(buffer); > > in case of ogg file input without BOS information (e.g: http://labs.dinahmoe.com/ToneCraft/) > m_channelSize will be always '0' > > so I think.. the code is needed to change like this, > m_channelSize += buffer->size * 0.25 > Hum, can you explain this please? Maybe it'd be good to have a layout test for this issue.
when i test "http://labs.dinahmoe.com/ToneCraft/" page, gstreamer's 'oddgemux' plugin warns... "page is not BOS page, all streams identified". as i know, most webaudio example page that contains ogg are same. at this time, GST_BUFFER_OFFSET_END(buffer) and GST_BUFFER_OFFSET(buffer) were '0'. so i need a meaningful channel size. what do you think about this situation? hmm.. imo.. ogg wihout BOS information is not perfect file, but not evil... and channel size can be calculated by size of buffer.
Sebastian, can you give some advice on this issue?
Created attachment 133469 [details] sample ogg file
I'll upload a patch in few minutes. Can you test it?
sure I'm ready~~ :)
Created attachment 133472 [details] Patch
hmm.. i'm compiling now.. but in AudioFileReaderGStreamer.cpp, line 151~156 doesn't need anymore, right?
(In reply to comment #8) > hmm.. i'm compiling now.. but > > in AudioFileReaderGStreamer.cpp, line 151~156 doesn't need anymore, right? Thue, but it's unrelated to this patch. Can be cleaned up when I land this one though, looks harmless!
(In reply to comment #5) > I'll upload a patch in few minutes. Can you test it? test done. looks great!
Comment on attachment 133472 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=133472&action=review > Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:166 > + GstClockTime duration = gst_audio_duration_from_pad_buffer(sinkPad.get(), buffer); This function is not in 0.11 anymore, just calculate the duration yourself from the buffer size and the caps (and in 0.11 the GstAudioInfo). Other than that this is the correct thing to do, using the offset fields will only cause problems.
Created attachment 134022 [details] Patch
Comment on attachment 134022 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134022&action=review > Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:166 > + if (!gst_structure_get_int(structure, "width", &width) || !width) { Note that all this will only work with 0.10 but I guess that's fine as this code has to be ported to 0.11/1.0 anyway > Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:172 > + long bytes = GST_BUFFER_SIZE(buffer); Better use guint64 or something similar here instead of long. For the calculation one line below you need a 64 bit integer to prevent overflows.
Comment on attachment 134022 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134022&action=review >> Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:166 >> + if (!gst_structure_get_int(structure, "width", &width) || !width) { > > Note that all this will only work with 0.10 but I guess that's fine as this code has to be ported to 0.11/1.0 anyway Yes. >> Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:172 >> + long bytes = GST_BUFFER_SIZE(buffer); > > Better use guint64 or something similar here instead of long. For the calculation one line below you need a 64 bit integer to prevent overflows. Oh hum yes, actually I can just directly use GST_BUFFER_SIZE below.
Created attachment 134038 [details] Patch
Martin can you have a look at this patch please? Sebastian did a first pass :)
Comment on attachment 134038 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134038&action=review > Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:172 > + GstClockTime duration = (reinterpret_cast<guint64>(GST_BUFFER_SIZE(buffer)) * 8 * GST_SECOND) / (sampleRate * channels * width); Oh hum that should be a static_cast.
Committed r112646: <http://trac.webkit.org/changeset/112646>