Ticket #5574: mythphone-checked-return.patch

File mythphone-checked-return.patch, 861 bytes (added by Erik Hovland <erik@…>, 16 years ago)

checks the return value of avcodec_open()

  • mythplugins/mythphone/mythphone/h263.cpp

    Attempts to fix defects in mythphone
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythplugins/mythphone/mythphone/h263.cpp |    3 ++-
     1 files changed, 2 insertions(+), 1 deletions(-)
    
    diff --git a/mythplugins/mythphone/mythphone/h263.cpp b/mythplugins/mythphone/mythphone/h263.cpp
    index 636b2a4..1c99cf6 100644
    a b void H263Container::H263ForceIFrame() 
    154154    while (lastCompressedSize != 0)
    155155        lastCompressedSize = avcodec_encode_video(h263EncContext, PostEncodeFrame, MaxPostEncodeSize, NULL);
    156156    avcodec_close(h263EncContext);
    157     avcodec_open(h263EncContext, h263Encoder);
     157    if (avcodec_open(h263EncContext, h263Encoder) < 0)
     158        VERBOSE(VB_IMPORTANT, "Could not open H.263 Encoder");
    158159}
    159160
    160161void H263Container::H263StopEncoder()