diff options
| author | Kaori Hagihara <khagihara@users.noreply.github.com> | 2011-08-24 17:07:28 +0000 |
|---|---|---|
| committer | Kaori Hagihara <khagihara@users.noreply.github.com> | 2011-08-24 17:07:28 +0000 |
| commit | 4da816e4598995db099f22a017c3598c19a753ed (patch) | |
| tree | 5f4809f4f550765657131059c0c17c8b5e830df5 /applications/jpip/libopenjpip/msgqueue_manager.c | |
| parent | 9c475467d55adf3624ef7a9b50d6ad1703db5535 (diff) | |
support tid request
Diffstat (limited to 'applications/jpip/libopenjpip/msgqueue_manager.c')
| -rw-r--r-- | applications/jpip/libopenjpip/msgqueue_manager.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/applications/jpip/libopenjpip/msgqueue_manager.c b/applications/jpip/libopenjpip/msgqueue_manager.c index 13845bb3..7d0d8dff 100644 --- a/applications/jpip/libopenjpip/msgqueue_manager.c +++ b/applications/jpip/libopenjpip/msgqueue_manager.c @@ -28,6 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <stdio.h> #include <stdlib.h> #include <math.h> #include <sys/types.h> @@ -742,31 +743,45 @@ Byte_t * recons_codestream( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte Byte_t *codestream = NULL; int last_tileID; int tileID; - + bool found; + Byte8_t binOffset; + *codelen = 0; // main header first ptr = msgqueue->first; + binOffset = 0; while(( ptr = search_message( MAINHEADER_MSG, -1, csn, ptr))!=NULL){ - codestream = add_msgstream( ptr, jpipstream, codestream, codelen); + if( ptr->bin_offset == binOffset){ + codestream = add_msgstream( ptr, jpipstream, codestream, codelen); + binOffset += ptr->length; + } ptr = ptr->next; } last_tileID = get_last_tileID( msgqueue, csn); for( tileID=0; tileID <= last_tileID; tileID++){ - bool found = false; + found = false; + binOffset = 0; + ptr = msgqueue->first; while(( ptr = search_message( TILE_MSG, tileID, csn, ptr))!=NULL){ - found = true; - codestream = add_msgstream( ptr, jpipstream, codestream, codelen); + if( ptr->bin_offset == binOffset){ + found = true; + codestream = add_msgstream( ptr, jpipstream, codestream, codelen); + binOffset += ptr->length; + } ptr = ptr->next; } ptr = msgqueue->first; while(( ptr = search_message( EXT_TILE_MSG, tileID, csn, ptr))!=NULL){ if( ptr->aux >= minlev){ - found = true; - codestream = add_msgstream( ptr, jpipstream, codestream, codelen); + if( ptr->bin_offset == binOffset){ + found = true; + codestream = add_msgstream( ptr, jpipstream, codestream, codelen); + binOffset += ptr->length; + } } ptr = ptr->next; } |
