forked from len0rd/rockbox
fix warnings on some systems / format specifier mismatch
Instead of %ld or %lx, use %jd or %jx for off_t (after casting to intmax_t) Change-Id: I4cd1831816820d2862b383ff8782e548b2fca294
This commit is contained in:
parent
93ecb97693
commit
87452d775e
6 changed files with 70 additions and 60 deletions
|
@ -231,13 +231,13 @@ static void init_mad(void)
|
|||
frame.sbsample = &sbsample;
|
||||
|
||||
/* We do this so libmad doesn't try to call codec_calloc(). This needs to
|
||||
* be called before mad_stream_init(), mad_frame_inti() and
|
||||
* be called before mad_stream_init(), mad_frame_inti() and
|
||||
* mad_synth_init(). */
|
||||
frame.overlap = &mad_frame_overlap;
|
||||
stream.main_data = &mad_main_data;
|
||||
|
||||
/* Call mad initialization. Those will zero the arrays frame.overlap,
|
||||
* frame.sbsample and frame.sbsample_prev. Therefore there is no need to
|
||||
* frame.sbsample and frame.sbsample_prev. Therefore there is no need to
|
||||
* zero them here. */
|
||||
mad_stream_init(&stream);
|
||||
mad_frame_init(&frame);
|
||||
|
@ -270,7 +270,7 @@ static int audio_sync(struct audio_thread_data *td,
|
|||
time = INVALID_TIMESTAMP;
|
||||
str = &tmp_str;
|
||||
str->id = audio_str.id;
|
||||
}
|
||||
}
|
||||
|
||||
str->hdr.pos = sd->sk.pos;
|
||||
str->hdr.limit = sd->sk.pos + sd->sk.len;
|
||||
|
@ -282,8 +282,9 @@ static int audio_sync(struct audio_thread_data *td,
|
|||
{
|
||||
if (audio_buffer(str, STREAM_PM_RANDOM_ACCESS) == STREAM_DATA_END)
|
||||
{
|
||||
DEBUGF("audio_sync:STR_DATA_END\n aqu:%ld swl:%ld swr:%ld\n",
|
||||
(long)audio_queue.used, str->hdr.win_left, str->hdr.win_right);
|
||||
DEBUGF("audio_sync:STR_DATA_END\n aqu:%ld swl:%jd swr:%jd\n",
|
||||
(long)audio_queue.used, (intmax_t) str->hdr.win_left,
|
||||
(intmax_t) str->hdr.win_right);
|
||||
if (audio_queue.used <= MAD_BUFFER_GUARD)
|
||||
goto sync_data_end;
|
||||
}
|
||||
|
@ -401,7 +402,7 @@ static void audio_thread_msg(struct audio_thread_data *td)
|
|||
td->state = TSTATE_EOS;
|
||||
|
||||
reply = true;
|
||||
break;
|
||||
break;
|
||||
|
||||
case STREAM_RESET:
|
||||
if (td->state == TSTATE_DATA)
|
||||
|
|
|
@ -79,10 +79,10 @@ static int disk_buf_on_data_notify(struct stream_hdr *sh)
|
|||
{
|
||||
/* It was - don't register */
|
||||
DEBUGF("(was ready)\n"
|
||||
" swl:%lu swr:%lu\n"
|
||||
" dwl:%lu dwr:%lu\n",
|
||||
sh->win_left, sh->win_right,
|
||||
disk_buf.win_left, disk_buf.win_right);
|
||||
" swl:%jd swr:%jd\n"
|
||||
" dwl:%jd dwr:%jd\n",
|
||||
(intmax_t) sh->win_left, (intmax_t) sh->win_right,
|
||||
(intmax_t) disk_buf.win_left, (intmax_t) disk_buf.win_right);
|
||||
/* Be sure it's not listed though if multiple requests were made */
|
||||
list_remove_item(nf_list, sh);
|
||||
return DISK_BUF_NOTIFY_OK;
|
||||
|
@ -96,10 +96,10 @@ static int disk_buf_on_data_notify(struct stream_hdr *sh)
|
|||
disk_buf.state = TSTATE_BUFFERING;
|
||||
list_add_item(nf_list, sh);
|
||||
DEBUGF("(registered)\n"
|
||||
" swl:%lu swr:%lu\n"
|
||||
" dwl:%lu dwr:%lu\n",
|
||||
sh->win_left, sh->win_right,
|
||||
disk_buf.win_left, disk_buf.win_right);
|
||||
" swl:%jd swr:%jd\n"
|
||||
" dwl:%jd dwr:%jd\n",
|
||||
(intmax_t) sh->win_left, (intmax_t) sh->win_right,
|
||||
(intmax_t) disk_buf.win_left, (intmax_t) disk_buf.win_right);
|
||||
return DISK_BUF_NOTIFY_REGISTERED;
|
||||
}
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ static void disk_buf_on_reset(ssize_t pos)
|
|||
{
|
||||
if (--tag, --page < 0)
|
||||
page = disk_buf.pgcount - 1;
|
||||
|
||||
|
||||
if (disk_buf.cache[page] != tag)
|
||||
break;
|
||||
|
||||
|
@ -347,8 +347,8 @@ static void disk_buf_on_reset(ssize_t pos)
|
|||
disk_buf.tail = disk_buf.start + MAP_OFFSET_TO_BUFFER(anchor);
|
||||
|
||||
DEBUGF("disk buf reset\n"
|
||||
" dwl:%ld dwr:%ld\n",
|
||||
disk_buf.win_left, disk_buf.win_right);
|
||||
" dwl:%jd dwr:%jd\n",
|
||||
(intmax_t) disk_buf.win_left, (intmax_t) disk_buf.win_right);
|
||||
|
||||
/* Next read position is at right edge */
|
||||
rb->lseek(disk_buf.in_file, disk_buf.win_right, SEEK_SET);
|
||||
|
@ -466,7 +466,7 @@ static void disk_buf_thread(void)
|
|||
disk_buf.state = TSTATE_EOS;
|
||||
disk_buf.status = STREAM_STOPPED;
|
||||
|
||||
while (1)
|
||||
while (1)
|
||||
{
|
||||
if (disk_buf.state != TSTATE_EOS)
|
||||
{
|
||||
|
@ -591,7 +591,7 @@ static ssize_t disk_buf_probe(off_t start, size_t length, void **p)
|
|||
rng.tag_start = tag;
|
||||
rng.tag_end = tag_end;
|
||||
rng.pg_start = page;
|
||||
|
||||
|
||||
result = rb->queue_send(disk_buf.q, DISK_BUF_CACHE_RANGE,
|
||||
(intptr_t)&rng);
|
||||
|
||||
|
@ -786,12 +786,14 @@ ssize_t disk_buf_prepare_streaming(off_t pos, size_t len)
|
|||
else if (pos > disk_buf.filesize)
|
||||
pos = disk_buf.filesize;
|
||||
|
||||
DEBUGF("prepare streaming:\n pos:%ld len:%lu\n", pos, (unsigned long)len);
|
||||
DEBUGF("prepare streaming:\n pos:%jd len:%lu\n",
|
||||
(intmax_t) pos, (unsigned long)len);
|
||||
|
||||
pos = disk_buf_lseek(pos, SEEK_SET);
|
||||
len = disk_buf_probe(pos, len, NULL);
|
||||
|
||||
DEBUGF(" probe done: pos:%ld len:%lu\n", pos, (unsigned long)len);
|
||||
DEBUGF(" probe done: pos:%jd len:%lu\n",
|
||||
(intmax_t) pos, (unsigned long)len);
|
||||
|
||||
len = disk_buf_send_msg(STREAM_RESET, pos);
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id)
|
|||
|
||||
state = STATE2; /* Last scan was early */
|
||||
sk.dir = SSCAN_REVERSE;
|
||||
|
||||
|
||||
DEBUGF(">> tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n",
|
||||
(unsigned)time_left, (unsigned)time, (unsigned)currpts,
|
||||
(unsigned)time_right, (long)pos_left, (long)pos_new,
|
||||
|
@ -495,7 +495,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id)
|
|||
case STATE0:
|
||||
/* Hardly likely except at very beginning - just do L->R scan
|
||||
* to find something */
|
||||
DEBUGF("!! no timestamp on first probe: %ld\n", sk.pos);
|
||||
DEBUGF("!! no timestamp on first probe: %jd\n", (intmax_t) sk.pos);
|
||||
case STATE2:
|
||||
case STATE3:
|
||||
/* Could just be missing timestamps because the interval is
|
||||
|
@ -733,10 +733,10 @@ static int parse_demux(struct stream *str, enum stream_parse_mode type)
|
|||
/* Problem? Meh...probably not but just a corrupted section.
|
||||
* Try to resync the parser which will probably succeed. */
|
||||
DEBUGF("packet start code prefix not found: 0x%02x\n"
|
||||
" wl:%lu wr:%lu\n"
|
||||
" wl:%jd wr:%jd\n"
|
||||
" p:%p cp:%p cpe:%p\n"
|
||||
" dbs:%p dbe:%p dbt:%p\n",
|
||||
str->id, str->hdr.win_left, str->hdr.win_right,
|
||||
str->id, (intmax_t) str->hdr.win_left, (intmax_t) str->hdr.win_right,
|
||||
p, str->curr_packet, str->curr_packet_end,
|
||||
disk_buf.start, disk_buf.end, disk_buf.tail);
|
||||
str->state = SSTATE_SYNC;
|
||||
|
@ -993,7 +993,7 @@ try_again:
|
|||
|
||||
if (mpeg_parser_scan_start_code(&sk, MPEG_START_GOP))
|
||||
{
|
||||
DEBUGF("GOP found at: %ld\n", sk.pos);
|
||||
DEBUGF("GOP found at: %jd\n", (intmax_t) sk.pos);
|
||||
|
||||
unsigned id = mpeg_parser_scan_pes(&sk);
|
||||
|
||||
|
@ -1019,7 +1019,7 @@ try_again:
|
|||
str_parser.parms.sd.sk.len = 1024*1024;
|
||||
str_parser.parms.sd.sk.dir = SSCAN_FORWARD;
|
||||
|
||||
DEBUGF("thumb pos:%ld len:%ld\n", str_parser.parms.sd.sk.pos,
|
||||
DEBUGF("thumb pos:%jd len:%ld\n", (intmax_t) str_parser.parms.sd.sk.pos,
|
||||
(long)str_parser.parms.sd.sk.len);
|
||||
|
||||
result = str_send_msg(&video_str, STREAM_SYNC,
|
||||
|
@ -1072,7 +1072,8 @@ void parser_prepare_streaming(void)
|
|||
if (!stream_get_window(&sw))
|
||||
sw.left = sw.right = disk_buf.filesize;
|
||||
|
||||
DEBUGF(" swl:%ld swr:%ld\n", sw.left, sw.right);
|
||||
DEBUGF(" swl:%jd swr:%jd\n",
|
||||
(intmax_t) sw.left, (intmax_t) sw.right);
|
||||
|
||||
if (sw.right > disk_buf.filesize - 4*MIN_BUFAHEAD)
|
||||
sw.right = disk_buf.filesize - 4*MIN_BUFAHEAD;
|
||||
|
@ -1094,7 +1095,7 @@ int parser_init_stream(void)
|
|||
* should succeed if it really is a video-only stream */
|
||||
video_str.hdr.pos = 0;
|
||||
video_str.hdr.limit = 256*1024;
|
||||
|
||||
|
||||
if (parse_demux(&video_str, STREAM_PM_RANDOM_ACCESS) == STREAM_OK)
|
||||
{
|
||||
/* Found a video packet - assume program stream */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue