mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
gst: only pop and adjust choice when we pushed something
This commit is contained in:
parent
eb93f259e0
commit
78aaf6c0bc
1 changed files with 40 additions and 24 deletions
|
|
@ -379,10 +379,12 @@ handle_video_fields (ConvertData *d)
|
|||
if (idx != GST_VIDEO_FORMAT_UNKNOWN && idx < (int)SPA_N_ELEMENTS (video_format_map))
|
||||
spa_pod_builder_id (&d->b, video_format_map[idx]);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
value = gst_structure_get_value (d->cs, "width");
|
||||
value2 = gst_structure_get_value (d->cs, "height");
|
||||
if (value || value2) {
|
||||
|
|
@ -395,10 +397,12 @@ handle_video_fields (ConvertData *d)
|
|||
|
||||
spa_pod_builder_rectangle (&d->b, v.width, v.height);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
|
||||
value = gst_structure_get_value (d->cs, "framerate");
|
||||
if (value) {
|
||||
|
|
@ -411,10 +415,12 @@ handle_video_fields (ConvertData *d)
|
|||
|
||||
spa_pod_builder_fraction (&d->b, v.num, v.denom);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
|
||||
value = gst_structure_get_value (d->cs, "max-framerate");
|
||||
if (value) {
|
||||
|
|
@ -427,10 +433,12 @@ handle_video_fields (ConvertData *d)
|
|||
|
||||
spa_pod_builder_fraction (&d->b, v.num, v.denom);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -456,10 +464,12 @@ handle_audio_fields (ConvertData *d)
|
|||
if (idx < (int)SPA_N_ELEMENTS (audio_format_map))
|
||||
spa_pod_builder_id (&d->b, audio_format_map[idx]);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
value = gst_structure_get_value (d->cs, "layout");
|
||||
|
|
@ -482,10 +492,12 @@ handle_audio_fields (ConvertData *d)
|
|||
|
||||
spa_pod_builder_id (&d->b, layout);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
value = gst_structure_get_value (d->cs, "rate");
|
||||
if (value) {
|
||||
|
|
@ -498,10 +510,12 @@ handle_audio_fields (ConvertData *d)
|
|||
|
||||
spa_pod_builder_int (&d->b, v);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
value = gst_structure_get_value (d->cs, "channels");
|
||||
if (value) {
|
||||
int v;
|
||||
|
|
@ -513,10 +527,12 @@ handle_audio_fields (ConvertData *d)
|
|||
|
||||
spa_pod_builder_int (&d->b, v);
|
||||
}
|
||||
if (i > 0) {
|
||||
choice = spa_pod_builder_pop(&d->b, &f);
|
||||
if (i <= 1)
|
||||
if (i == 1)
|
||||
choice->body.type = SPA_CHOICE_None;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue