mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
gst/mpegstream/: get rid of non-standard "..." ranges in case statements.
Original commit message from CVS: * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private): * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_syshead), (gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes): get rid of non-standard "..." ranges in case statements.
This commit is contained in:
parent
40b740126e
commit
a6b45475b2
3 changed files with 113 additions and 148 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-03-28 Benjamin Otte <otte@gnome.org>
|
||||
|
||||
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
|
||||
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_syshead),
|
||||
(gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes):
|
||||
get rid of non-standard "..." ranges in case statements.
|
||||
|
||||
2004-03-27 Martin Soto <martinsoto@users.sourceforge.net>
|
||||
|
||||
* gst/mpegstream/gstmpegdemux.c:
|
||||
|
|
|
@ -636,8 +636,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
|||
case 0:
|
||||
/* Private stream 1. */
|
||||
|
||||
switch (ps_id_code) {
|
||||
case 0x80...0x87:
|
||||
if (ps_id_code >= 0x80 && ps_id_code <= 0x87) {
|
||||
GST_LOG_OBJECT (dvd_demux,
|
||||
"we have an audio (AC3) packet, track %d", ps_id_code - 0x80);
|
||||
outstream = DEMUX_CLASS (dvd_demux)->get_audio_stream (mpeg_demux,
|
||||
|
@ -650,9 +649,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
|||
|
||||
headerlen += 4;
|
||||
datalen -= 4;
|
||||
break;
|
||||
|
||||
case 0xA0...0xA7:
|
||||
} else if (ps_id_code >= 0xA0 && ps_id_code <= 0xA7) {
|
||||
GST_LOG_OBJECT (dvd_demux,
|
||||
"we have an audio (LPCM) packet, track %d", ps_id_code - 0xA0);
|
||||
lpcm_sample_info = basebuf[headerlen + 9];
|
||||
|
@ -666,9 +663,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
|||
/* Get rid of the LPCM header. */
|
||||
headerlen += 7;
|
||||
datalen -= 7;
|
||||
break;
|
||||
|
||||
case 0x20...0x3f:
|
||||
} else if (ps_id_code >= 0x20 && ps_id_code <= 0x3F) {
|
||||
GST_LOG_OBJECT (dvd_demux,
|
||||
"we have a subpicture packet, track %d", ps_id_code - 0x20);
|
||||
outstream = CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
|
||||
|
@ -676,12 +671,9 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
|
|||
|
||||
headerlen += 1;
|
||||
datalen -= 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
} else {
|
||||
GST_ERROR_OBJECT (dvd_demux,
|
||||
"unknown DVD (private 1) id 0x%02x", ps_id_code);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -551,38 +551,26 @@ gst_mpeg_demux_parse_syshead (GstMPEGParse * mpeg_parse, GstBuffer * buffer)
|
|||
buf_byte_size_bound = STD_buffer_size_bound * 1024;
|
||||
}
|
||||
|
||||
switch (stream_id) {
|
||||
case 0xBD:
|
||||
if (stream_id == 0xBD) {
|
||||
/* Private stream 1. */
|
||||
outstream = CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
||||
0, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
||||
break;
|
||||
|
||||
case 0xBF:
|
||||
} else if (stream_id == 0xBF) {
|
||||
/* Private stream 2. */
|
||||
outstream = CLASS (mpeg_demux)->get_private_stream (mpeg_demux,
|
||||
1, GST_MPEG_DEMUX_PRIVATE_UNKNOWN, NULL);
|
||||
break;
|
||||
|
||||
case 0xC0...0xDF:
|
||||
} else if (stream_id >= 0xC0 && stream_id <= 0xDF) {
|
||||
/* Audio. */
|
||||
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
||||
stream_id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
||||
break;
|
||||
|
||||
case 0xE0...0xEF:
|
||||
} else if (stream_id >= 0xE0 && stream_id <= 0xEF) {
|
||||
/* Video. */
|
||||
{
|
||||
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
||||
|
||||
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
||||
stream_id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
GST_WARNING ("unkown stream id 0x%02x", stream_id);
|
||||
break;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (mpeg_demux, "unkown stream id 0x%02x", stream_id);
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "STD_buffer_bound_scale %d",
|
||||
|
@ -736,46 +724,35 @@ done:
|
|||
timestamp = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
case 0xBD:
|
||||
if (id == 0xBD) {
|
||||
/* Private stream 1. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 1 packet");
|
||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 0, timestamp,
|
||||
headerlen, datalen);
|
||||
break;
|
||||
|
||||
case 0xBF:
|
||||
} else if (id == 0xBF) {
|
||||
/* Private stream 2. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 2 packet");
|
||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 1, timestamp,
|
||||
headerlen, datalen);
|
||||
break;
|
||||
|
||||
case 0xC0...0xDF:
|
||||
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||
/* Audio. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have an audio packet");
|
||||
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
||||
id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||
timestamp, headerlen + 4, datalen);
|
||||
break;
|
||||
|
||||
case 0xE0...0xEF:
|
||||
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||
/* Video. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
||||
{
|
||||
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
||||
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
||||
|
||||
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
||||
id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
||||
}
|
||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||
timestamp, headerlen + 4, datalen);
|
||||
break;
|
||||
|
||||
default:
|
||||
GST_WARNING ("unkown stream id 0x%02x", id);
|
||||
break;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (mpeg_demux, "unkown stream id 0x%02x", id);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -876,46 +853,35 @@ gst_mpeg_demux_parse_pes (GstMPEGParse * mpeg_parse, GstBuffer * buffer)
|
|||
GST_DEBUG_OBJECT (mpeg_demux, "headerlen is %d, datalen is %d",
|
||||
headerlen, datalen);
|
||||
|
||||
switch (id) {
|
||||
case 0xBD:
|
||||
if (id == 0xBD) {
|
||||
/* Private stream 1. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 1 packet");
|
||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 0, timestamp,
|
||||
headerlen, datalen);
|
||||
break;
|
||||
|
||||
case 0xBF:
|
||||
} else if (id == 0xBF) {
|
||||
/* Private stream 2. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a private 2 packet");
|
||||
CLASS (mpeg_demux)->process_private (mpeg_demux, buffer, 1, timestamp,
|
||||
headerlen, datalen);
|
||||
break;
|
||||
|
||||
case 0xC0...0xDF:
|
||||
} else if (id >= 0xC0 && id <= 0xDF) {
|
||||
/* Audio. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have an audio packet");
|
||||
outstream = CLASS (mpeg_demux)->get_audio_stream (mpeg_demux,
|
||||
id - 0xC0, GST_MPEG_DEMUX_AUDIO_MPEG, NULL);
|
||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||
timestamp, headerlen + 4, datalen);
|
||||
break;
|
||||
|
||||
case 0xE0...0xEF:
|
||||
} else if (id >= 0xE0 && id <= 0xEF) {
|
||||
/* Video. */
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
||||
{
|
||||
gint mpeg_version = !GST_MPEG_PARSE_IS_MPEG2 (mpeg_demux) ? 1 : 2;
|
||||
|
||||
GST_DEBUG_OBJECT (mpeg_demux, "we have a video packet");
|
||||
|
||||
outstream = CLASS (mpeg_demux)->get_video_stream (mpeg_demux,
|
||||
id - 0xE0, GST_MPEG_DEMUX_VIDEO_MPEG, &mpeg_version);
|
||||
}
|
||||
CLASS (mpeg_demux)->send_subbuffer (mpeg_demux, outstream, buffer,
|
||||
timestamp, headerlen + 4, datalen);
|
||||
break;
|
||||
|
||||
default:
|
||||
GST_WARNING ("unkown stream id 0x%02x", id);
|
||||
break;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (mpeg_demux, "unkown stream id 0x%02x", id);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue