Forum NewsForumsHTF Chat Hardware ReviewsSoftware Reviews HTF Events
Home Theater Forum
Home Theater Forum
Home Theater Forum
Home Theater Forum Forum Search: 
 
Web Search: 
 
Home Theater Forum
Home Theater Forum
Home Theater Forum



Reviewed (10/11/08)
Home Theater forum blazes ahead with reviews that are designed to help you make the right viewing choice! This week Ken McAlinden reviews Albert Lewin's MGM adaptation of Oscar Wilde's The Picture of Dorian Gray, a highly awaited release that gets notable recommendation. Todd Erwin gives us two reviews of the recent "Indie" releases, Harold, starring Spencer Breslin -and- Dororo, a live-action comic book adaptation directed by Akihko Shiota. TVShowsOnDVD this week include 30 Rock: Season 2, The Sarah Silverman Program Season Two Volume One, Lil' Bush: resident of the United States Season Two, and Mission Impossible: The Fifth Season. Finally, new Blu-ray reviews include Indiana Jones and the Kingdom of the Crystal Skull, The 40-Year-Old Virgin and Poltergeist.
 
TV and HDTV Programming (10/11/08)
Warm up your cool fall season with new premiers this week that include Little People Big World (PICTURED, 5th Season, 10/13, TLC); Samantha Who? (2nd Season, 10/13, ABC); My Own Worst Enemy (10/13, NBC); Eli Stone (2nd Season, 10/14, ABC); Time Warp (10/15, DISCVRY); Parking Wars (2nd Season, 10/15, A&E); David Alan Grier's Chocolate News (10/15, COMEDY CENTRAL); Crusoe (10/17, NBC) and Real Simple Real Life (10/17, TLC). Season Finales this week include The Cleaner (10/13 A&E); The Rachel Zoe Project (10/14, BRAVO); Project Runway (10/15, BRAVO) and Destination Truth (10/15 SCI-FI). You can discuss all your favorite programs with other HTF members in our TV & HDTV programming forum

 
Forum Jump

Forum Sponsors

Home Theater Forum > Other Diversions > Computers and HTPC
[ C Programmers: HELP!!! ]

Post New Thread  Reply

 
Thread Tools Search this Thread
Home Theater Forum
Old 05-15-2003, 08:03 PM   #1 of 12
Andy Olivera
Member
 
Join Date: Jul 2000
Local Time: 11:20 AM
Local Date: 10-12-2008
Posts: 1,583

Using the meager knowledge from a C course I took 6+ years ago, I'm trying to write a small program that outputs an AVISynth script for decimating frames based on a specific pattern. I don't have the output in the correct order, yet, but that's not the problem. One loop seems to be getting ignored. The particular loop:

while(i < unique)
{
printf("\nSequence:");
scanf("%d", &pattern[i]);
i++;
}


I've tried using do/while and for loops as well, but I get the same result. I tried running the commands outside the loop and it worked fine(but it only runs once, obviously).

The whole couple dozen lines of code are here. I know it's probably something simple I'm missing, but I've looked over everything a dozen or so times and I don't see it. Any help would be appreciated.



\"It is not, and never should be, the policy of the law to require the protection of the foolhardy or reckless few and therefore to deprive, or interfere with, the enjoyment by the remainder of society of the liberties and amenities to which they are rightly entitled.\" -unknown

\"As a society, we tend to believe that every opinion is valid, that there are often no wrong answers, and that self esteem is more important than knowledge. So we grow more confident and more ignorant.\" -Stephen W. Stanton

DVD Count: 205 / LD Count: 51 / My Top & Bottom 20 Films Of All Time
Andy Olivera is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
Home Theater Forum
Home Theater Forum
Old 05-15-2003, 09:17 PM   #2 of 12
Sean Eldridge
Member
 
Join Date: Jan 2000
Local Time: 02:20 PM
Local Date: 10-12-2008
Posts: 888

What are you intializing "i" to and what is "unique?"

Sean

edit: Found your code and I'm looking at it now. Don't know if I'll be able to help.
Sean Eldridge is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
Old 05-15-2003, 09:24 PM   #3 of 12
Sean Eldridge
Member
 
