After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 380199 - [matroskademux] Wrong framerate conversion
[matroskademux] Wrong framerate conversion
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-28 16:54 UTC by Michal Benes
Modified: 2006-12-11 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to convert to gdouble correctly (792 bytes, patch)
2006-11-28 16:59 UTC, Michal Benes
none Details | Review
alternative patch for default framerate in caps (3.37 KB, patch)
2006-12-11 13:02 UTC, Tim-Philipp Müller
committed Details | Review

Description Michal Benes 2006-11-28 16:54:20 UTC
When default block duration is converted to framerate, fps is accidentaly converted to integer. As result, framerates < 1 are interpreted as fraction 0/1

Patch follows.
Comment 1 Michal Benes 2006-11-28 16:59:30 UTC
Created attachment 77300 [details] [review]
Patch to convert to gdouble correctly

As I do not know about guint64 to gdouble conversion limitations on some platforms, I have done the fix this way. May be context->default_duration should be converted by gst_guint64_to_gdouble too.
Comment 2 Tim-Philipp Müller 2006-12-11 13:02:13 UTC
Created attachment 78127 [details] [review]
alternative patch for default framerate in caps

Does this patch also make things work fine for you?

I think it's better to save the float value we extract and re-use it here than to do two 1/N calculations including uint64/double conversion. Also, the reason for the gst_guint64_to_gdouble() is that some compilers (MSVC) apparently can't convert double <=> guint64 by just casting, so it needs to be used on context->default_duration not GST_SECOND here (GST_SECOND still fits into an int IIRC).
Comment 3 Michal Benes 2006-12-11 13:20:31 UTC
Hi Tim, I have checked your patch and it works in my scenario. Duration <=> FPS conversion works well.
Comment 4 Tim-Philipp Müller 2006-12-11 14:00:51 UTC
Great, thanks for testing!


 2006-12-11  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream),
        (gst_matroska_demux_video_caps):
        * gst/matroska/matroska-ids.c:
        (gst_matroska_track_init_video_context):
        * gst/matroska/matroska-ids.h:
          Try harder to extract the framerate for video tracks correctly and
          save it directly instead of converting it back and forth a few
          times. Mostly makes a difference for very small framerates (<1).
          Fixes #380199.