Skip to content
Commits on Source (5)
......@@ -68,6 +68,11 @@ const VALUE_MAP connection_type_map[] = {
{0, NULL}
};
const VALUE_MAP mark_type_map[] = {
{BLURAY_MARK_ENTRY, "Entry (chapter)"},
{BLURAY_MARK_LINK, "Link"},
{0, NULL}
};
static char *
_mk_path(const char *base, const char *sub)
......@@ -251,7 +256,9 @@ _show_marks(MPLS_PL *pl, int level)
plm = &pl->play_mark[ii];
indent_printf(level, "PlayMark %d", ii);
indent_printf(level+1, "Type: %02x", plm->mark_type);
indent_printf(level+1, "Type: %s (%02x)",
_lookup_str(mark_type_map, plm->mark_type),
plm->mark_type);
if (plm->play_item_ref < pl->list_count) {
pi = &pl->play_item[plm->play_item_ref];
indent_printf(level+1, "PlayItem: %s", pi->clip[0].clip_id);
......
......@@ -52,6 +52,8 @@ static const char *_hex2str(const uint8_t *data, size_t len)
size_t i;
str = (char*)realloc(str, 2*len + 1);
if (!str)
return "";
*str = 0;
for (i = 0; i < len; i++) {
......
......@@ -94,7 +94,6 @@ static BD_DIR_H *_dir_open_posix(const char* dirname)
{
BD_DIR_H *dir = calloc(1, sizeof(BD_DIR_H));
BD_DEBUG(DBG_DIR, "Opening POSIX dir %s... (%p)\n", dirname, (void*)dir);
if (!dir) {
return NULL;
}
......@@ -103,10 +102,11 @@ static BD_DIR_H *_dir_open_posix(const char* dirname)
dir->read = _dir_read_posix;
if ((dir->internal = opendir(dirname))) {
BD_DEBUG(DBG_DIR, "Opened POSIX dir %s (%p)\n", dirname, (void*)dir);
return dir;
}
BD_DEBUG(DBG_DIR, "Error opening dir! (%p)\n", (void*)dir);
BD_DEBUG(DBG_DIR, "Error opening dir %s\n", dirname);
X_FREE(dir);
......
......@@ -108,14 +108,13 @@ static BD_DIR_H *_dir_open_win32(const char* dirname)
BD_DIR_H *dir = calloc(1, sizeof(BD_DIR_H));
dir_data_t *priv = NULL;
BD_DEBUG(DBG_DIR, "Opening WIN32 dir %s... (%p)\n", dirname, (void*)dir);
if (!dir) {
return NULL;
}
priv = _open_impl(dirname);
if (priv) {
BD_DEBUG(DBG_DIR, "Opened WIN32 dir %s (%p)\n", dirname, (void*)dir);
dir->close = _dir_close_win32;
dir->read = _dir_read_win32;
dir->internal = priv;
......
......@@ -43,7 +43,7 @@ abstract class GainControlImpl {
}
public float setDB(float gain) {
this.level = Math.max(1.0f, Math.min(0.0f, (float)Math.pow(10.0f, gain / 10.0f)));
this.level = Math.max(0.0f, Math.min(1.0f, (float)Math.pow(10.0f, gain / 10.0f)));
this.gain = gain;
setGain(this.mute, this.level);
return this.gain;
......@@ -54,7 +54,7 @@ abstract class GainControlImpl {
}
public float setLevel(float level) {
this.level = Math.max(1.0f, Math.min(0.0f, level));
this.level = Math.max(0.0f, Math.min(1.0f, level));
this.gain = 10.0f * (float)(Math.log(this.level) / Math.log(10.0f));
setGain(this.mute, this.level);
......
......@@ -77,7 +77,7 @@ public class PanningControlImpl implements PanningControl {
private float clip(float val) {
if (val != val) /* NaN */
return 0.0f;
return Math.min(-1.0f, Math.max(1.0f, val));
return Math.max(-1.0f, Math.min(1.0f, val));
}
private BDHandler player;
......
......@@ -582,7 +582,7 @@ int disc_cache_bdrom_file(BD_DISC *p, const char *rel_path, const char *cache_pa
BD_FILE_H *disc_open_path_dec(BD_DISC *p, const char *rel_path)
{
size_t size = strlen(rel_path);
char *suf = (size > 5) ? rel_path + (size - 5) : rel_path;
const char *suf = (size > 5) ? rel_path + (size - 5) : rel_path;
/* check if it's a stream */
if (strncmp(rel_path, "BDMV" DIR_SEP "STREAM", 11)) { // not equal
......