Changeset 60b1076 in mainline


Ignore:
Timestamp:
2013-09-03T21:49:45Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef63103
Parents:
1b34360
Message:

wavplay: Improve error and info messages.

Location:
uspace/app/wavplay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wavplay/dplay.c

    r1b34360 r60b1076  
    151151            device_event_callback, pb);
    152152        if (ret != EOK) {
    153                 printf("Failed to register event callback.\n");
     153                printf("Failed to register event callback: %s.\n",
     154                    str_error(ret));
    154155                return;
    155156        }
     
    285286                            pb->f.sample_format);
    286287                        if (ret != EOK) {
    287                                 printf("Failed to start playback\n");
     288                                printf("Failed to start playback: %s\n",
     289                                    str_error(ret));
    288290                                return;
    289291                        }
     
    291293                        ret = audio_pcm_get_buffer_pos(pb->device, &pos);
    292294                        if (ret != EOK) {
    293                                 printf("Failed to update position indicator\n");
     295                                printf("Failed to update position indicator "
     296                                   "%s\n", str_error(ret));
    294297                        }
    295298                }
     
    308311                const int ret = audio_pcm_get_buffer_pos(pb->device, &pos);
    309312                if (ret != EOK) {
    310                         printf("Failed to update position indicator\n");
     313                        printf("Failed to update position indicator %s\n",
     314                            str_error(ret));
    311315                }
    312316                getuptime(&time);
     
    350354        ret = audio_pcm_get_info_str(session, &info);
    351355        if (ret != EOK) {
    352                 printf("Failed to get PCM info.\n");
     356                printf("Failed to get PCM info: %s.\n", str_error(ret));
    353357                goto close_session;
    354358        }
  • uspace/app/wavplay/main.c

    r1b34360 r60b1076  
    7979            &format.sampling_rate, &format.sample_format, &error);
    8080        if (ret != EOK) {
    81                 printf("Error parsing wav header: %s.\n", error);
     81                printf("Error parsing `%s' wav header: %s.\n", filename, error);
    8282                fclose(source);
    8383                return EINVAL;
    8484        }
     85
     86        printf("File `%s' format: %u channel(s), %uHz, %s.\n", filename,
     87            format.channels, format.sampling_rate,
     88            pcm_sample_format_str(format.sample_format));
    8589
    8690        /* Allocate buffer and create new context */
     
    136140            &format.sampling_rate, &format.sample_format, &error);
    137141        if (ret != EOK) {
    138                 printf("Error parsing wav header: %s.\n", error);
     142                printf("Error parsing `%s' wav header: %s.\n", filename, error);
    139143                fclose(source);
    140144                return EINVAL;
    141145        }
     146        printf("File `%s' format: %u channel(s), %uHz, %s.\n", filename,
     147            format.channels, format.sampling_rate,
     148            pcm_sample_format_str(format.sample_format));
    142149
    143150        /* Connect new playback context */
Note: See TracChangeset for help on using the changeset viewer.