Commit 0db4be88 authored by hpi1's avatar hpi1

Updated graphics_processor_Decode_pes() return value

parent 17896a40
......@@ -358,7 +358,7 @@ int graphics_processor_decode_pes(PG_DISPLAY_SET **s, PES_BUFFER **p, int64_t st
*s = calloc(1, sizeof(PG_DISPLAY_SET));
}
while (*p && !(*s)->complete) {
while (*p) {
/* time to decode next segment ? */
if (stc >= 0 && (*p)->dts > stc) {
......@@ -373,21 +373,30 @@ int graphics_processor_decode_pes(PG_DISPLAY_SET **s, PES_BUFFER **p, int64_t st
return 0;
}
if ((*p)->len <= 2) {
BD_DEBUG(DBG_DECODE, "segment too short, skipping (%d bytes)\n", (*p)->len);
pes_buffer_remove(p, *p);
continue;
}
/* decode segment */
GP_TRACE("Decoding segment, dts %010"PRId64" pts %010"PRId64" len %d\n",
(*p)->dts, (*p)->pts, (*p)->len);
/* decode segment */
if ((*p)->len > 2) {
(*s)->complete = 0;
(*s)->complete = 0;
_decode_segment(*s, *p);
_decode_segment(*s, *p);
pes_buffer_remove(p, *p);
if ((*s)->complete) {
return 1;
}
pes_buffer_remove(p, *p);
}
return (*s)->complete;
return 0;
}
/*
......
......@@ -61,18 +61,20 @@ BD_PRIVATE void pg_display_set_free(PG_DISPLAY_SET **s);
BD_PRIVATE GRAPHICS_PROCESSOR *graphics_processor_init(void);
BD_PRIVATE void graphics_processor_free(GRAPHICS_PROCESSOR **p);
/*
* stc: current STC
/**
*
* return: 0 : wait for more data
* 1 : display set complete
* Decode data from MPEG-PES input stream
*
* Only segments where DTS <= STC are decoded.
* If STC < 0, all segments are immediately decoded to display set.
*
* All decoded PES packets are removed from buffer.
*
* @param s display set
* @param buf data to decode
* @param stc current playback time
* @return 1 if display set was completed, 0 otherwise
*/
BD_PRIVATE int
graphics_processor_decode_pes(PG_DISPLAY_SET **s,
struct pes_buffer_s **buf,
......@@ -82,6 +84,9 @@ graphics_processor_decode_pes(PG_DISPLAY_SET **s,
*
* Decode data from MPEG-TS input stream
*
* Segments are queued and decoded when DTS <= STC.
* If STC < 0, all segments are immediately decoded to display set.
*
* @param p GRAPHICS_PROCESSOR object
* @param s display set
* @param pid mpeg-ts PID to decode (HDMV IG/PG stream)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment