GNOME Bugzilla – Bug 601707
Movie aspect ratio errors when streaming RTSP
Last modified: 2009-11-13 12:54:59 UTC
$ ./totem rtsp://test:test@bastien-noceras-macbook-air.local./untitled.sdp ** Message: no file info ** Message: bvw->priv->video_width 384 bvw->priv->video_height 240 movie_par_n 0, movie_par_d 0 disp_par_n 1 disp_par_d 1 (totem:7497): GStreamer-CRITICAL **: gst_value_set_fraction: assertion `denominator != 0' failed ** (totem:7497): CRITICAL **: gst_video_calculate_display_ratio: assertion `num > 0' failed ** Message: bvw->priv->video_width 384 bvw->priv->video_height 240 movie_par_n 0, movie_par_d 0 disp_par_n 1 disp_par_d 1 (totem:7497): GStreamer-CRITICAL **: gst_value_set_fraction: assertion `denominator != 0' failed ** (totem:7497): CRITICAL **: gst_video_calculate_display_ratio: assertion `num > 0' failed ** Message: caps_set() called, square pixels ** Message: caps_set() called, square pixels ** Message: bvw->priv->video_width 192 bvw->priv->video_height 242 movie_par_n 1, movie_par_d 1 disp_par_n 1 disp_par_d 1 ** Message: bvw->priv->video_width 192 bvw->priv->video_height 242 movie_par_n 1, movie_par_d 1 disp_par_n 1 disp_par_d 1 Maybe we should default to movie_par_n = movie_par_d = 1?
I haven't checked exactly what is happening. From what you said on IRC, my guess is that because RTSP is a live source, the pipeline goes to playing before it is pre-rolled, which leads to this case. Since it has to be that if you don't have caps, neither does the sink - that implies that it doesn't matter... there's nothing to be put on the screen yet anyway. I say use 1/1 - it will be corrected shortly afterward when the pipeline prerolls, or if possible, defer whatever is causing the check until the pipeline actually does preroll (either by checking the bus messages, or waiting until you get caps)
Yep, initialising the PAR to 1:1 does the trick nicely (I managed to encounter this with a DVD, when the disc takes a while to spin up): diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c index 6110d32..51644b8 100644 --- a/src/backend/bacon-video-widget-gst-0.10.c +++ b/src/backend/bacon-video-widget-gst-0.10.c @@ -1260,6 +1260,7 @@ bacon_video_widget_init (BaconVideoWidget * bvw) priv->videotags = NULL; priv->zoom = 1.0; priv->volume = -1.0; + priv->movie_par_n = priv->movie_par_d = 1; priv->lock = g_mutex_new ();
Created attachment 147658 [details] [review] Fix movie aspect ratio errors with slow streams When getting media size before the pipeline is pre-rolled, we'd be getting errors because we're trying to set the aspect ratio with a zero denominator.
Attachment 147658 [details] pushed as 2eb6b4b - Fix movie aspect ratio errors with slow streams