Do not leak the first StreamCookie that we used in Sniff() and do not free

in FreeCookie().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31425 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-07-06 15:05:52 +00:00
parent f0eb77fee4
commit 922c7be61c
2 changed files with 12 additions and 6 deletions

View File

@ -805,8 +805,11 @@ AVFormatReader::AVFormatReader()
AVFormatReader::~AVFormatReader() AVFormatReader::~AVFormatReader()
{ {
TRACE("AVFormatReader::~AVFormatReader\n"); TRACE("AVFormatReader::~AVFormatReader\n");
if (fStreams != NULL) {
delete fStreams[0];
delete[] fStreams; delete[] fStreams;
} }
}
// #pragma mark - // #pragma mark -
@ -815,6 +818,9 @@ AVFormatReader::~AVFormatReader()
const char* const char*
AVFormatReader::Copyright() AVFormatReader::Copyright()
{ {
// TODO: Could not find the equivalent in libavformat >= version 53.
// if (fStreams != NULL && fStreams[0] != NULL)
// return fStreams[0]->Context()->copyright;
// TODO: Return copyright of the file instead! // TODO: Return copyright of the file instead!
return "Copyright 2009, Stephan Aßmus"; return "Copyright 2009, Stephan Aßmus";
} }

View File

@ -39,6 +39,11 @@ const struct codec_table gCodecTable[] = {
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 0x6D730055, "MP Layer3"}, {CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 0x6D730055, "MP Layer3"},
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_MPEG_FORMAT_FAMILY, 0x6D730050, "MP Layer2"}, {CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_MPEG_FORMAT_FAMILY, 0x6D730050, "MP Layer2"},
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_MPEG_FORMAT_FAMILY, 0x6D730055, "MP Layer3"}, {CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_MPEG_FORMAT_FAMILY, 0x6D730055, "MP Layer3"},
#if 0
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x0050, "MPEG Audio Layer 2"}, /* mpeg audio layer 2 */
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x0055, "MPEG Audio Layer 3"}, /* mpeg audio layer 3 */
#endif
{CODEC_ID_ADPCM_IMA_QT, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'ima4', "Quicktime IMA4"}, {CODEC_ID_ADPCM_IMA_QT, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'ima4', "Quicktime IMA4"},
{CODEC_ID_ADPCM_IMA_QT, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'IMA4', "Quicktime IMA4"}, {CODEC_ID_ADPCM_IMA_QT, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'IMA4', "Quicktime IMA4"},
{CODEC_ID_AAC, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'mp4a', "MPEG4 AAC"}, {CODEC_ID_AAC, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'mp4a', "MPEG4 AAC"},
@ -53,11 +58,6 @@ const struct codec_table gCodecTable[] = {
{CODEC_ID_MACE6, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'MAC6', "MACE 6:1"}, {CODEC_ID_MACE6, B_MEDIA_ENCODED_AUDIO, B_QUICKTIME_FORMAT_FAMILY, 'MAC6', "MACE 6:1"},
#endif #endif
#if 0
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x0050, "MPEG Audio Layer 2"}, /* mpeg audio layer 2 */
{CODEC_ID_MP2, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x0055, "MPEG Audio Layer 3"}, /* mpeg audio layer 3 */
#endif
{CODEC_ID_WMAV1, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x160, "MS WMA v1"}, {CODEC_ID_WMAV1, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x160, "MS WMA v1"},
{CODEC_ID_WMAV2, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x161, "MS WMA v2"}, {CODEC_ID_WMAV2, B_MEDIA_ENCODED_AUDIO, B_WAV_FORMAT_FAMILY, 0x161, "MS WMA v2"},