Changeset 2135


Ignore:
Timestamp:
Aug 21, 2012, 2:42:58 PM (6 years ago)
Author:
matthijs
Message:

audiod: Slightly improve error reporting.

Any mad errors are now reported on stderr (which is still invisible for
regular users, but may help debugging). Also, instead of ignoring all
errors, default to stopping the playback of the current file on an
error, which should at least prevent audiod from segfaulting.

References: #1078

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fon/audiod/src/audiod.c

    r1960 r2135  
    550550
    551551        return MAD_FLOW_CONTINUE;
     552        fprintf(stderr, "%s done\n", __FUNCTION__);
    552553}
    553554
     
    556557mad_error(void *data, struct mad_stream *stream, struct mad_frame *frame)
    557558{
     559        fprintf(stderr, "mad_error: %s\n", mad_stream_errorstr(stream));
    558560        switch (stream->error) {
    559561        case MAD_ERROR_BADDATAPTR:
     562        case MAD_ERROR_LOSTSYNC:
     563                fprintf(stderr, "trying to continue\n");
    560564                return MAD_FLOW_CONTINUE;
    561565
    562         case MAD_ERROR_LOSTSYNC:
    563                 return MAD_FLOW_CONTINUE;
    564 
    565566        default:
    566                 return MAD_FLOW_IGNORE;
    567         }
    568 
    569         return MAD_FLOW_CONTINUE;
     567                fprintf(stderr, "skipping file\n");
     568                return MAD_FLOW_BREAK;
     569        }
    570570}
    571571
Note: See TracChangeset for help on using the changeset viewer.