[Bug 756628] audioclock: Add run time type check safety
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Wed Oct 21 08:17:16 PDT 2015
https://bugzilla.gnome.org/show_bug.cgi?id=756628
Marcin Kolny (IRC: loganek) <marcin.kolny at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #313360|needs-work |none
status| |
Attachment #313360|0 |1
is obsolete| |
--- Comment #5 from Marcin Kolny (IRC: loganek) <marcin.kolny at gmail.com> ---
Created attachment 313817
--> https://bugzilla.gnome.org/attachment.cgi?id=313817&action=edit
proposed solution v2
OK, I've improved my patch by removing check in static method
gst_audio_clock_get_internal_time().
Btw. could somebody explain me, why do you prefer argument of type GstClock *
instead of GstAudioClock *? User probably doesn't know method's implementation
of some methods, so if he sees that he can pass GstClock *, he passes GstClock
*, which doesn't have to be of type GstAudioClock*.
I think, this:
gst_audio_clock_get_time (GST_AUDIO_CLOCK (some_clock)) // user knows, that he
has to pass GstAudioClock*
is better than this:
gst_audio_clock_get_time (some_clock)
In first case, we have compile-time check of type, in second - runtime. I
think, the first one is a way better.
gst_audio_clock_get_internal_time() is used as virtual method, so it's obvious,
that must have parameter of type GstClock. But the other methods?
Please, don't treat my comment as offense. I'm pretty sure, there is a reason
of using GstClock instead of GstAudioClock. But I don't see this reason, and
want to find it out :)
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list