summaryrefslogtreecommitdiff
path: root/apps/codecs/librm/rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/librm/rm.c')
-rw-r--r--apps/codecs/librm/rm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/codecs/librm/rm.c b/apps/codecs/librm/rm.c
index c802a0c5a9..b205e7f88d 100644
--- a/apps/codecs/librm/rm.c
+++ b/apps/codecs/librm/rm.c
@@ -27,6 +27,8 @@
27#include "codeclib.h" 27#include "codeclib.h"
28#endif 28#endif
29 29
30#define SWAP(a, b) do{uint8_t SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
31
30void advance_buffer(uint8_t **buf, int val) 32void advance_buffer(uint8_t **buf, int val)
31{ 33{
32 *buf += val; 34 *buf += val;
@@ -464,7 +466,6 @@ void rm_get_packet_fd(int fd,RMContext *rmctx, RMPacket *pkt)
464 " stream = %d\n" 466 " stream = %d\n"
465 " timestmp= %d\n",pkt->version,pkt->length,pkt->stream_number,pkt->timestamp); 467 " timestmp= %d\n",pkt->version,pkt->length,pkt->stream_number,pkt->timestamp);
466 468
467 //getchar();
468 if(pkt->version == 0) 469 if(pkt->version == 0)
469 { 470 {
470 read_uint8(fd,&packet_group); 471 read_uint8(fd,&packet_group);
@@ -550,7 +551,16 @@ int rm_get_packet(uint8_t **src,RMContext *rmctx, RMPacket *pkt)
550 } 551 }
551 rmctx->audio_pkt_cnt = --rmctx->sub_packet_cnt; 552 rmctx->audio_pkt_cnt = --rmctx->sub_packet_cnt;
552 } 553 }
553 } 554 }
555
556 else if (rmctx->codec_type == CODEC_AC3) {
557 /* The byte order of the data is reversed from standard AC3 */
558 for(x = 0; x < pkt->length - PACKET_HEADER_SIZE; x+=2) {
559 SWAP((*src)[0], (*src)[1]);
560 *src += 2;
561 }
562 *src -= x;
563 }
554 rmctx->audio_pkt_cnt++; 564 rmctx->audio_pkt_cnt++;
555 }while(++(rmctx->sub_packet_cnt) < h); 565 }while(++(rmctx->sub_packet_cnt) < h);
556 566