diff options
author | eddyg <[email protected]> | 2009-11-24 23:16:27 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2009-11-24 23:16:27 +0000 |
commit | 5f75cd8ec876da15e1ca61b8b0e4386289fc0f85 (patch) | |
tree | 942cebe393f611a4ff210bb70e342480e37b4152 /libhb/dvdnav.c | |
parent | 0cae267d5396fb0d622c8ccd95625d78a7a44475 (diff) |
Rate limit hb_error() messages to at most 1 message per second of the same message. Repeats will be counted and presented as a count when 1 second has elapsed since the first error of a sequence, or an error message with a different string.
Also modified dvdnav to use hb_error() to take advantage of the limiting.
This works around a real bug from dvdnav where the Mac GUI becomes unresponsive during the output of large numbers of errors.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2971 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvdnav.c')
-rw-r--r-- | libhb/dvdnav.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c index d525b9624..2f1ac93cc 100644 --- a/libhb/dvdnav.c +++ b/libhb/dvdnav.c @@ -921,7 +921,7 @@ static int hb_dvdnav_seek( hb_dvd_t * e, float f ) result = dvdnav_get_next_block( d->dvdnav, buf, &event, &len ); if ( result == DVDNAV_STATUS_ERR ) { - hb_log("dvdnav: Read Error, %s", dvdnav_err_to_string(d->dvdnav)); + hb_error("dvdnav: Read Error, %s", dvdnav_err_to_string(d->dvdnav)); return 0; } switch ( event ) @@ -987,7 +987,7 @@ static int hb_dvdnav_read( hb_dvd_t * e, hb_buffer_t * b ) result = dvdnav_get_next_block( d->dvdnav, b->data, &event, &len ); if ( result == DVDNAV_STATUS_ERR ) { - hb_log("dvdnav: Read Error, %s", dvdnav_err_to_string(d->dvdnav)); + hb_error("dvdnav: Read Error, %s", dvdnav_err_to_string(d->dvdnav)); if (dvdnav_sector_search(d->dvdnav, 1, SEEK_CUR) != DVDNAV_STATUS_OK) { hb_error( "dvd: dvdnav_sector_search failed - %s", @@ -997,7 +997,7 @@ static int hb_dvdnav_read( hb_dvd_t * e, hb_buffer_t * b ) error_count++; if (error_count > 10) { - hb_log("dvdnav: Error, too many consecutive read errors"); + hb_error("dvdnav: Error, too many consecutive read errors"); return 0; } continue; |