SYSTEM AND METHOD FOR BUFFERING STREAMING MEDIA UTILIZING DOUBLE BUFFERS
Disclosed herein are systems, methods, and non-transitory computer-readable storage media for inserting messages in streaming media from a server to a client utilizing double buffers. A system streams a message to the client at an insertion point in the media. The message can be an advertisement specific to a client and can be based on client preferences, client behavior and physical location of the client. The system streams a set of compressed media segments from a compressed buffer storing a compressed version of media to the client based on a first pointer. The system streams a set of uncompressed media segments from an uncompressed buffer storing uncompressed media to the client based on a second pointer. The compressed media plays back at the client at an increased speed in relation to uncompressed media to compensate for time spent streaming the message to the client.
1 . A method of inserting messages in streaming media to a client from a server, the method comprising:
streaming a message to the client at an insertion point in the media;
streaming a set of compressed media segments from a compressed buffer storing a compressed version of media to the client based at least on a first pointer, the first pointer being associated with the client; and
streaming a set of uncompressed media segments from an uncompressed buffer storing uncompressed media to the client based at least on a second pointer, the second pointer being associated with the client.
2 . The method of claim 1 , wherein the streaming media is streaming audio.
3 . The method of claim 1 , wherein the client communicates with the server via a telephone connection.
4 . The method of claim 1 , wherein the first pointer indicates the starting address of a segment in the set of compressed media segments.
5 . The method of claim 4 , wherein the server updates the first pointer after an uncompressed media segment is streamed to the client.
6 . The method of claim 1 , wherein the second pointer indicates the starting address of a segment in the set of uncompressed media segments.
7 . The method of claim 6 , wherein the server updates the second pointer after a compressed media segment is streamed to the client.
8 . The method of claim 1 , wherein the server streams compressed media segments until all compressed media segments have been streamed.
9 . The method of claim 1 , wherein the compressed media plays back at the client at an increased speed.
10 . The method of claim 1 , wherein any number of clients connects to and receives streaming media from the server concurrently.
11 . The method of claim 1 , wherein the message is a targeted advertisement.
12 . The method of claim 11 , wherein the targeted advertisement is based on at least one of client preferences, client behaviors and client physical location.
13 . The method of claim 1 , wherein the number of media segments in a set is based on at least one of the amount of data the client requests and when the server inserts the advertisement.
14 . The method of claim 1 , wherein the size of media segments in a set is based on at least one of the amount of data the client requests and when the server inserts the advertisement.
15 . A system for locating an advertisement insertion point, the system comprising:
a processor;
a memory storing instructions for controlling the processor to perform steps comprising:
streaming a message to the client at an insertion point in the media;
streaming a set of compressed media segments from a compressed buffer storing a compressed version of media to the client based at least on a first pointer, the first pointer being associated with the client; and
streaming a set of uncompressed media segments from an uncompressed buffer storing uncompressed media to the client based at least on a second pointer, the second pointer being associated with the client.
16 . The system of claim 15 , wherein the compressed media plays back at the client at an increased speed.
17 . The system of claim 15 , wherein any number of clients connects to and receives streaming media from the server concurrently.
18 . A non-transitory computer-readable storage medium storing instructions which, when executed by a computing device, cause the computing device to perform steps comprising:
streaming a message to the client at an insertion point in the media;
streaming a set of compressed media segments from a compressed buffer storing a compressed version of media to the client based at least on a first pointer, the first pointer being associated with the client; and
streaming a set of uncompressed media segments from an uncompressed buffer storing uncompressed media to the client based at least on a second pointer, the second pointer being associated with the client.
19 . The non-transitory computer-readable storage medium of claim 18 , wherein the message is a targeted advertisement.
20 . The non-transitory computer-readable storage medium of claim 19 , wherein the targeted advertisement is based on at least one of client preferences, client behaviors and client physical location.