mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-04 15:36:35 +00:00
level: Don't post a message on EOS without a valid audio info
If EOS is received before caps, e.g. because of an error, then rate and number of channels would be 0 and some divisions by zero would happen. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6829>
This commit is contained in:
parent
b7d4ccd7f2
commit
76b65d643b
1 changed files with 3 additions and 0 deletions
|
@ -747,6 +747,9 @@ gst_level_post_message (GstLevel * filter)
|
|||
gint channels, rate, frames = filter->num_frames;
|
||||
GstClockTime duration;
|
||||
|
||||
if (!GST_AUDIO_INFO_IS_VALID (&filter->info))
|
||||
return;
|
||||
|
||||
channels = GST_AUDIO_INFO_CHANNELS (&filter->info);
|
||||
rate = GST_AUDIO_INFO_RATE (&filter->info);
|
||||
duration = GST_FRAMES_TO_CLOCK_TIME (frames, rate);
|
||||
|
|
Loading…
Reference in a new issue