mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #179, update the metadata of flv dvr file.
This commit is contained in:
parent
7077b74d03
commit
1445086451
8 changed files with 270 additions and 25 deletions
|
@ -448,11 +448,6 @@ SrsAmf0Any* SrsUnSortedHashtable::value_at(int index)
|
|||
|
||||
void SrsUnSortedHashtable::set(string key, SrsAmf0Any* value)
|
||||
{
|
||||
if (!value) {
|
||||
srs_warn("add a NULL propertity %s", key.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<SrsAmf0ObjectPropertyType>::iterator it;
|
||||
|
||||
for (it = properties.begin(); it != properties.end(); ++it) {
|
||||
|
@ -467,7 +462,9 @@ void SrsUnSortedHashtable::set(string key, SrsAmf0Any* value)
|
|||
}
|
||||
}
|
||||
|
||||
properties.push_back(std::make_pair(key, value));
|
||||
if (value) {
|
||||
properties.push_back(std::make_pair(key, value));
|
||||
}
|
||||
}
|
||||
|
||||
SrsAmf0Any* SrsUnSortedHashtable::get_property(string name)
|
||||
|
|
|
@ -794,6 +794,10 @@ namespace _srs_internal
|
|||
virtual std::string key_at(int index);
|
||||
virtual const char* key_raw_at(int index);
|
||||
virtual SrsAmf0Any* value_at(int index);
|
||||
/**
|
||||
* set the value of hashtable.
|
||||
* @param value, the value to set. NULL to delete the property.
|
||||
*/
|
||||
virtual void set(std::string key, SrsAmf0Any* value);
|
||||
public:
|
||||
virtual SrsAmf0Any* get_property(std::string name);
|
||||
|
|
|
@ -434,7 +434,6 @@ int SrsSharedPtrMessage::create(SrsMessageHeader* pheader, char* payload, int si
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_assert(pheader != NULL);
|
||||
if (ptr) {
|
||||
ret = ERROR_SYSTEM_ASSERT_FAILED;
|
||||
srs_error("should not set the payload twice. ret=%d", ret);
|
||||
|
@ -446,11 +445,13 @@ int SrsSharedPtrMessage::create(SrsMessageHeader* pheader, char* payload, int si
|
|||
ptr = new __SrsSharedPtr();
|
||||
|
||||
// direct attach the data.
|
||||
ptr->header.message_type = pheader->message_type;
|
||||
ptr->header.payload_length = size;
|
||||
ptr->header.perfer_cid = pheader->perfer_cid;
|
||||
this->timestamp = pheader->timestamp;
|
||||
this->stream_id = pheader->stream_id;
|
||||
if (pheader) {
|
||||
ptr->header.message_type = pheader->message_type;
|
||||
ptr->header.payload_length = size;
|
||||
ptr->header.perfer_cid = pheader->perfer_cid;
|
||||
this->timestamp = pheader->timestamp;
|
||||
this->stream_id = pheader->stream_id;
|
||||
}
|
||||
ptr->payload = payload;
|
||||
ptr->size = size;
|
||||
|
||||
|
|
|
@ -283,6 +283,7 @@ public:
|
|||
* create shared ptr message,
|
||||
* from the header and payload.
|
||||
* @remark user should never free the payload.
|
||||
* @param pheader, the header to copy to the message. NULL to ignore.
|
||||
*/
|
||||
virtual int create(SrsMessageHeader* pheader, char* payload, int size);
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue