precoded_payload_t* p = static_cast<precoded_payload_t*>(AmPlugIn::instance()->payload(h_codec));
have same behaviour: segfault.
precoded_bytes2samples() called on dead AmPrecodedRtpFormat.

Самусенко Андрей wrote:
Fixed. Please, examine following code:
Index: AmPrecodedFile.h
===================================================================
48a49,50
>
>   precoded_payload_t() {codec_id = PRECODED_CODEC_ID;}
105a108,109
>   // need to call after open()
>   void initPlugin();
107c111
<   int open(std::string filename);
---
>   int open(const std::string& filename);

Index: AmPrecodedFile.cpp
===================================================================
32a33,34
> #include <libgen.h>
>
34c36,37
<   return ((AmAudioFormat*)h_codec)->frame_size;
---
> precoded_payload_t* p = static_cast<precoded_payload_t*>(AmPlugIn::instance()->payload(h_codec));
>   return p->frame_ms * p->sample_rate / 1000;
38c41,42
<   return ((AmAudioFormat*)h_codec)->frame_encoded_size;
---
> precoded_payload_t* p = static_cast<precoded_payload_t*>(AmPlugIn::instance()->payload(h_codec));
>   return p->frame_bytes;
56a61,66
> void AmPrecodedFile::initPlugin() {
>   //AmPlugIn::instance()->addCodec(&_codec_precoded);
> for(std::map<int,precoded_payload_t>::iterator it = payloads.begin(); it != payloads.end(); ++it)
>     AmPlugIn::instance()->addPayload(&it->second);
> }
>
68c78
<   h_codec = (long)this;
---
>   h_codec = precoded_payload.payload_id;
94c104
<   h_codec = (long)this;
---
>   h_codec = precoded_payload.payload_id;
152c162
< int AmPrecodedFile::open(std::string filename) {
---
> int AmPrecodedFile::open(const std::string& filename) {
157a168,171
>   char *dir = strdup(filename.c_str());
>   string str_dir(dirname(dir));
>   str_dir += "/";
>
190c204
<     pl.filename=codec_def[7];
---
>     pl.filename=str_dir + codec_def[7];
197c211,212
<
---
>   free(dir);
>   ifs.close();

Index: PrecodedAnnounce.cpp
===================================================================
53c53
<
---
>     precoded_file.initPlugin();
77d76
<
97c96
<   setReceiving(false);
---
>   //setReceiving(false);


Самусенко Андрей wrote:
Bug found, but no know solution.
On REFER h_codec == 0 after session terminated, but RTP(silence by SJphone or other) continue and SEMS segfault.

Самусенко Андрей wrote:
18;G729;8000;1;<none>;10;10;test8k.g729       and
18;G729;8000;1;<none>;20;20;test8k.g729       works.

Please, just comment "hack".
h_codec = (long*)this; is abnormal solution. Need graceful code, but no a full understanding.

Stefan Sayer wrote:

Hi,

o Stefan Sayer [10/22/09 17:45]:
thanks, it is applied as r1557. I tried and GSM work fine now. Does it now also work with G729? (I can't find any proper samples to test with at the moment).
to answer my own question: yes it does. how nice!

Stefan


_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to