Bugs item #3554569, was opened at 2012-08-05 09:51
Message generated for change (Comment added) made by rabrab
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3554569&group_id=10706

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: rabrab (rabrab)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error code 0 despite "error writing output file"

Initial Comment:
When converting mp3 to wav (probably in other cases, too), sox ends with exit 
code 0.
Despite the error "writing output file: No space left on device"

SoX v14.3.2
gcc:   4.2.1 (Apple Inc. build 5574)
arch:  1248 48 44 L 

mac/sox FAIL sox: `/Volumes/NO NAME/dummy.wav' error writing output file: No 
space left on device
mac/sox DBUG wav: Finished writing Wave file, 0 data bytes 0 samples

----------------------------------------------------------------------

>Comment By: rabrab (rabrab)
Date: 2012-08-11 09:15

Message:
As this is also happening in 14.4.0, here is a proposed fix.
What it does: Remember if during process() a SOX_EOF occurs, and change the
exit code to 1 in case of an earlier SOX_EOF. There might be a better exit
code to return, and this has not been tested for side effects. (multiple
file processing, etc.)
However, maybe one of you devs has the big picture. I've just been looking
into this for an hour and may be totally off track.

Here's my diff of sox.c:
<code>

2989c2989,2990
<   while (process() != SOX_EOF && !user_abort && current_input <
input_count)
---
>   int lastProcessResult = SOX_SUCCESS;
>   while ( 1 )
2991,2994c2992,2993
<     if (advance_eff_chain() == SOX_EOF)
<       break;
< 
<     if (!save_output_eff)
---
>       lastProcessResult = process();
>       if( lastProcessResult != SOX_EOF && !user_abort && current_input <
input_count )
2996,2998c2995,3006
<       sox_close(ofile->ft);
<       ofile->ft = NULL;
<     }
---
>       if (advance_eff_chain() == SOX_EOF)
>         break;
> 
>       if (!save_output_eff)
>       {
>         sox_close(ofile->ft);
>         ofile->ft = NULL;
>       }
>       } 
>       else 
>               break;
> 
3032c3040,3043
< 
---
>   
>   if( lastProcessResult == SOX_EOF )
>       return 1;
>
 
</code>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3554569&group_id=10706

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to