Skip to content

Commit

Permalink
chore(cmdline): improve code
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Feb 25, 2020
1 parent 7ab0ca3 commit f1eecdc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmdline/cicadaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ static void onVideoSize(int64_t width, int64_t height, void *userData)
AF_TRACE;
using IEvent = IEventReceiver::IEvent;
auto *cont = static_cast<cicadaCont *>(userData);
auto *event = new IEvent(IEvent::TYPE_SET_VIEW);

if (cont->receiver) {
cont->receiver->push(std::unique_ptr<IEvent>(event));
cont->receiver->push(std::unique_ptr<IEvent>(new IEvent(IEvent::TYPE_SET_VIEW)));
}
}

static void onEOS(void *userData)
{
auto *cont = static_cast<cicadaCont *>(userData);
auto *event = new IEvent(IEvent::TYPE_EXIT);

if (cont->receiver) {
cont->receiver->push(std::unique_ptr<IEvent>(event));
cont->receiver->push(std::unique_ptr<IEvent>(new IEvent(IEvent::TYPE_EXIT)));
}
}

Expand Down

0 comments on commit f1eecdc

Please sign in to comment.