int len=strchr(data,'\n')-data;
memcpy(buf, data, len+1);
buf[len]=0;
- printf("libreal: sdpplin: not handled: '%s'\n", buf);
+ printf("libreal: sdpplin: not handled: '%s'\n", buf);
#endif
data=nl(data);
}
void sdpplin_free(sdpplin_t *description)
{
- /* TODO: free strings */
- free(description);
+ int i;
+
+ if( !description ) return;
+
+ for( i=0; i<description->stream_count; i++ )
+ {
+ if( description->stream[i] )
+ {
+ if( description->stream[i]->id ) free( description->stream[i]->id );
+ if( description->stream[i]->bandwidth ) free( description->stream[i]->bandwidth );
+ if( description->stream[i]->range ) free( description->stream[i]->range );
+ if( description->stream[i]->length ) free( description->stream[i]->length );
+ if( description->stream[i]->rtpmap ) free( description->stream[i]->rtpmap );
+ if( description->stream[i]->mimetype ) free( description->stream[i]->mimetype );
+ if( description->stream[i]->stream_name ) free( description->stream[i]->stream_name );
+ if( description->stream[i]->mime_type ) free( description->stream[i]->mime_type );
+ if( description->stream[i]->mlti_data ) free( description->stream[i]->mlti_data );
+ if( description->stream[i]->rmff_flags ) free( description->stream[i]->rmff_flags );
+ if( description->stream[i]->asm_rule_book ) free( description->stream[i]->asm_rule_book );
+ }
+ }
+ free( description->stream );
+
+ if( description->owner ) free( description->owner );
+ if( description->session_name ) free( description->session_name );
+ if( description->session_info ) free( description->session_info );
+ if( description->uri ) free( description->uri );
+ if( description->email ) free( description->email );
+ if( description->phone ) free( description->phone );
+ if( description->connection ) free( description->connection );
+ if( description->bandwidth ) free( description->bandwidth );
+ if( description->title ) free( description->title );
+ if( description->author ) free( description->author );
+ if( description->copyright ) free( description->copyright );
+ if( description->keywords ) free( description->keywords );
+ if( description->asm_rule_book ) free( description->asm_rule_book );
+ if( description->abstract ) free( description->abstract );
+ if( description->range ) free( description->range );
+ free(description);
}