Skip to content

Commit

Permalink
Merge pull request #129 from brarcher/fix-custom-resolution
Browse files Browse the repository at this point in the history
Fix custom resolution
  • Loading branch information
brarcher authored Aug 27, 2018
2 parents 4d84d38 + e9d0ec9 commit f7e8259
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public class MainActivity extends AppCompatActivity
R.id.fpsContainerDivider,
R.id.resolutionContainer,
R.id.resolutionContainerDivider,
R.id.resolutionCustomContainer,
R.id.resolutionContainerDivider,
R.id.videoBitrateContainer,
R.id.videoBitrateContainerDivider));
final List<Integer> AUDIO_SETTINGS_IDS = Collections.unmodifiableList(Arrays.asList(
Expand Down Expand Up @@ -777,7 +779,7 @@ private void startEncode()

final String customString = getString(R.string.custom);

if(resolution.equals(customString))
if(resolution.equals(customString) && container.supportedVideoCodecs.size() > 0)
{
resolution = resolutionCustom.getText().toString();
String [] split = resolution.split("x");
Expand Down Expand Up @@ -1117,7 +1119,16 @@ public SetCustomAdapter(String customString, @IdRes int customFieldId)
public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
{
String value = (String)parent.getItemAtPosition(position);
customField.setVisibility(value.equals(customString) ? View.VISIBLE : View.GONE);
MediaContainer container = (MediaContainer)containerSpinner.getSelectedItem();

if(value.equals(customString) && container.supportedVideoCodecs.size() > 0)
{
customField.setVisibility(View.VISIBLE);
}
else
{
customField.setVisibility(View.GONE);
}
}

@Override
Expand Down

0 comments on commit f7e8259

Please sign in to comment.