Summary: | [Gstreamer] Use gst_buffer_extract() in copyGstreamerBuffersToAudioChannel() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | eric.carlson, feature-media-reviews, jer.noble, laszlo.gombos, mrobinson, pnormand, webkit.review.bot | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Chris Dumez
2013-04-03 08:58:05 PDT
Created attachment 196362 [details]
Patch
Comment on attachment 196362 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196362&action=review Looks cool indeed! > Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:105 > + guint bufferCount = gst_buffer_list_length(buffers); > + for (guint i = 0; i < bufferCount; ++i) { bufferCount is not needed I think. Also please use unsigned instead of guint if possible, we try to give preference to non-glib types when possible. Comment on attachment 196362 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196362&action=review >> Source/WebCore/platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:105 >> + for (guint i = 0; i < bufferCount; ++i) { > > bufferCount is not needed I think. Also please use unsigned instead of guint if possible, we try to give preference to non-glib types when possible. Caching the container size before the loop is commonly done in WebKit and it avoids calling gst_buffer_list_length() for each iteration. It's not a big deal here because gst_buffer_list_length() is inexpensive but I still think it is good practice. I'll replace guint by unsigned, I wasn't sure what the policy was about this. Created attachment 196374 [details]
Patch
Using unsigned instead of guint. I kept the container size caching for now.
Comment on attachment 196374 [details] Patch Clearing flags on attachment: 196374 Committed r147567: <http://trac.webkit.org/changeset/147567> All reviewed patches have been landed. Closing bug. |