Merge pull request #2498 from TaGUNil/tsmf_fix_memory_leak
Fix memory leak in TSMF video playback
This commit is contained in:
commit
29e2b1f763
@ -375,13 +375,6 @@ static void tsmf_sample_playback_video(TSMF_SAMPLE* sample)
|
|||||||
event.frameWidth = sample->stream->width;
|
event.frameWidth = sample->stream->width;
|
||||||
event.frameHeight = sample->stream->height;
|
event.frameHeight = sample->stream->height;
|
||||||
|
|
||||||
/* The frame data ownership is passed to the event object, and is freed after the event is processed. */
|
|
||||||
sample->data = NULL;
|
|
||||||
sample->decoded_size = 0;
|
|
||||||
|
|
||||||
if (tsmf->FrameEvent)
|
|
||||||
tsmf->FrameEvent(tsmf, &event);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Dump a .ppm image for every 30 frames. Assuming the frame is in YUV format, we
|
/* Dump a .ppm image for every 30 frames. Assuming the frame is in YUV format, we
|
||||||
extract the Y values to create a grayscale image. */
|
extract the Y values to create a grayscale image. */
|
||||||
@ -404,6 +397,15 @@ static void tsmf_sample_playback_video(TSMF_SAMPLE* sample)
|
|||||||
|
|
||||||
frame_id++;
|
frame_id++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The frame data ownership is passed to the event object, and is freed after the event is processed. */
|
||||||
|
sample->data = NULL;
|
||||||
|
sample->decoded_size = 0;
|
||||||
|
|
||||||
|
if (tsmf->FrameEvent)
|
||||||
|
tsmf->FrameEvent(tsmf, &event);
|
||||||
|
|
||||||
|
free(event.frameData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user