Changeset 218
- 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
| r207 |
r218 |
|
| 37 | 37 | #include <asterisk/causes.h> |
|---|
| 38 | 38 | |
|---|
| 39 | | #include <ffmpeg/avcodec.h> |
|---|
| 40 | | #include <ffmpeg/swscale.h> |
|---|
| | 39 | #include <libavcodec/avcodec.h> |
|---|
| | 40 | #include <libswscale/swscale.h> |
|---|
| 41 | 41 | |
|---|
| 42 | 42 | #ifndef AST_FORMAT_AMR |
|---|
| … | … | |
| 346 | 346 | vtc->end = 1; |
|---|
| 347 | 347 | |
|---|
| | 348 | ast_log(LOG_WARNING,"-joining thread\n"); |
|---|
| | 349 | |
|---|
| 348 | 350 | /* Wait encoder thread to stop */ |
|---|
| 349 | 351 | pthread_join(vtc->encoderThread,0); |
|---|
| | 352 | |
|---|
| | 353 | ast_log(LOG_WARNING,"-joined thread\n"); |
|---|
| 350 | 354 | |
|---|
| 351 | 355 | /* Free pictures */ |
|---|
| … | … | |
| 892 | 896 | /* goto end */ |
|---|
| 893 | 897 | 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); |
|---|
| 901 | 898 | |
|---|
| 902 | 899 | /* Set caller id */ |
|---|
| … | … | |
| 947 | 944 | /* goto end */ |
|---|
| 948 | 945 | 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 | |
|---|
| 949 | 954 | |
|---|
| 950 | 955 | /* Answer channel */ |
|---|
| … | … | |
| 1023 | 1028 | } |
|---|
| 1024 | 1029 | |
|---|
| | 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"); |
|---|
| 1025 | 1040 | |
|---|
| 1026 | 1041 | hangup_pseudo: |
|---|
| … | … | |
| 1031 | 1046 | /* Destroy pseudo channel */ |
|---|
| 1032 | 1047 | ast_hangup(pseudo); |
|---|
| | 1048 | |
|---|
| | 1049 | /* Log */ |
|---|
| | 1050 | ast_log(LOG_WARNING,"<Transcoding\n"); |
|---|
| 1033 | 1051 | |
|---|
| 1034 | 1052 | end: |
|---|
| … | … | |
| 1038 | 1056 | free(revParams); |
|---|
| 1039 | 1057 | |
|---|
| 1040 | | /* Destroy transcoders */ |
|---|
| 1041 | | if (fwd) |
|---|
| 1042 | | VideoTranscoderDestroy(fwd); |
|---|
| 1043 | | if (rev) |
|---|
| 1044 | | VideoTranscoderDestroy(rev); |
|---|
| 1045 | 1058 | |
|---|
| 1046 | 1059 | /* Unlock module*/ |
|---|
Download in other formats:
|
|