Packet capturing using pcap

Hi,
i am using a linux CentOS machine. I have 2 real network interfaces
eth0, eth1 and 2 virtual interfaces tap0 and tap1. I am using PCAP library to capture
the packets on theses interfaces. If i specify the interface as "any",
i cannot find a way to know from which interface the packet comes.

Is there any way to know from which interface the packet captured by pcap?
(By analyzing the captured packet or using any other methode)

Thanks in advance
Rahul

Sorry, i don't answer to your question but i'm interesting in how you set up these two virtual interface (i'm currently programming a virtual interface).
For your problem i think there is an easier solution but you can make 4 tcpdump threads for each interface.