Commit c8a3130f authored by hpi1's avatar hpi1

Added return value to gc_decode_ts()

parent a2254288
......@@ -367,11 +367,11 @@ void gc_free(GRAPHICS_CONTROLLER **p)
* graphics stream input
*/
void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
int gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigned num_blocks, int64_t stc)
{
if (!gc) {
GC_TRACE("gc_decode_ts(): no graphics controller\n");
return;
return -1;
}
if (pid >= 0x1400 && pid < 0x1500) {
......@@ -388,7 +388,7 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
stc);
if (!gc->igs || !gc->igs->complete) {
bd_mutex_unlock(&gc->mutex);
return;
return 0;
}
gc->popup_visible = 0;
......@@ -396,6 +396,8 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
_select_page(gc, 0);
bd_mutex_unlock(&gc->mutex);
return 1;
}
else if (pid >= 0x1200 && pid < 0x1300) {
......@@ -408,9 +410,13 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
stc);
if (!gc->pgs || !gc->pgs->complete) {
return;
return 0;
}
return 1;
}
return -1;
}
/*
......
......@@ -75,11 +75,18 @@ BD_PRIVATE GRAPHICS_CONTROLLER *gc_init(struct bd_registers_s *regs,
BD_PRIVATE void gc_free(GRAPHICS_CONTROLLER **p);
/*
* input stream (MPEG-TS IG stream)
/**
*
* Decode data from MPEG-TS input stream
*
* @param p GRAPHICS_CONTROLLER object
* @param pid mpeg-ts PID to decode (HDMV IG/PG stream)
* @param block mpeg-ts data
* @param num_blocks number of aligned units in data
* @param stc current playback time
* @return <0 on error, 0 when not complete, >0 when complete
*/
BD_PRIVATE void gc_decode_ts(GRAPHICS_CONTROLLER *p,
BD_PRIVATE int gc_decode_ts(GRAPHICS_CONTROLLER *p,
uint16_t pid,
uint8_t *block, unsigned num_blocks,
int64_t stc);
......
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