mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 07:22:44 +02:00
libtriple: improve cPlayback performance
avoid unnecessary memcpy in read_mpeg(), significantly improving performance
Origin commit data
------------------
Branch: master
Commit: 2ba4fe17c7
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-01-15 (Sun, 15 Jan 2012)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1167,11 +1167,6 @@ ssize_t cPlayback::read_mpeg()
|
|||||||
if (count + pesPacketLen >= pesbuf_pos)
|
if (count + pesPacketLen >= pesbuf_pos)
|
||||||
{
|
{
|
||||||
lt_debug("buffer len: %ld, pesPacketLen: %d :-(\n", pesbuf_pos - count, pesPacketLen);
|
lt_debug("buffer len: %ld, pesPacketLen: %d :-(\n", pesbuf_pos - count, pesPacketLen);
|
||||||
if (count != 0)
|
|
||||||
{
|
|
||||||
memmove(pesbuf, ppes, pesbuf_pos - count);
|
|
||||||
pesbuf_pos -= count;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1179,8 +1174,6 @@ ssize_t cPlayback::read_mpeg()
|
|||||||
if ((tsPacksCount + 1) * 188 > INBUF_SIZE - inbuf_pos)
|
if ((tsPacksCount + 1) * 188 > INBUF_SIZE - inbuf_pos)
|
||||||
{
|
{
|
||||||
lt_info("not enough size in inbuf (needed %d, got %d)\n", (tsPacksCount + 1) * 188, INBUF_SIZE - inbuf_pos);
|
lt_info("not enough size in inbuf (needed %d, got %d)\n", (tsPacksCount + 1) * 188, INBUF_SIZE - inbuf_pos);
|
||||||
memmove(pesbuf, ppes, pesbuf_pos - count);
|
|
||||||
pesbuf_pos -= count;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1223,10 +1216,10 @@ ssize_t cPlayback::read_mpeg()
|
|||||||
}
|
}
|
||||||
} //if (av)
|
} //if (av)
|
||||||
|
|
||||||
memmove(pesbuf, ppes + pesPacketLen, pesbuf_pos - count - pesPacketLen);
|
count += pesPacketLen;
|
||||||
pesbuf_pos -= count + pesPacketLen;
|
|
||||||
count = 0; /* we shifted everything to the start of the buffer => offset == 0 */
|
|
||||||
}
|
}
|
||||||
|
memmove(pesbuf, pesbuf + count, pesbuf_pos - count);
|
||||||
|
pesbuf_pos -= count;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user