mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 15:08:48 +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/6828>
This commit is contained in:
parent
d05a8516a7
commit
d2e8b4db07
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