Join Date: Jan 2000
Local Time: 02:20 PM
Local Date: 10-12-2008
Posts: 888

Try making it less than or equal to:

while(i <= unique)

or

for(i = 0; i <= unique; i++)

Sean
Sean Eldridge is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
Old 05-15-2003, 11:11 PM   #4 of 12
Steven K
 
Join Date: Jan 2000
Local Time: 01:20 PM
Local Date: 10-12-2008
Posts: 1,672

Hi Andy,

Not related to the C help you are looking for (looks like Sean provided help but let me know if you need further help) but what are you using AVISynth for exactly?

Are you using it as a frameserver for an MPEG encoder? Why are you trying to decimate frames? One possibility that I can think of is that you are trying to convert an NTSC Video SVCD (29.97 FPS) to an NTSC Film SVCD (23.97 FPS) known as "Inverse Telecining."

You might be able to use a utility called "pulldown.exe" to do this. I use it all the time to do the reverse of this... I encode my SVCDs as 23.97 FPS then use pulldown.exe to write the pulldown flags inside of the file (still 24 FPS but the player is "tricked" into thinking it is 30). This way, your DVD player will perform its own telecine (which it can do for VCD\MPEG-1 by default)
Steven K is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
Home Theater Forum
Home Theater Forum
Old 05-16-2003, 03:08 AM   #5 of 12
Ken Chan
Member
 
Join Date: Apr 1999
Local Time: 11:20 AM
Local Date: 10-12-2008
Posts: 3,303

As a general rule, you should use int, which is the "natural size" for an integer, unless you have a specific reason otherwise. The %d specifier expects an int, not a short. So just change the variable type declaration.

//Ken
Ken Chan is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
HTF Ads



Sponsored links



Home Theater Forum
Home Theater Forum
Old 05-16-2003, 07:43 AM   #6 of 12
Steven K
 
Join Date: Jan 2000
Local Time: 01:20 PM
Local Date: 10-12-2008
Posts: 1,672

Quote:
As a general rule, you should use int

I disagree... and int has a platform specific size, so writing code which uses ints can lead to the code being unportable.
Steven K is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
Home Theater Forum
Home Theater Forum
Old 05-16-2003, 11:53 AM   #7 of 12
MikeAlletto
Member
 
Join Date: Mar 2000
Local Time: 01:20 PM
Local Date: 10-12-2008
Posts: 2,751

Quote:
I disagree... and int has a platform specific size, so writing code which uses ints can lead to the code being unportable.

But if he's just writing this for his own use on his own machine and noone else who cares about portability. If he does care at a later date its not like its a massively complex little program. It'll take about 5 seconds to fix whatever is wrong at a later date to make it compile.



Michael Alletto


MikeAlletto is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
Old 05-16-2003, 12:38 PM   #8 of 12
Steven K
 
Join Date: Jan 2000
Local Time: 01:20 PM
Local Date: 10-12-2008
Posts: 1,672

Mike,

I agree that in THIS case, using its wont hurt.

However, I was responding to Ken's post in which he said "As a general rule, you should use int." I think that, in general, this is not the best solution.

Why not just use long? Then, you always know what size your data type is.
Steven K is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
Home Theater Forum
Home Theater Forum
Old 05-16-2003, 03:11 PM   #9 of 12
Sean Eldridge
Member
 
Join Date: Jan 2000
Local Time: 02:20 PM
Local Date: 10-12-2008
Posts: 888

I never use ints, always longs. Doing my best Forrest Gump impersonation-

You never know what you're going to get.

Sean
Sean Eldridge is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
Old 05-16-2003, 05:39 PM   #10 of 12
Ken Chan
Member
 
Join Date: Apr 1999
Local Time: 11:20 AM
Local Date: 10-12-2008
Posts: 3,303

A long is also platform-specific; it is only guaranteed to be at least 32 bits. On platforms where int is 16, then long will be 32. If int is 32, then long could be 32 or 64. That's what makes C so much fun

longs are probably bigger and slower, and absurdly large for most operations.

//Ken
Ken Chan is offline Quote this post in a PM Send Support Ticket
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote Multi-Quote with this Post
sendpm.gif
Home Theater Forum
Home Theater Forum
Old 05-16-2003, 0