mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pw-top: initialize info struct with 0
So that we don't accidentally print uninitialized values.
This commit is contained in:
parent
e3a4797063
commit
c30d743198
1 changed files with 6 additions and 6 deletions
|
|
@ -198,7 +198,7 @@ static void node_param(void *data, int seq,
|
||||||
switch(media_subtype) {
|
switch(media_subtype) {
|
||||||
case SPA_MEDIA_SUBTYPE_raw:
|
case SPA_MEDIA_SUBTYPE_raw:
|
||||||
{
|
{
|
||||||
struct spa_audio_info_raw info;
|
struct spa_audio_info_raw info = { 0 };
|
||||||
if (spa_format_audio_raw_parse(param, &info) >= 0) {
|
if (spa_format_audio_raw_parse(param, &info) >= 0) {
|
||||||
snprintf(n->format, sizeof(n->format), "%6.6s %d %d",
|
snprintf(n->format, sizeof(n->format), "%6.6s %d %d",
|
||||||
spa_debug_type_find_short_name(
|
spa_debug_type_find_short_name(
|
||||||
|
|
@ -209,7 +209,7 @@ static void node_param(void *data, int seq,
|
||||||
}
|
}
|
||||||
case SPA_MEDIA_SUBTYPE_dsd:
|
case SPA_MEDIA_SUBTYPE_dsd:
|
||||||
{
|
{
|
||||||
struct spa_audio_info_dsd info;
|
struct spa_audio_info_dsd info = { 0 };
|
||||||
if (spa_format_audio_dsd_parse(param, &info) >= 0) {
|
if (spa_format_audio_dsd_parse(param, &info) >= 0) {
|
||||||
snprintf(n->format, sizeof(n->format), "DSD%d %d ",
|
snprintf(n->format, sizeof(n->format), "DSD%d %d ",
|
||||||
8 * info.rate / 44100, info.channels);
|
8 * info.rate / 44100, info.channels);
|
||||||
|
|
@ -219,7 +219,7 @@ static void node_param(void *data, int seq,
|
||||||
}
|
}
|
||||||
case SPA_MEDIA_SUBTYPE_iec958:
|
case SPA_MEDIA_SUBTYPE_iec958:
|
||||||
{
|
{
|
||||||
struct spa_audio_info_iec958 info;
|
struct spa_audio_info_iec958 info = { 0 };
|
||||||
if (spa_format_audio_iec958_parse(param, &info) >= 0) {
|
if (spa_format_audio_iec958_parse(param, &info) >= 0) {
|
||||||
snprintf(n->format, sizeof(n->format), "IEC958 %s %d",
|
snprintf(n->format, sizeof(n->format), "IEC958 %s %d",
|
||||||
spa_debug_type_find_short_name(
|
spa_debug_type_find_short_name(
|
||||||
|
|
@ -235,7 +235,7 @@ static void node_param(void *data, int seq,
|
||||||
switch(media_subtype) {
|
switch(media_subtype) {
|
||||||
case SPA_MEDIA_SUBTYPE_raw:
|
case SPA_MEDIA_SUBTYPE_raw:
|
||||||
{
|
{
|
||||||
struct spa_video_info_raw info;
|
struct spa_video_info_raw info = { 0 };
|
||||||
if (spa_format_video_raw_parse(param, &info) >= 0) {
|
if (spa_format_video_raw_parse(param, &info) >= 0) {
|
||||||
snprintf(n->format, sizeof(n->format), "%6.6s %dx%d",
|
snprintf(n->format, sizeof(n->format), "%6.6s %dx%d",
|
||||||
spa_debug_type_find_short_name(spa_type_video_format, info.format),
|
spa_debug_type_find_short_name(spa_type_video_format, info.format),
|
||||||
|
|
@ -245,7 +245,7 @@ static void node_param(void *data, int seq,
|
||||||
}
|
}
|
||||||
case SPA_MEDIA_SUBTYPE_mjpg:
|
case SPA_MEDIA_SUBTYPE_mjpg:
|
||||||
{
|
{
|
||||||
struct spa_video_info_mjpg info;
|
struct spa_video_info_mjpg info = { 0 };
|
||||||
if (spa_format_video_mjpg_parse(param, &info) >= 0) {
|
if (spa_format_video_mjpg_parse(param, &info) >= 0) {
|
||||||
snprintf(n->format, sizeof(n->format), "MJPG %dx%d",
|
snprintf(n->format, sizeof(n->format), "MJPG %dx%d",
|
||||||
info.size.width, info.size.height);
|
info.size.width, info.size.height);
|
||||||
|
|
@ -254,7 +254,7 @@ static void node_param(void *data, int seq,
|
||||||
}
|
}
|
||||||
case SPA_MEDIA_SUBTYPE_h264:
|
case SPA_MEDIA_SUBTYPE_h264:
|
||||||
{
|
{
|
||||||
struct spa_video_info_h264 info;
|
struct spa_video_info_h264 info = { 0 };
|
||||||
if (spa_format_video_h264_parse(param, &info) >= 0) {
|
if (spa_format_video_h264_parse(param, &info) >= 0) {
|
||||||
snprintf(n->format, sizeof(n->format), "H264 %dx%d",
|
snprintf(n->format, sizeof(n->format), "H264 %dx%d",
|
||||||
info.size.width, info.size.height);
|
info.size.width, info.size.height);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue