diff src/http.c @ 183:27e5f99f8991

Delete ES out function. Merge Yazawa's tssplitter_lite. Add liner option.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Mon, 05 May 2014 22:08:21 +0900
parents 726fe10d9e4a
children
line wrap: on
line diff
--- a/src/http.c	Mon May 05 21:59:36 2014 +0900
+++ b/src/http.c	Mon May 05 22:08:21 2014 +0900
@@ -612,39 +612,9 @@
     http_close
 };
 
-// TS_BITRATEはやっつけ仕事過ぎる気がします
-#define TS_BITRATE (10*1000*1000/8)
 #define MAX_STREAMING ((off_t)100*1000*1000*1000)
 static off_t
 get_streaming_length (void)
 {
-    off_t length = 0;
-    extern thread_data *gp_tdata;
-    thread_data *tdata = gp_tdata;
-    time_t cur_time;
-    struct timespec cur;
-    struct timespec diff;
-    clock_gettime(CLOCK_REALTIME, &cur);
-    off_t bitrate = 0;
-
-    if ( tdata->indefinite ) {
-        return MAX_STREAMING;
-    }
-    diff.tv_nsec = cur.tv_nsec - tdata->streamer->start.tv_nsec;
-    diff.tv_sec = cur.tv_sec - tdata->streamer->start.tv_sec;
-
-    if ( diff.tv_sec < 1 ) {
-        bitrate = TS_BITRATE;
-    } else {
-        bitrate = (((off_t)tdata->streamer->total_byte)*1e9) /
-            ( (((off_t)diff.tv_sec)*1e9) + diff.tv_nsec);
-    }
-
-    time(&cur_time);
-    length = (tdata->start_time +tdata->recsec -cur_time) * bitrate;
-    if ( length < 0 ) {
-        length = 0;
-    }
-    length = length - (length % LENGTH_PACKET);
-    return length;
+    return MAX_STREAMING;
 }