Commit 4aeb9e3e79116178a1bc3fcdb377c22ba8a6b030

Authored by LuoZheSi
1 parent 305882ac

fix(change mode,sync):sync after optek link changing mode

Showing 1 changed file with 10 additions and 5 deletions
... ... @@ -1320,6 +1320,7 @@ void taskDec(void *pvParameters)
1320 1320 U16 size;
1321 1321 U16 logcnt = 0;
1322 1322 U16 min_count = 0xffff;
  1323 + U8 play_chan;
1323 1324
1324 1325 DBG_Printf("task dec\n");
1325 1326
... ... @@ -1394,6 +1395,7 @@ void taskDec(void *pvParameters)
1394 1395 {
1395 1396 optek_link_change_mode(req_mode,req_txlen,req_rxlen,OPTEK_LINK_H1);
1396 1397 optek_link_mode = req_mode;
  1398 + spk_out_sync_w_tx_status = SPK_AND_TX_SYNCING;
1397 1399 }
1398 1400 #endif
1399 1401
... ... @@ -1647,10 +1649,14 @@ void taskDec(void *pvParameters)
1647 1649 //DBG_PIN_LOW;
1648 1650 if (pOut_up != NULL)
1649 1651 {
1650   - app_main_data.playing_stream_chans = 1;
  1652 + play_chan = 1;
1651 1653 len >>= 1;
1652 1654 pOut = pOut_up;
1653 1655 }
  1656 + else
  1657 + {
  1658 + play_chan = app_main_data.playing_stream_chans;
  1659 + }
1654 1660
1655 1661 while(len > max_out_len)
1656 1662 {
... ... @@ -1691,7 +1697,7 @@ void taskDec(void *pvParameters)
1691 1697 int *dst = pDacbuf;
1692 1698 short *src = msrc;
1693 1699
1694   - if (app_main_data.playing_stream_chans == 1)
  1700 + if (play_chan == 1)
1695 1701 {
1696 1702 samples = len>>1;
1697 1703 for (i=0; i<samples; i++)
... ... @@ -1718,7 +1724,7 @@ void taskDec(void *pvParameters)
1718 1724 U8 *dst = pDacbuf;
1719 1725 U8 *src = msrc;
1720 1726
1721   - if (app_main_data.playing_stream_chans == 1)
  1727 + if (play_chan == 1)
1722 1728 {
1723 1729 samples = len/3;
1724 1730 for (i=0; i<samples; i++)
... ... @@ -1754,7 +1760,7 @@ void taskDec(void *pvParameters)
1754 1760 int *dst = pDacbuf;
1755 1761 int *src = msrc;
1756 1762
1757   - if (app_main_data.playing_stream_chans == 1)
  1763 + if (play_chan == 1)
1758 1764 {
1759 1765 samples = len>>1;
1760 1766 for (i=0; i<samples; i++)
... ... @@ -2052,5 +2058,4 @@ U8* wait_decode_event(void)
2052 2058 void set_dac_out_size(U16 size)
2053 2059 {
2054 2060 awOut_contrls.awSize = size>>2;
2055   - //DBG_Printf("size:%d,chan:%d\r\n",awOut_contrls.awSize,app_main_data.playing_stream_chans);
2056 2061 }
... ...
Please register or login to post a comment