summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2010-03-20 23:28:33 +0000
committerphintuka <phintuka>2010-03-20 23:28:33 +0000
commit1ca8ec2a8cc0ca3be6fb90a6ac29c9fcf9936141 (patch)
tree6b3c9f750c6dceb8ead10fbf92185c3cfdd3eca3
parentb1d868d3edc339cd382bae774d80461df213046c (diff)
downloadxineliboutput-1ca8ec2a8cc0ca3be6fb90a6ac29c9fcf9936141.tar.gz
xineliboutput-1ca8ec2a8cc0ca3be6fb90a6ac29c9fcf9936141.tar.bz2
Fixd lost BUF_FLAG_FRAME_END flags: Split large packets before appending data. This way there is always allocated
buffer element and BUF_FLAG_FRAME_END is sent even if there is no queued data.
-rw-r--r--xine/ts2es.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/xine/ts2es.c b/xine/ts2es.c
index adae90d2..8f953018 100644
--- a/xine/ts2es.c
+++ b/xine/ts2es.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: ts2es.c,v 1.9 2010-03-20 22:20:18 phintuka Exp $
+ * $Id: ts2es.c,v 1.10 2010-03-20 23:28:33 phintuka Exp $
*
*/
@@ -167,6 +167,16 @@ buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data, fifo_buffer_t *src_fifo)
}
}
+ /* split large packets */
+ if (this->buf) {
+ if ((this->video && this->buf->size >= 2048) ||
+ this->buf->size >= this->buf->max_size-2*TS_SIZE) {
+
+ result = this->buf;
+ this->buf = NULL;
+ }
+ }
+
/* need new buffer ? */
if (!this->buf) {
/* discard data until first payload start indicator */
@@ -199,14 +209,6 @@ buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data, fifo_buffer_t *src_fifo)
ts2es_parse_pes(this);
}
- /* split large packets */
- if ((this->video && this->buf->size >= 2048+64-TS_SIZE) ||
- this->buf->size >= this->buf->max_size-TS_SIZE) {
-
- result = this->buf;
- this->buf = NULL;
- }
-
return result;
}