]> git.sesse.net Git - vlc/blob - modules/access/udp.c
Do not use BlockChoose when the access is explicitly RTP.
[vlc] / modules / access / udp.c
1 /*****************************************************************************
2  * udp.c: raw UDP & RTP input module
3  *****************************************************************************
4  * Copyright (C) 2001-2005 the VideoLAN team
5  * Copyright (C) 2007 Remi Denis-Courmont
6  * $Id$
7  *
8  * Authors: Christophe Massiot <massiot@via.ecp.fr>
9  *          Tristan Leteurtre <tooney@via.ecp.fr>
10  *          Laurent Aimar <fenrir@via.ecp.fr>
11  *          Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
12  *          Remi Denis-Courmont
13  *
14  * Reviewed: 23 October 2003, Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
29  *****************************************************************************/
30
31 /*****************************************************************************
32  * Preamble
33  *****************************************************************************/
34
35 #include <vlc/vlc.h>
36 #include <vlc_access.h>
37 #include <vlc_network.h>
38
39 #ifndef SOCK_DCCP /* provisional API */
40 # ifdef __linux__
41 #  define SOCK_DCCP 6
42 # endif
43 #endif
44
45 #ifndef IPPROTO_DCCP
46 # define IPPROTO_DCCP 33 /* IANA */
47 #endif
48
49 #ifndef IPPROTO_UDPLITE
50 # define IPPROTO_UDPLITE 136 /* from IANA */
51 #endif
52
53 #define MTU 65535
54
55 /*****************************************************************************
56  * Module descriptor
57  *****************************************************************************/
58 #define CACHING_TEXT N_("Caching value in ms")
59 #define CACHING_LONGTEXT N_( \
60     "Caching value for UDP streams. This " \
61     "value should be set in milliseconds." )
62
63 #define RTP_LATE_TEXT N_("RTP reordering timeout in ms")
64 #define RTP_LATE_LONGTEXT N_( \
65     "VLC reorders RTP packets. The input will wait for late packets at most "\
66     "the time specified here (in milliseconds)." )
67
68 static int  Open ( vlc_object_t * );
69 static void Close( vlc_object_t * );
70
71 vlc_module_begin();
72     set_shortname( _("UDP/RTP" ) );
73     set_description( _("UDP/RTP input") );
74     set_category( CAT_INPUT );
75     set_subcategory( SUBCAT_INPUT_ACCESS );
76
77     add_integer( "udp-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
78                  CACHING_LONGTEXT, VLC_TRUE );
79     add_integer( "rtp-late", 100, NULL, RTP_LATE_TEXT, RTP_LATE_LONGTEXT, VLC_TRUE );
80     add_obsolete_bool( "udp-auto-mtu" );
81
82     set_capability( "access2", 0 );
83     add_shortcut( "udp" );
84     add_shortcut( "udpstream" );
85     add_shortcut( "udp4" );
86     add_shortcut( "udp6" );
87     add_shortcut( "rtp" );
88     add_shortcut( "rtp4" );
89     add_shortcut( "rtp6" );
90     add_shortcut( "udplite" );
91     add_shortcut( "rtptcp" ); /* tcp name is already taken */
92     add_shortcut( "dccp" );
93
94     set_callbacks( Open, Close );
95 vlc_module_end();
96
97 /*****************************************************************************
98  * Local prototypes
99  *****************************************************************************/
100 #define RTP_HEADER_LEN 12
101
102 static block_t *BlockUDP( access_t * );
103 static block_t *BlockTCP( access_t * );
104 static block_t *BlockRTP( access_t * );
105 static block_t *BlockChoose( access_t * );
106 static int Control( access_t *, int, va_list );
107
108 struct access_sys_t
109 {
110     int fd;
111
112     vlc_bool_t b_framed_rtp;
113
114     /* reorder rtp packets when out-of-sequence */
115     uint16_t i_last_seqno;
116     mtime_t i_rtp_late;
117     block_t *p_list;
118     block_t *p_end;
119     block_t *p_partial_frame; /* Partial Framed RTP packet */
120 };
121
122 /*****************************************************************************
123  * Open: open the socket
124  *****************************************************************************/
125 static int Open( vlc_object_t *p_this )
126 {
127     access_t     *p_access = (access_t*)p_this;
128     access_sys_t *p_sys;
129
130     char *psz_name = strdup( p_access->psz_path );
131     char *psz_parser;
132     const char *psz_server_addr, *psz_bind_addr = "";
133     int  i_bind_port, i_server_port = 0;
134     int fam = AF_UNSPEC, proto = IPPROTO_UDP;
135
136     /* Set up p_access */
137     access_InitFields( p_access );
138     ACCESS_SET_CALLBACKS( NULL, BlockRTP, Control, NULL );
139     p_access->info.b_prebuffered = VLC_FALSE;
140     MALLOC_ERR( p_access->p_sys, access_sys_t ); p_sys = p_access->p_sys;
141     memset (p_sys, 0, sizeof (*p_sys));
142
143     if (strlen (p_access->psz_access) > 0)
144     {
145         switch (p_access->psz_access[strlen (p_access->psz_access) - 1])
146         {
147             case '4':
148                 fam = AF_INET;
149                 break;
150
151             case '6':
152                 fam = AF_INET6;
153                 break;
154         }
155
156         if (strcmp (p_access->psz_access, "udplite") == 0)
157             proto = IPPROTO_UDPLITE;
158         else
159         if (strncmp (p_access->psz_access, "udp", 3 ) == 0 )
160             p_access->pf_block = BlockChoose;
161         else
162         if (strcmp (p_access->psz_access, "rtptcp") == 0)
163             proto = IPPROTO_TCP;
164         else
165         if (strcmp (p_access->psz_access, "dccp") == 0)
166             proto = IPPROTO_DCCP;
167     }
168
169     i_bind_port = var_CreateGetInteger( p_access, "server-port" );
170
171     /* Parse psz_name syntax :
172      * [serveraddr[:serverport]][@[bindaddr]:[bindport]] */
173     psz_parser = strchr( psz_name, '@' );
174     if( psz_parser != NULL )
175     {
176         /* Found bind address and/or bind port */
177         *psz_parser++ = '\0';
178         psz_bind_addr = psz_parser;
179
180         if( psz_bind_addr[0] == '[' )
181             /* skips bracket'd IPv6 address */
182             psz_parser = strchr( psz_parser, ']' );
183
184         if( psz_parser != NULL )
185         {
186             psz_parser = strchr( psz_parser, ':' );
187             if( psz_parser != NULL )
188             {
189                 *psz_parser++ = '\0';
190                 i_bind_port = atoi( psz_parser );
191             }
192         }
193     }
194
195     psz_server_addr = psz_name;
196     psz_parser = ( psz_server_addr[0] == '[' )
197         ? strchr( psz_name, ']' ) /* skips bracket'd IPv6 address */
198         : psz_name;
199
200     if( psz_parser != NULL )
201     {
202         psz_parser = strchr( psz_parser, ':' );
203         if( psz_parser != NULL )
204         {
205             *psz_parser++ = '\0';
206             i_server_port = atoi( psz_parser );
207         }
208     }
209
210     msg_Dbg( p_access, "opening server=%s:%d local=%s:%d",
211              psz_server_addr, i_server_port, psz_bind_addr, i_bind_port );
212
213     /* Hmm, the net_* connection functions may need to be unified... */
214     switch (proto)
215     {
216         case IPPROTO_UDP:
217         case IPPROTO_UDPLITE:
218             p_sys->fd = net_OpenDgram( p_access, psz_bind_addr, i_bind_port,
219                                        psz_server_addr, i_server_port, fam,
220                                        proto );
221             break;
222
223         case IPPROTO_TCP:
224             p_sys->fd = net_ConnectTCP( p_access, psz_server_addr, i_server_port );
225             p_sys->b_framed_rtp = VLC_TRUE;
226             break;
227
228         case IPPROTO_DCCP:
229 #ifdef SOCK_DCCP
230             p_sys->fd = net_Connect( p_access, psz_server_addr, i_server_port,
231                                      SOCK_DCCP, IPPROTO_DCCP );
232 #else
233             p_sys->fd = -1;
234             msg_Err( p_access, "DCCP support not compiled-in!" );
235 #endif
236             break;
237     }
238     free (psz_name);
239     if( p_sys->fd == -1 )
240     {
241         msg_Err( p_access, "cannot open socket" );
242         free( p_sys );
243         return VLC_EGENERIC;
244     }
245
246     shutdown( p_sys->fd, SHUT_WR );
247     net_SetCSCov (p_sys->fd, -1, 12);
248
249     /* Update default_pts to a suitable value for udp access */
250     var_Create( p_access, "udp-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
251
252     /* RTP reordering for out-of-sequence packets */
253     p_sys->i_rtp_late = var_CreateGetInteger( p_access, "rtp-late" ) * 1000;
254     p_sys->i_last_seqno = 0;
255     p_sys->p_list = NULL;
256     p_sys->p_end = NULL;
257     return VLC_SUCCESS;
258 }
259
260 /*****************************************************************************
261  * Close: free unused data structures
262  *****************************************************************************/
263 static void Close( vlc_object_t *p_this )
264 {
265     access_t     *p_access = (access_t*)p_this;
266     access_sys_t *p_sys = p_access->p_sys;
267
268     block_ChainRelease( p_sys->p_list );
269     net_Close( p_sys->fd );
270     free( p_sys );
271 }
272
273 /*****************************************************************************
274  * Control:
275  *****************************************************************************/
276 static int Control( access_t *p_access, int i_query, va_list args )
277 {
278     vlc_bool_t   *pb_bool;
279     int          *pi_int;
280     int64_t      *pi_64;
281
282     switch( i_query )
283     {
284         /* */
285         case ACCESS_CAN_SEEK:
286         case ACCESS_CAN_FASTSEEK:
287         case ACCESS_CAN_PAUSE:
288         case ACCESS_CAN_CONTROL_PACE:
289             pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
290             *pb_bool = VLC_FALSE;
291             break;
292         /* */
293         case ACCESS_GET_MTU:
294             pi_int = (int*)va_arg( args, int * );
295             *pi_int = MTU;
296             break;
297
298         case ACCESS_GET_PTS_DELAY:
299             pi_64 = (int64_t*)va_arg( args, int64_t * );
300             *pi_64 = var_GetInteger( p_access, "udp-caching" ) * 1000;
301             break;
302
303         /* */
304         case ACCESS_SET_PAUSE_STATE:
305         case ACCESS_GET_TITLE_INFO:
306         case ACCESS_SET_TITLE:
307         case ACCESS_SET_SEEKPOINT:
308         case ACCESS_SET_PRIVATE_ID_STATE:
309             return VLC_EGENERIC;
310
311         default:
312             msg_Warn( p_access, "unimplemented query in control" );
313             return VLC_EGENERIC;
314
315     }
316     return VLC_SUCCESS;
317 }
318
319 /*****************************************************************************
320  * BlockUDP:
321  *****************************************************************************/
322 static block_t *BlockUDP( access_t *p_access )
323 {
324     access_sys_t *p_sys = p_access->p_sys;
325     block_t      *p_block;
326
327     /* Read data */
328     p_block = block_New( p_access, MTU );
329     p_block->i_buffer = net_Read( p_access, p_sys->fd, NULL,
330                                   p_block->p_buffer, MTU, VLC_FALSE );
331     if( p_block->i_buffer < 0 )
332     {
333         block_Release( p_block );
334         return NULL;
335     }
336
337     return block_Realloc( p_block, 0, p_block->i_buffer );
338 }
339
340 /*****************************************************************************
341  * BlockTCP: Framed RTP/AVP packet reception for COMEDIA (see RFC4571)
342  *****************************************************************************/
343 static block_t *BlockTCP( access_t *p_access )
344 {
345     access_sys_t *p_sys = p_access->p_sys;
346     block_t      *p_block = p_sys->p_partial_frame;
347
348     if( p_access->info.b_eof )
349         return NULL;
350
351     if( p_block == NULL )
352     {
353         /* MTU should always be 65535 in this case */
354         p_sys->p_partial_frame = p_block = block_New( p_access, 2 + MTU );
355         if (p_block == NULL)
356             return NULL;
357     }
358
359     /* Read RTP framing */
360     if (p_block->i_buffer < 2)
361     {
362         /* FIXME: not very efficient */
363         int i_read = net_Read( p_access, p_sys->fd, NULL,
364                                p_block->p_buffer + p_block->i_buffer,
365                                2 - p_block->i_buffer, VLC_FALSE );
366         if( i_read <= 0 )
367             goto error;
368
369         p_block->i_buffer += i_read;
370         if (p_block->i_buffer < 2)
371             return NULL;
372     }
373
374     uint16_t framelen = GetWLE( p_block->p_buffer );
375     /* Read RTP frame */
376     if( framelen > 0 )
377     {
378         int i_read = net_Read( p_access, p_sys->fd, NULL,
379                                p_block->p_buffer + p_block->i_buffer,
380                                2 + framelen - p_block->i_buffer, VLC_FALSE );
381         if( i_read <= 0 )
382             goto error;
383
384         p_block->i_buffer += i_read;
385     }
386
387     if( p_block->i_buffer < (2 + framelen) )
388         return NULL; // incomplete frame
389
390     /* Hide framing from RTP layer */
391     p_block->p_buffer += 2;
392     p_block->i_buffer -= 2;
393     p_sys->p_partial_frame = NULL;
394     return p_block;
395
396 error:
397     p_access->info.b_eof = VLC_TRUE;
398     block_Release( p_block );
399     p_sys->p_partial_frame = NULL;
400     return NULL;
401 }
402
403
404 /*
405  * rtp_ChainInsert - insert a p_block in the chain and
406  * look at the sequence numbers.
407  */
408 static inline vlc_bool_t rtp_ChainInsert( access_t *p_access, block_t *p_block )
409 {
410     access_sys_t *p_sys = (access_sys_t *) p_access->p_sys;
411     block_t *p_prev = NULL;
412     block_t *p = p_sys->p_end;
413     uint16_t i_new = (uint16_t) p_block->i_dts;
414     uint16_t i_tmp = 0;
415
416     if( !p_sys->p_list )
417     {
418         p_sys->p_list = p_block;
419         p_sys->p_end = p_block;
420         return VLC_TRUE;
421     }
422     /* walk through the queue from top down since the new packet is in
423     most cases just appended to the end */
424
425     for( ;; )
426     {
427         i_tmp = i_new - (uint16_t) p->i_dts;
428
429         if( !i_tmp )   /* trash duplicate */
430             break;
431
432         if ( i_tmp < 32768 )
433         {   /* insert after this block ( i_new > p->i_dts ) */
434             p_block->p_next = p->p_next;
435             p->p_next = p_block;
436             p_block->p_prev = p;
437             if (p_prev)
438             {
439                 p_prev->p_prev = p_block;
440                 msg_Dbg(p_access, "RTP reordering: insert after %d, new %d",
441                         (uint16_t) p->i_dts, i_new );
442             }
443             else
444             {
445                 p_sys->p_end = p_block;
446             }
447             return VLC_TRUE;
448         }
449         if( p == p_sys->p_list )
450         {   /* we've reached bottom of chain */
451             i_tmp = p_sys->i_last_seqno - i_new;
452             if( !p_access->info.b_prebuffered || (i_tmp > 32767) )
453             {
454                 msg_Dbg(p_access, "RTP reordering: prepend %d before %d",
455                         i_new, (uint16_t) p->i_dts );
456                 p_block->p_next = p;
457                 p->p_prev = p_block;
458                 p_sys->p_list = p_block;
459                 return VLC_TRUE;
460             }
461
462             if( !i_tmp )   /* trash duplicate */
463                 break;
464
465             /* reordering failed - append the packet to the end of queue */
466             msg_Dbg(p_access, "RTP: sequence changed (or buffer too small) "
467                     "new: %d, buffer %d...%d", i_new, (uint16_t) p->i_dts,
468                 (uint16_t) p_sys->p_end->i_dts);
469             p_sys->p_end->p_next = p_block;
470             p_block->p_prev = p_sys->p_end;
471             p_sys->p_end = p_block;
472             return VLC_TRUE;
473         }
474         p_prev = p;
475         p = p->p_prev;
476     }
477     block_Release( p_block );
478     return VLC_FALSE;
479 }
480
481 /*****************************************************************************
482  * BlockParseRTP/BlockRTP:
483  *****************************************************************************/
484 static block_t *BlockParseRTP( access_t *p_access, block_t *p_block )
485 {
486     int      i_payload_type;
487     size_t   i_skip = RTP_HEADER_LEN;
488
489     if( p_block == NULL )
490         return NULL;
491
492     if( p_block->i_buffer < RTP_HEADER_LEN )
493     {
494         msg_Dbg( p_access, "short RTP packet received" );
495         goto trash;
496     }
497
498     /* Parse the header and make some verifications.
499      * See RFC 3550. */
500     // Version number:
501     if( ( p_block->p_buffer[0] >> 6 ) != 2)
502     {
503         msg_Dbg( p_access, "RTP version is %u instead of 2",
504                  p_block->p_buffer[0] >> 6 );
505         goto trash;
506     }
507     // Padding bit:
508     uint8_t pad = (p_block->p_buffer[0] & 0x20)
509                     ? p_block->p_buffer[p_block->i_buffer - 1] : 0;
510     // CSRC count:
511     i_skip += (p_block->p_buffer[0] & 0x0F) * 4;
512     // Extension header:
513     if (p_block->p_buffer[0] & 0x10) /* Extension header */
514     {
515         i_skip += 4;
516         if ((size_t)p_block->i_buffer < i_skip)
517             goto trash;
518
519         i_skip += 4 * GetWBE( p_block->p_buffer + i_skip - 2 );
520     }
521
522     i_payload_type    = p_block->p_buffer[1] & 0x7F;
523
524     /* Remember sequence number in i_dts */
525     p_block->i_pts = mdate();
526     p_block->i_dts = (mtime_t) GetWBE( p_block->p_buffer + 2 );
527
528     /* FIXME: use rtpmap */
529     switch( i_payload_type )
530     {
531         case 14: // MPA: MPEG Audio (RFC2250, §3.4)
532             i_skip += 4; // 32 bits RTP/MPA header
533             break;
534
535         case 32: // MPV: MPEG Video (RFC2250, §3.5)
536             i_skip += 4; // 32 bits RTP/MPV header
537             if( (size_t)p_block->i_buffer < i_skip )
538                 goto trash;
539             if( p_block->p_buffer[i_skip - 3] & 0x4 )
540             {
541                 /* MPEG2 Video extension header */
542                 /* TODO: shouldn't we skip this too ? */
543             }
544             break;
545
546         case 33: // MP2: MPEG TS (RFC2250, §2)
547             /* plain TS over RTP */
548             break;
549
550         default:
551             msg_Dbg( p_access, "unsupported RTP payload type: %u", i_payload_type );
552             goto trash;
553     }
554
555     if( (size_t)p_block->i_buffer < (i_skip + pad) )
556         goto trash;
557
558     /* Remove the RTP header */
559     p_block->i_buffer -= i_skip;
560     p_block->p_buffer += i_skip;
561
562     /* This is the place for deciphering and authentication */
563
564     /* Remove padding (at the end) */
565     p_block->i_buffer -= pad;
566
567 #if 0
568     /* Emulate packet loss */
569     if ( (i_sequence_number % 4000) == 0)
570     {
571         msg_Warn( p_access, "Emulating packet drop" );
572         block_Release( p_block );
573         return NULL;
574     }
575 #endif
576
577     return p_block;
578
579 trash:
580     block_Release( p_block );
581     return NULL;
582 }
583
584 static block_t *BlockPrebufferRTP( access_t *p_access, block_t *p_block )
585 {
586     access_sys_t *p_sys = p_access->p_sys;
587     mtime_t   i_first = mdate();
588     int       i_count = 0;
589     block_t   *p = p_block;
590
591     for( ;; )
592     {
593         mtime_t i_date = mdate();
594
595         if( p && rtp_ChainInsert( p_access, p ))
596             i_count++;
597
598         /* Require at least 2 packets in the buffer */
599         if( i_count > 2 && (i_date - i_first) > p_sys->i_rtp_late )
600             break;
601
602         p = BlockParseRTP( p_access, BlockUDP( p_access ) );
603         if( !p && (i_date - i_first) > p_sys->i_rtp_late )
604         {
605             msg_Err( p_access, "error in RTP prebuffering!" );
606             break;
607         }
608     }
609
610     msg_Dbg( p_access, "RTP: prebuffered %d packets", i_count - 1 );
611     p_access->info.b_prebuffered = VLC_TRUE;
612     p = p_sys->p_list;
613     p_sys->p_list = p_sys->p_list->p_next;
614     p_sys->i_last_seqno = (uint16_t) p->i_dts;
615     p->p_next = NULL;
616     return p;
617 }
618
619 static block_t *BlockRTP( access_t *p_access )
620 {
621     access_sys_t *p_sys = p_access->p_sys;
622     block_t *p;
623
624     while ( !p_sys->p_list ||
625              ( mdate() - p_sys->p_list->i_pts ) < p_sys->i_rtp_late )
626     {
627         p = BlockParseRTP( p_access,
628                            p_sys->b_framed_rtp ? BlockTCP( p_access )
629                                                : BlockUDP( p_access ) );
630         if ( !p )
631             return NULL;
632
633         rtp_ChainInsert( p_access, p );
634     }
635
636     p = p_sys->p_list;
637     p_sys->p_list = p_sys->p_list->p_next;
638     p_sys->i_last_seqno++;
639     if( p_sys->i_last_seqno != (uint16_t) p->i_dts )
640     {
641         msg_Dbg( p_access, "RTP: packet(s) lost, expected %d, got %d",
642                  p_sys->i_last_seqno, (uint16_t) p->i_dts );
643         p_sys->i_last_seqno = (uint16_t) p->i_dts;
644     }
645     p->p_next = NULL;
646     return p;
647 }
648
649 /*****************************************************************************
650  * BlockChoose: decide between RTP and UDP
651  *****************************************************************************/
652 static block_t *BlockChoose( access_t *p_access )
653 {
654     block_t *p_block;
655     int     i_rtp_version;
656     int     i_payload_type;
657
658     if( ( p_block = BlockUDP( p_access ) ) == NULL )
659         return NULL;
660
661     if( p_block->p_buffer[0] == 0x47 )
662     {
663         msg_Dbg( p_access, "detected TS over raw UDP" );
664         p_access->pf_block = BlockUDP;
665         p_access->info.b_prebuffered = VLC_TRUE;
666         return p_block;
667     }
668
669     if( p_block->i_buffer < RTP_HEADER_LEN )
670         return p_block;
671
672     /* Parse the header and make some verifications.
673      * See RFC 3550. */
674
675     i_rtp_version  = p_block->p_buffer[0] >> 6;
676     i_payload_type = ( p_block->p_buffer[1] & 0x7F );
677
678     if( i_rtp_version != 2 )
679     {
680         msg_Dbg( p_access, "no supported RTP header detected" );
681         p_access->pf_block = BlockUDP;
682         p_access->info.b_prebuffered = VLC_TRUE;
683         return p_block;
684     }
685
686     switch( i_payload_type )
687     {
688         case 33:
689             msg_Dbg( p_access, "detected MPEG2 TS over RTP" );
690             p_access->psz_demux = strdup( "ts" );
691             break;
692
693         case 14:
694             msg_Dbg( p_access, "detected MPEG Audio over RTP" );
695             p_access->psz_demux = strdup( "mpga" );
696             break;
697
698         case 32:
699             msg_Dbg( p_access, "detected MPEG Video over RTP" );
700             p_access->psz_demux = strdup( "mpgv" );
701             break;
702
703         default:
704             msg_Dbg( p_access, "no RTP header detected" );
705             p_access->pf_block = BlockUDP;
706             p_access->info.b_prebuffered = VLC_TRUE;
707             return p_block;
708     }
709
710     if( !BlockParseRTP( p_access, p_block )) return NULL;
711
712     p_access->pf_block = BlockRTP;
713
714     return BlockPrebufferRTP( p_access, p_block );
715 }