Skip to content

Commit

Permalink
ALSA: oxfw: code refactoring for stop condition of packet streaming
Browse files Browse the repository at this point in the history
This commit unifies stop condition due to queueing error and unmatched
state of the target device.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Sakamoto authored and Takashi Iwai committed Jun 12, 2019
1 parent 5ad8407 commit da2af86
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sound/firewire/oxfw/oxfw-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw,
if (err < 0)
goto end;

/* packet queueing error */
if (amdtp_streaming_error(stream))
stop_stream(oxfw, stream);

err = snd_oxfw_stream_get_current_formation(oxfw, dir, &formation);
if (err < 0)
goto end;
Expand All @@ -300,7 +296,8 @@ int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw,
if (pcm_channels == 0)
pcm_channels = formation.pcm;

if ((formation.rate != rate) || (formation.pcm != pcm_channels)) {
if (formation.rate != rate || formation.pcm != pcm_channels ||
amdtp_streaming_error(stream)) {
if (opposite != NULL) {
err = check_connection_used_by_others(oxfw, opposite);
if (err < 0)
Expand Down

0 comments on commit da2af86

Please sign in to comment.