Changeset 218

Show
Ignore:
Timestamp:
06/26/08 09:27:24 (2 months ago)
Author:
sip
Message:

crash on hangup first try

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • app_transcoder/app_transcoder.c

    r207 r218  
    3737#include <asterisk/causes.h> 
    3838 
    39 #include <ffmpeg/avcodec.h> 
    40 #include <ffmpeg/swscale.h> 
     39#include <libavcodec/avcodec.h> 
     40#include <libswscale/swscale.h> 
    4141 
    4242#ifndef AST_FORMAT_AMR 
     
    346346        vtc->end = 1; 
    347347 
     348        ast_log(LOG_WARNING,"-joining thread\n"); 
     349 
    348350        /* Wait encoder thread to stop */ 
    349351        pthread_join(vtc->encoderThread,0); 
     352 
     353        ast_log(LOG_WARNING,"-joined thread\n"); 
    350354 
    351355        /* Free pictures */ 
     
    892896                /* goto end */ 
    893897                goto end;  
    894  
    895         /* Log */ 
    896         ast_log(LOG_WARNING,"Transcoding [%s,%s,%s]\n",fwdParams,local,revParams); 
    897  
    898         /* Create contexts */ 
    899         fwd = VideoTranscoderCreate(pseudo,fwdParams); 
    900         rev = VideoTranscoderCreate(chan,revParams); 
    901898 
    902899        /* Set caller id */ 
     
    947944                /* goto end */ 
    948945                goto clean_pseudo;  
     946 
     947        /* Log */ 
     948        ast_log(LOG_WARNING,">Transcoding [%s,%s,%s]\n",fwdParams,local,revParams); 
     949 
     950        /* Create contexts */ 
     951        fwd = VideoTranscoderCreate(pseudo,fwdParams); 
     952        rev = VideoTranscoderCreate(chan,revParams); 
     953 
    949954 
    950955        /* Answer channel */ 
     
    10231028        } 
    10241029 
     1030        /* Log */ 
     1031        ast_log(LOG_WARNING,"-end loop"); 
     1032 
     1033        /* Destroy transcoders */ 
     1034        if (fwd) 
     1035                VideoTranscoderDestroy(fwd); 
     1036        if (rev) 
     1037                VideoTranscoderDestroy(rev); 
     1038 
     1039        ast_log(LOG_WARNING,"-Hanging up \n"); 
    10251040 
    10261041hangup_pseudo: 
     
    10311046        /* Destroy pseudo channel */ 
    10321047        ast_hangup(pseudo); 
     1048 
     1049        /* Log */ 
     1050        ast_log(LOG_WARNING,"<Transcoding\n"); 
    10331051 
    10341052end: 
     
    10381056        free(revParams); 
    10391057 
    1040         /* Destroy transcoders */ 
    1041         if (fwd) 
    1042                 VideoTranscoderDestroy(fwd); 
    1043         if (rev) 
    1044                 VideoTranscoderDestroy(rev); 
    10451058 
    10461059        /* Unlock module*/ 
Copyright 2006 - Sergio García Murillo
Powered by Trac - Edgewall Software