Do not use fWriter functions, when it has not been instantiated properly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32122 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-08-05 10:07:43 +00:00
parent 3471097486
commit 99304ab063

View File

@ -61,13 +61,15 @@ MediaWriter::~MediaWriter()
{
CALLED();
// free all stream cookies
// and chunk caches
StreamInfo* info;
for (fStreamInfos.Rewind(); fStreamInfos.GetNext(&info);)
fWriter->FreeCookie(info->cookie);
if (fWriter != NULL) {
// free all stream cookies
// and chunk caches
StreamInfo* info;
for (fStreamInfos.Rewind(); fStreamInfos.GetNext(&info);)
fWriter->FreeCookie(info->cookie);
_plugin_manager.DestroyWriter(fWriter);
_plugin_manager.DestroyWriter(fWriter);
}
// fTarget is owned by the BMediaFile
}
@ -99,6 +101,9 @@ MediaWriter::CreateEncoder(Encoder** _encoder,
{
CALLED();
if (fWriter == NULL)
return B_NO_INIT;
// TODO: Here we should work out a way so that if there is a setup
// failure we can try the next encoder.
Encoder* encoder;