aboutsummaryrefslogtreecommitdiff
path: root/doc/demux_asf.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2005-03-20 23:56:28 +0000
committerChristian Grothoff <christian@grothoff.org>2005-03-20 23:56:28 +0000
commit1c28cb2260c09ddefde567313b8f54161bd3b969 (patch)
tree0249db41ef8e06c5ded1bda9705ffadcccdcd15c /doc/demux_asf.c
parent20d2e51022f79e021a0ad27b97ac41d9543337ea (diff)
downloadlibextractor-1c28cb2260c09ddefde567313b8f54161bd3b969.tar.gz
libextractor-1c28cb2260c09ddefde567313b8f54161bd3b969.zip
removing tailing whitespace
Diffstat (limited to 'doc/demux_asf.c')
-rw-r--r--doc/demux_asf.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/doc/demux_asf.c b/doc/demux_asf.c
index 896ad92..57e0eaa 100644
--- a/doc/demux_asf.c
+++ b/doc/demux_asf.c
@@ -93,7 +93,7 @@ typedef struct demux_asf_s {
93 uint32_t packet_size; 93 uint32_t packet_size;
94 uint8_t packet_flags; 94 uint8_t packet_flags;
95 uint32_t data_size; 95 uint32_t data_size;
96 96
97 asf_stream_t streams[MAX_NUM_STREAMS]; 97 asf_stream_t streams[MAX_NUM_STREAMS];
98 uint32_t bitrates[MAX_NUM_STREAMS]; 98 uint32_t bitrates[MAX_NUM_STREAMS];
99 int num_streams; 99 int num_streams;
@@ -144,7 +144,7 @@ typedef struct demux_asf_s {
144 144
145 off_t header_size; 145 off_t header_size;
146 int buf_flag_seek; 146 int buf_flag_seek;
147 147
148 /* first packet position */ 148 /* first packet position */
149 int64_t first_packet_pos; 149 int64_t first_packet_pos;
150 150
@@ -172,7 +172,7 @@ static uint8_t get_byte (demux_asf_t *this) {
172 /* printf ("%02x ", buf); */ 172 /* printf ("%02x ", buf); */
173 173
174 if (i != 1) { 174 if (i != 1) {
175 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 175 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
176 printf ("demux_asf: end of data\n"); 176 printf ("demux_asf: end of data\n");
177 this->status = DEMUX_FINISHED; 177 this->status = DEMUX_FINISHED;
178 } 178 }
@@ -190,7 +190,7 @@ static uint16_t get_le16 (demux_asf_t *this) {
190 /* printf (" [%02x %02x] ", buf[0], buf[1]); */ 190 /* printf (" [%02x %02x] ", buf[0], buf[1]); */
191 191
192 if (i != 2) { 192 if (i != 2) {
193 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 193 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
194 printf ("demux_asf: end of data\n"); 194 printf ("demux_asf: end of data\n");
195 this->status = DEMUX_FINISHED; 195 this->status = DEMUX_FINISHED;
196 } 196 }
@@ -208,7 +208,7 @@ static uint32_t get_le32 (demux_asf_t *this) {
208 /* printf ("%02x %02x %02x %02x ", buf[0], buf[1], buf[2], buf[3]); */ 208 /* printf ("%02x %02x %02x %02x ", buf[0], buf[1], buf[2], buf[3]); */
209 209
210 if (i != 4) { 210 if (i != 4) {
211 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 211 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
212 printf ("demux_asf: end of data\n"); 212 printf ("demux_asf: end of data\n");
213 this->status = DEMUX_FINISHED; 213 this->status = DEMUX_FINISHED;
214 } 214 }
@@ -224,12 +224,12 @@ static uint64_t get_le64 (demux_asf_t *this) {
224 i = this->input->read (this->input, buf, 8); 224 i = this->input->read (this->input, buf, 8);
225 225
226 if (i != 8) { 226 if (i != 8) {
227 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 227 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
228 printf ("demux_asf: end of data\n"); 228 printf ("demux_asf: end of data\n");
229 this->status = DEMUX_FINISHED; 229 this->status = DEMUX_FINISHED;
230 } 230 }
231 231
232 return (uint64_t) buf[0] 232 return (uint64_t) buf[0]
233 | ((uint64_t) buf[1] << 8) 233 | ((uint64_t) buf[1] << 8)
234 | ((uint64_t) buf[2] << 16) 234 | ((uint64_t) buf[2] << 16)
235 | ((uint64_t) buf[3] << 24) 235 | ((uint64_t) buf[3] << 24)
@@ -249,7 +249,7 @@ static int get_guid (demux_asf_t *this) {
249 for(i = 0; i < 8; i++) { 249 for(i = 0; i < 8; i++) {
250 g.v4[i] = get_byte(this); 250 g.v4[i] = get_byte(this);
251 } 251 }
252 252
253 for (i = 1; i < GUID_END; i++) { 253 for (i = 1; i < GUID_END; i++) {
254 if (!memcmp(&g, &guids[i].guid, sizeof(GUID))) { 254 if (!memcmp(&g, &guids[i].guid, sizeof(GUID))) {
255#ifdef LOG 255#ifdef LOG
@@ -258,8 +258,8 @@ static int get_guid (demux_asf_t *this) {
258 return i; 258 return i;
259 } 259 }
260 } 260 }
261 261
262 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 262 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
263 printf ("demux_asf: unknown GUID: 0x%x, 0x%x, 0x%x, " 263 printf ("demux_asf: unknown GUID: 0x%x, 0x%x, 0x%x, "
264 "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n", 264 "{ 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx, 0x%hx }\n",
265 g.v1, g.v2, g.v3, 265 g.v1, g.v2, g.v3,
@@ -339,7 +339,7 @@ static int asf_read_header (demux_asf_t *this) {
339 339
340 guid = get_guid(this); 340 guid = get_guid(this);
341 if (guid != GUID_ASF_HEADER) { 341 if (guid != GUID_ASF_HEADER) {
342 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 342 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
343 printf ("demux_asf: file doesn't start with an asf header\n"); 343 printf ("demux_asf: file doesn't start with an asf header\n");
344 return 0; 344 return 0;
345 } 345 }
@@ -440,7 +440,7 @@ static int asf_read_header (demux_asf_t *this) {
440 this->reorder_w = (buffer[2]<<8)|buffer[1]; 440 this->reorder_w = (buffer[2]<<8)|buffer[1];
441 this->reorder_b = (buffer[4]<<8)|buffer[3]; 441 this->reorder_b = (buffer[4]<<8)|buffer[3];
442 this->reorder_w /= this->reorder_b; 442 this->reorder_w /= this->reorder_b;
443 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 443 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
444 printf ("demux_asf: audio conceal interleave detected (%d x %d x %d)\n", 444 printf ("demux_asf: audio conceal interleave detected (%d x %d x %d)\n",
445 this->reorder_w, this->reorder_h, this->reorder_b ); 445 this->reorder_w, this->reorder_h, this->reorder_b );
446 } else { 446 } else {
@@ -763,13 +763,13 @@ static void check_newpts (demux_asf_t *this, int64_t pts, int video, int frame_e
763#endif 763#endif
764 } 764 }
765 } 765 }
766 766
767 this->last_frame_pts = pts; 767 this->last_frame_pts = pts;
768 } 768 }
769} 769}
770 770
771 771
772static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream, 772static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
773 int frag_offset, int seq, 773 int frag_offset, int seq,
774 int64_t timestamp, 774 int64_t timestamp,
775 int frag_len, int payload_size) { 775 int frag_len, int payload_size) {
@@ -782,7 +782,7 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
782 /* new packet */ 782 /* new packet */
783 stream->seq = seq; 783 stream->seq = seq;
784 } else { 784 } else {
785 if (seq == stream->seq && 785 if (seq == stream->seq &&
786 frag_offset == stream->frag_offset) { 786 frag_offset == stream->frag_offset) {
787 /* continuing packet */ 787 /* continuing packet */
788 } else { 788 } else {
@@ -799,19 +799,19 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
799 } 799 }
800 } 800 }
801 801
802 802
803 while( frag_len ) { 803 while( frag_len ) {
804 if ( frag_len < stream->fifo->buffer_pool_buf_size ) 804 if ( frag_len < stream->fifo->buffer_pool_buf_size )
805 bufsize = frag_len; 805 bufsize = frag_len;
806 else 806 else
807 bufsize = stream->fifo->buffer_pool_buf_size; 807 bufsize = stream->fifo->buffer_pool_buf_size;
808 808
809 buf = stream->fifo->buffer_pool_alloc (stream->fifo); 809 buf = stream->fifo->buffer_pool_alloc (stream->fifo);
810 this->input->read (this->input, buf->content, bufsize); 810 this->input->read (this->input, buf->content, bufsize);
811 811
812 buf->extra_info->input_pos = this->input->get_current_pos (this->input); 812 buf->extra_info->input_pos = this->input->get_current_pos (this->input);
813 if (this->rate) 813 if (this->rate)
814 buf->extra_info->input_time = (int)((int64_t)buf->extra_info->input_pos 814 buf->extra_info->input_time = (int)((int64_t)buf->extra_info->input_pos
815 * 1000 / this->rate); 815 * 1000 / this->rate);
816 else 816 else
817 buf->extra_info->input_time = 0; 817 buf->extra_info->input_time = 0;
@@ -827,13 +827,13 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
827 buf->type = stream->buf_type; 827 buf->type = stream->buf_type;
828 buf->size = bufsize; 828 buf->size = bufsize;
829 timestamp = 0; 829 timestamp = 0;
830 830
831 stream->frag_offset += bufsize; 831 stream->frag_offset += bufsize;
832 frag_len -= bufsize; 832 frag_len -= bufsize;
833 833
834 package_done = (stream->frag_offset == payload_size); 834 package_done = (stream->frag_offset == payload_size);
835 835
836 if ((buf->type & BUF_MAJOR_MASK) == BUF_VIDEO_BASE) 836 if ((buf->type & BUF_MAJOR_MASK) == BUF_VIDEO_BASE)
837 check_newpts (this, buf->pts, PTS_VIDEO, package_done); 837 check_newpts (this, buf->pts, PTS_VIDEO, package_done);
838 else 838 else
839 check_newpts (this, buf->pts, PTS_AUDIO, package_done); 839 check_newpts (this, buf->pts, PTS_AUDIO, package_done);
@@ -1000,7 +1000,7 @@ static void asf_read_packet(demux_asf_t *this) {
1000 this->input->seek (this->input, this->packet_size_left, SEEK_CUR); 1000 this->input->seek (this->input, this->packet_size_left, SEEK_CUR);
1001 1001
1002 if (!asf_get_packet(this)) { 1002 if (!asf_get_packet(this)) {
1003 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1003 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1004 printf ("demux_asf: get_packet failed\n"); 1004 printf ("demux_asf: get_packet failed\n");
1005 this->status = DEMUX_FINISHED; 1005 this->status = DEMUX_FINISHED;
1006 return ; 1006 return ;
@@ -1008,7 +1008,7 @@ static void asf_read_packet(demux_asf_t *this) {
1008 1008
1009 if (this->packet_padsize > this->packet_size) { 1009 if (this->packet_padsize > this->packet_size) {
1010 /* skip packet */ 1010 /* skip packet */
1011 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1011 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1012 printf ("demux_asf: invalid padsize: %d\n", this->packet_padsize); 1012 printf ("demux_asf: invalid padsize: %d\n", this->packet_padsize);
1013 this->frame = this->nb_frames - 1; 1013 this->frame = this->nb_frames - 1;
1014 return; 1014 return;
@@ -1066,7 +1066,7 @@ static void asf_read_packet(demux_asf_t *this) {
1066 case 3: 1066 case 3:
1067 seq = get_le32(this); s_hdr_size += 4; break; 1067 seq = get_le32(this); s_hdr_size += 4; break;
1068 default: 1068 default:
1069 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1069 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1070 printf ("demux_asf: seq=0\n"); 1070 printf ("demux_asf: seq=0\n");
1071 seq = 0; 1071 seq = 0;
1072 } 1072 }
@@ -1079,7 +1079,7 @@ static void asf_read_packet(demux_asf_t *this) {
1079 case 3: 1079 case 3:
1080 frag_offset = get_le32(this); s_hdr_size += 4; break; 1080 frag_offset = get_le32(this); s_hdr_size += 4; break;
1081 default: 1081 default:
1082 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1082 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1083 printf ("demux_asf: frag_offset=0\n"); 1083 printf ("demux_asf: frag_offset=0\n");
1084 frag_offset = 0; 1084 frag_offset = 0;
1085 } 1085 }
@@ -1101,7 +1101,7 @@ static void asf_read_packet(demux_asf_t *this) {
1101 1101
1102 if (rlen > this->packet_size_left) { 1102 if (rlen > this->packet_size_left) {
1103 /* skip packet */ 1103 /* skip packet */
1104 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1104 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1105 printf ("demux_asf: invalid rlen %d\n", rlen); 1105 printf ("demux_asf: invalid rlen %d\n", rlen);
1106 this->frame = this->nb_frames - 1; 1106 this->frame = this->nb_frames - 1;
1107 return; 1107 return;
@@ -1148,7 +1148,7 @@ static void asf_read_packet(demux_asf_t *this) {
1148 1148
1149 if (data_length > this->packet_size_left) { 1149 if (data_length > this->packet_size_left) {
1150 /* skip packet */ 1150 /* skip packet */
1151 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1151 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1152 printf ("demux_asf: invalid data_length\n"); 1152 printf ("demux_asf: invalid data_length\n");
1153 this->frame = this->nb_frames - 1; 1153 this->frame = this->nb_frames - 1;
1154 return; 1154 return;
@@ -1196,7 +1196,7 @@ static void asf_read_packet(demux_asf_t *this) {
1196 this->input->seek (this->input, rlen - 8, SEEK_CUR); 1196 this->input->seek (this->input, rlen - 8, SEEK_CUR);
1197 s_hdr_size += rlen - 8; 1197 s_hdr_size += rlen - 8;
1198 } else { 1198 } else {
1199 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1199 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1200 printf ("demux_asf: strange rlen %d\n", rlen); 1200 printf ("demux_asf: strange rlen %d\n", rlen);
1201 timestamp = 0; 1201 timestamp = 0;
1202 payload_size = 0; 1202 payload_size = 0;
@@ -1232,7 +1232,7 @@ static void asf_read_packet(demux_asf_t *this) {
1232 1232
1233 if (frag_len > this->packet_size_left) { 1233 if (frag_len > this->packet_size_left) {
1234 /* skip packet */ 1234 /* skip packet */
1235 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1235 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1236 printf ("demux_asf: invalid frag_len %d\n", frag_len); 1236 printf ("demux_asf: invalid frag_len %d\n", frag_len);
1237 this->frame = this->nb_frames - 1; 1237 this->frame = this->nb_frames - 1;
1238 return; 1238 return;
@@ -1313,7 +1313,7 @@ static int demux_asf_parse_http_references( demux_asf_t *this) {
1313 if (!strncmp(href, "http", 4)) { 1313 if (!strncmp(href, "http", 4)) {
1314 memcpy(href, "mmsh", 4); 1314 memcpy(href, "mmsh", 4);
1315 } 1315 }
1316 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) 1316 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)
1317 printf("demux_asf: http ref: %s\n", href); 1317 printf("demux_asf: http ref: %s\n", href);
1318 uevent.type = XINE_EVENT_MRL_REFERENCE; 1318 uevent.type = XINE_EVENT_MRL_REFERENCE;
1319 uevent.stream = this->stream; 1319 uevent.stream = this->stream;
@@ -1376,7 +1376,7 @@ static int demux_asf_parse_asf_references( demux_asf_t *this) {
1376 } 1376 }
1377 } 1377 }
1378 1378
1379 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1379 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1380 printf("demux_asf: asf ref: %s\n", ptr); 1380 printf("demux_asf: asf ref: %s\n", ptr);
1381 uevent.type = XINE_EVENT_MRL_REFERENCE; 1381 uevent.type = XINE_EVENT_MRL_REFERENCE;
1382 uevent.stream = this->stream; 1382 uevent.stream = this->stream;
@@ -1601,7 +1601,7 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) {
1601 1601
1602 if (!asf_read_header (this)) { 1602 if (!asf_read_header (this)) {
1603 1603
1604 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1604 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1605 printf ("demux_asf: asf_read_header failed.\n"); 1605 printf ("demux_asf: asf_read_header failed.\n");
1606 1606
1607 this->status = DEMUX_FINISHED; 1607 this->status = DEMUX_FINISHED;
@@ -1634,7 +1634,7 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) {
1634 stream_id = this->streams[i].stream_id; 1634 stream_id = this->streams[i].stream_id;
1635 bitrate = this->bitrates[stream_id]; 1635 bitrate = this->bitrates[stream_id];
1636 1636
1637 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG) 1637 if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)
1638 printf("demux_asf: stream: %d, bitrate %d bps\n", stream_id, bitrate); 1638 printf("demux_asf: stream: %d, bitrate %d bps\n", stream_id, bitrate);
1639 if ((buf_type == BUF_VIDEO_BASE) && 1639 if ((buf_type == BUF_VIDEO_BASE) &&
1640 (bitrate > max_vrate || this->video_stream_id == 0)) { 1640 (bitrate > max_vrate || this->video_stream_id == 0)) {
@@ -1659,7 +1659,7 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) {
1659 1659
1660 this->stream->stream_info[XINE_STREAM_INFO_BITRATE] = bitrate; 1660 this->stream->stream_info[XINE_STREAM_INFO_BITRATE] = bitrate;
1661 1661
1662 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) 1662 if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
1663 printf("demux_asf: video stream_id: %d, audio stream_id: %d\n", 1663 printf("demux_asf: video stream_id: %d, audio stream_id: %d\n",
1664 this->video_stream_id, this->audio_stream_id); 1664 this->video_stream_id, this->audio_stream_id);
1665 1665
@@ -1821,7 +1821,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
1821 break; 1821 break;
1822 1822
1823 default: 1823 default:
1824 printf ("demux_asf: warning, unkown method %d\n", 1824 printf ("demux_asf: warning, unkown method %d\n",
1825 stream->content_detection_method); 1825 stream->content_detection_method);
1826 return NULL; 1826 return NULL;
1827 } 1827 }