1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed incrementing the 'state' variables in the repacker classes in remux.c to avoid warnings with g++ 4.1.0

This commit is contained in:
Klaus Schmidinger 2006-01-01 15:06:02 +01:00
parent dbc2abadd8
commit f50844d733
3 changed files with 20 additions and 13 deletions

View File

@ -1448,6 +1448,8 @@ Ville Skytt
for reporting that the default value for "Setup/EPG bugfix level" was wrong for reporting that the default value for "Setup/EPG bugfix level" was wrong
for fixing initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid for fixing initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid
warnings with g++ 4.1.0 warnings with g++ 4.1.0
for reporting warnings with g++ 4.1.0 regarding incrementing the 'state' variables
in the repacker classes in remux.c
Steffen Beyer <cpunk@reactor.de> Steffen Beyer <cpunk@reactor.de>
for fixing setting the colored button help after deleting a recording in case the next for fixing setting the colored button help after deleting a recording in case the next

View File

@ -4060,3 +4060,5 @@ Video Disk Recorder Revision History
- Made the static cControl functions thread safe (thanks to Patrick Fischer). - Made the static cControl functions thread safe (thanks to Patrick Fischer).
- Fixed initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid - Fixed initializing pthread_mutexattr_t and pthread_rwlockattr_t to avoid
warnings with g++ 4.1.0 (thanks to Ville Skyttä). warnings with g++ 4.1.0 (thanks to Ville Skyttä).
- Fixed incrementing the 'state' variables in the repacker classes in remux.c
to avoid warnings with g++ 4.1.0 (reported by Ville Skyttä).

29
remux.c
View File

@ -11,7 +11,7 @@
* The cRepacker family's code was originally written by Reinhard Nissl <rnissl@gmx.de>, * The cRepacker family's code was originally written by Reinhard Nissl <rnissl@gmx.de>,
* and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de. * and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de.
* *
* $Id: remux.c 1.50 2005/12/04 13:56:50 kls Exp $ * $Id: remux.c 1.51 2006/01/01 14:58:53 kls Exp $
*/ */
#include "remux.h" #include "remux.h"
@ -246,7 +246,8 @@ private:
syncing, syncing,
findPicture, findPicture,
scanPicture scanPicture
} state; };
int state;
public: public:
cVideoRepacker(void); cVideoRepacker(void);
virtual void Reset(void); virtual void Reset(void);
@ -380,13 +381,13 @@ void cVideoRepacker::Repack(cRingBufferLinear *ResultBuffer, const uchar *Data,
// maximum we can hold in one PES packet // maximum we can hold in one PES packet
packetTodo = maxPacketSize - pesHeaderLen; packetTodo = maxPacketSize - pesHeaderLen;
// go on with finding the picture data // go on with finding the picture data
((int &)state)++; state++;
} }
break; break;
case 0x01 ... 0xAF: // slice start codes case 0x01 ... 0xAF: // slice start codes
if (state == findPicture) { if (state == findPicture) {
// go on with scanning the picture data // go on with scanning the picture data
((int &)state)++; state++;
} }
break; break;
} }
@ -547,7 +548,8 @@ private:
enum eState { enum eState {
syncing, syncing,
scanFrame scanFrame
} state; };
int state;
int frameTodo; int frameTodo;
int frameSize; int frameSize;
int cid; int cid;
@ -747,7 +749,7 @@ void cAudioRepacker::Repack(cRingBufferLinear *ResultBuffer, const uchar *Data,
// expected remainder of audio frame: so far we have read 3 bytes from the frame header // expected remainder of audio frame: so far we have read 3 bytes from the frame header
frameTodo = frameSize - 3; frameTodo = frameSize - 3;
// go on with collecting the frame's data // go on with collecting the frame's data
((int &)state)++; state++;
} }
} }
} }
@ -928,14 +930,15 @@ private:
uchar chk1; uchar chk1;
uchar chk2; uchar chk2;
int ac3todo; int ac3todo;
enum { enum eState {
find_0b, find_0b,
find_77, find_77,
store_chk1, store_chk1,
store_chk2, store_chk2,
get_length, get_length,
output_packet output_packet
} state; };
int state;
int skippedBytes; int skippedBytes;
void ResetPesHeader(bool ContinuationFrame = false); void ResetPesHeader(bool ContinuationFrame = false);
void AppendSubStreamID(bool ContinuationFrame = false); void AppendSubStreamID(bool ContinuationFrame = false);
@ -1120,7 +1123,7 @@ void cDolbyRepacker::Repack(cRingBufferLinear *ResultBuffer, const uchar *Data,
switch (state) { switch (state) {
case find_0b: case find_0b:
if (*data == 0x0B) { if (*data == 0x0B) {
++(int &)state; state++;
// copy header information once for later use // copy header information once for later use
if (pesHeaderBackupLen > 0) { if (pesHeaderBackupLen > 0) {
pesHeaderLen = pesHeaderBackupLen; pesHeaderLen = pesHeaderBackupLen;
@ -1143,21 +1146,21 @@ void cDolbyRepacker::Repack(cRingBufferLinear *ResultBuffer, const uchar *Data,
done++; done++;
todo--; todo--;
skippedBytes++; // collect number of skipped bytes while syncing skippedBytes++; // collect number of skipped bytes while syncing
++(int &)state; state++;
continue; continue;
case store_chk1: case store_chk1:
chk1 = *data++; chk1 = *data++;
done++; done++;
todo--; todo--;
skippedBytes++; // collect number of skipped bytes while syncing skippedBytes++; // collect number of skipped bytes while syncing
++(int &)state; state++;
continue; continue;
case store_chk2: case store_chk2:
chk2 = *data++; chk2 = *data++;
done++; done++;
todo--; todo--;
skippedBytes++; // collect number of skipped bytes while syncing skippedBytes++; // collect number of skipped bytes while syncing
++(int &)state; state++;
continue; continue;
case get_length: case get_length:
ac3todo = 2 * frameSizes[*data]; ac3todo = 2 * frameSizes[*data];
@ -1195,7 +1198,7 @@ void cDolbyRepacker::Repack(cRingBufferLinear *ResultBuffer, const uchar *Data,
pesHeader[pesHeaderLen++] = chk1; pesHeader[pesHeaderLen++] = chk1;
pesHeader[pesHeaderLen++] = chk2; pesHeader[pesHeaderLen++] = chk2;
ac3todo -= 4; ac3todo -= 4;
++(int &)state; state++;
// fall through to output // fall through to output
case output_packet: { case output_packet: {
int bite = 0; int bite = 0;